dougong2306 2018-05-14 16:07
浏览 66

在App Engine Standard上进行销售

I know this topic has been referenced a few times already. Unfortunately I still wasn't able to find a working solution for my use case.

I can't seem to get vendoring working for my Go application on App Engine Standard. I'm using dep for vendoring.

I'm building a GraphQL API and here is my folder structure:

/GOPATH
└──/src
   └──/acme
      ├──/app
      |   ├── app.yaml
      |   └── app.go
      ├──/src
      |   ├── /mutations/
      |   ├── /queries/
      |   └── /types/
      └──/vendor/

Running goapp serve app/app.yaml on Cloud Shell fails with

INFO     2018-05-14 15:42:08,386 devappserver2.py:764] Skipping SDK update check.
INFO     2018-05-14 15:42:08,471 api_server.py:268] Starting API server at: http://0.0.0.0:47213
INFO     2018-05-14 15:42:08,600 dispatcher.py:199] Starting module "default" running at: http://0.0.0.0:8080
INFO     2018-05-14 15:42:08,601 admin_server.py:116] Starting admin server at: http://0.0.0.0:8000
ERROR    2018-05-14 15:42:13,983 go_runtime.py:181] Failed to build Go application: (Executed command: /google/go_appengine/goroot/bin/go-app-builder -app_base /home/xxx/gopath/src/acme/app -arch 6 -dynamic -goroot /google/go_appengine/goroot -gopath /home/xxx/gopath:/google/gopath -nobuild_files ^^$ -incremental_rebuild -unsafe -binary_name _go_app -extra_imports appengine_internal/init -work_dir /tmp/tmpbt8DA2appengine-go-bin -gcflags -I,/google/go_appengine/goroot/pkg/linux_amd64_appengine -ldflags -L,/google/go_appengine/goroot/pkg/linux_amd64_appengine app.go)
/home/xxx/gopath/src/acme/vendor/github.com/graphql-go/graphql/definition.go:4: can't find import: "context"

2018/05/14 15:42:09 Can't find package "context" in $GOPATH: cannot find package "context" in any of:
        /home/xxx/gopath/src/acme/vendor/context (vendor tree)
        /google/go_appengine/goroot/src/context (from $GOROOT)
        /home/xxx/gopath/src/context (from $GOPATH)
        /google/gopath/src/context

Looks like the problem might be that one vendor is not using a full dependency name for "context". (EDIT: probably not the case though since I’m using 1.8)

Has anyone ever managed to successfully deploy on App Engine Standard using vendoring? Been pulling my hair all day on this.

  • 写回答

3条回答 默认 最新

  • drg14799 2018-05-15 06:19
    关注

    The context package will be inside $GOROOT ( not in vendor directory ). Probably your Go Appengine SDK is old and does not support Go 1.8.

    Update your SDK to the latest version. The $GOROOT should be like /path/to/somewhere/goroot-1.8

    评论

报告相同问题?