5
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

gcloud app deploy で cannot import internal package エラー

Last updated at Posted at 2017-12-06

以下のようなエラーがでる。

ERROR: (gcloud.app.deploy) Error Response: [9] Deployment contains files that cannot be compiled: Compile failed:
2017/12/05 23:43:37 go-app-builder: Failed parsing input: package "github.com/Michael-Inc/carapp-server/vendor/google.golang.org/appengine/file" cannot import internal package "google.golang.org/appengine/internal"

src/cmd/go-app-builder/parser.go で以下のように import を処理している。

for path := range imports {
	pkg, ok := app.PackageIndex[path]
	if !ok {
		// A file declared an import we don't know.
		// It could be a package from the standard library.
		if findInternal(path) {
			return nil, fmt.Errorf("package %q cannot import internal package %q", p.ImportPath, path)
		}
		continue
	}
	p.Dependencies = append(p.Dependencies, pkg)
}

findInternal は以下のとおり。

func findInternal(path string) bool {
	return strings.HasSuffix(path, "/internal") ||
		strings.HasPrefix(path, "internal/") ||
		strings.Contains(path, "/internal/") ||
		path == "internal"
}

internal という名前だとエラーにされてしまう。

まだ解決されていない模様 https://issuetracker.google.com/issues/38449183

5
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
5
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?