Go Appengine Managed VM 问题:未知标志 -trimpath
Go Appengine Managed VM issue: unknown flag -trimpath
我正在尝试使用托管虚拟机在 AppEngine 上启动一个 Go 应用程序。据我所知,我在本地 docker 运行ning 正常并且所有依赖项都已满足但是当我尝试在本地提供服务时我 运行 出现以下错误:
INFO 2015-03-05 22:21:14,917 containers.py:280] /goroot/pkg/tool/linux_amd64/6g: unknown flag -trimpath
INFO 2015-03-05 22:21:14,922 containers.py:280] 2015/03/05 22:21:14 go-app-builder: build timing: 1×6g (5ms total), 0×gopack (0 total), 0×6l (0 total)
INFO 2015-03-05 22:21:14,923 containers.py:280] 2015/03/05 22:21:14 go-app-builder: failed running 6g: exit status 1
运行 MacO 和 boot2docker。一直能够毫无问题地在本地 运行 appengine 所以我认为这与 docker / 那里的 go 版本或其他愚蠢的东西有关。非常感谢任何能为我指明正确方向的人。似乎没有太多关于这个的。
完整跟踪如下:
➜ appengine-try-go gcloud preview app run ./app.yaml
Module [default] found in file [/Users/markhayden/google-cloud-sdk/platform/google_appengine/goroot/src/appengine-try-go/app.yaml]
INFO: Looking for the Dockerfile in /Users/markhayden/google-cloud-sdk/platform/google_appengine/goroot/src/appengine-try-go
INFO: Using Dockerfile found in /Users/markhayden/google-cloud-sdk/platform/google_appengine/goroot/src/appengine-try-go
INFO 2015-03-05 22:21:13,424 devappserver2.py:726] Skipping SDK update check.
INFO 2015-03-05 22:21:13,485 api_server.py:172] Starting API server at: http://localhost:63533
INFO 2015-03-05 22:21:13,521 vm_runtime_proxy_go.py:107] Starting Go VM Deployment process
INFO 2015-03-05 22:21:13,521 dispatcher.py:186] Starting module "default" running at: http://localhost:8080
INFO 2015-03-05 22:21:13,524 admin_server.py:118] Starting admin server at: http://localhost:8000
INFO 2015-03-05 22:21:13,545 containers.py:259] Building docker image whiskey-tango-foxtrot.default.1 from /var/folders/lv/9hzw2s5d25v17j4wph5pl46c0000gn/T/tmpFreenWgo_deployment_dir/Dockerfile:
INFO 2015-03-05 22:21:13,545 containers.py:261] -------------------- DOCKER BUILD --------------------
INFO 2015-03-05 22:21:14,312 containers.py:280] ---> 3b6b889b2273
INFO 2015-03-05 22:21:14,312 containers.py:280] Step 1 : ADD . /app
INFO 2015-03-05 22:21:14,561 containers.py:280] ---> b994e021ab2e
INFO 2015-03-05 22:21:14,570 containers.py:280] Removing intermediate container 332c78e9be28
INFO 2015-03-05 22:21:14,571 containers.py:280] Step 2 : RUN /bin/bash /app/_ah/build.sh
INFO 2015-03-05 22:21:14,676 containers.py:280] ---> Running in 7e4157c8b5b2
INFO 2015-03-05 22:21:14,905 containers.py:280] b02fde1ce30965d84e52f461de37655580e16956 /app/_ah/gab
INFO 2015-03-05 22:21:14,917 containers.py:280] /goroot/pkg/tool/linux_amd64/6g: unknown flag -trimpath
INFO 2015-03-05 22:21:14,922 containers.py:280] 2015/03/05 22:21:14 go-app-builder: build timing: 1×6g (5ms total), 0×gopack (0 total), 0×6l (0 total)
INFO 2015-03-05 22:21:14,923 containers.py:280] 2015/03/05 22:21:14 go-app-builder: failed running 6g: exit status 1
ERROR 2015-03-05 22:21:15,097 containers.py:283] The command [/bin/sh -c /bin/bash /app/_ah/build.sh] returned a non-zero code: 1
INFO 2015-03-05 22:21:15,097 containers.py:292] --------------------------------------------------------
INFO 2015-03-05 22:21:15,098 vm_runtime_proxy_go.py:133] Go VM Deployment process failed: Docker build aborted: The command [/bin/sh -c /bin/bash /app/_ah/build.sh] returned a non-zero code: 1
ERROR 2015-03-05 22:21:15,098 instance.py:280] Docker build aborted: The command [/bin/sh -c /bin/bash /app/_ah/build.sh] returned a non-zero code: 1
INFO 2015-03-05 22:21:15,098 health_check_service.py:101] Health checks starting for instance 0.
任何人都可以在此处找到更详细的输出:https://gist.github.com/markhayden/1090aa3c232f56788a1f
更新
现在在尝试启动时也会得到 2015/03/12 07:34:09 Can't find package "appengine" in $GOPATH: cannot find package "appengine" in any of:
。看起来下面的评论可能已经解决了 trimpath 问题,但现在这个评论阻止我确认。任何人都能够帮助我确认我应该如何设置我的 gopath / goroot 来解决这个问题?另外,不清楚它是在 docker 容器中还是在我的机器上本地查找丢失的包?
INFO 2015-03-12 07:34:11,311 containers.py:280] b02fde1ce30965d84e52f461de37655580e16956 /app/_ah/gab
INFO 2015-03-12 07:34:11,359 containers.py:280] 2015/03/12 07:34:09 Can't find package "appengine" in $GOPATH: cannot find package "appengine" in any of:
INFO 2015-03-12 07:34:11,360 containers.py:280] /goroot/src/appengine (from $GOROOT)
INFO 2015-03-12 07:34:11,364 containers.py:280] /gopath/src/appengine (from $GOPATH)
INFO 2015-03-12 07:34:11,720 containers.py:280] /tmp/work/main.go:4: can't find import: "appengine"
INFO 2015-03-12 07:34:11,721 containers.py:280] 2015/03/12 07:34:09 go-app-builder: build timing: 3×6g (355ms total), 0×gopack (0 total), 0×6l (0 total)
INFO 2015-03-12 07:34:11,722 containers.py:280] 2015/03/12 07:34:09 go-app-builder: failed running 6g: exit status 1
ERROR 2015-03-12 07:34:11,937 containers.py:283] The command [/bin/sh -c /bin/bash /app/_ah/build.sh] returned a non-zero code: 1
我 posted about this 在 google-appengine-go 列表中,解决方案是将以下行添加到您的 Dockerfile,至少在更新基础映像之前。
RUN rm -rf /goroot && mkdir /goroot && curl https://storage.googleapis.com/golang/go1.4.2.linux-amd64.tar.gz | tar xvzf - -C /goroot --strip-components=1
我正在尝试使用托管虚拟机在 AppEngine 上启动一个 Go 应用程序。据我所知,我在本地 docker 运行ning 正常并且所有依赖项都已满足但是当我尝试在本地提供服务时我 运行 出现以下错误:
INFO 2015-03-05 22:21:14,917 containers.py:280] /goroot/pkg/tool/linux_amd64/6g: unknown flag -trimpath
INFO 2015-03-05 22:21:14,922 containers.py:280] 2015/03/05 22:21:14 go-app-builder: build timing: 1×6g (5ms total), 0×gopack (0 total), 0×6l (0 total)
INFO 2015-03-05 22:21:14,923 containers.py:280] 2015/03/05 22:21:14 go-app-builder: failed running 6g: exit status 1
运行 MacO 和 boot2docker。一直能够毫无问题地在本地 运行 appengine 所以我认为这与 docker / 那里的 go 版本或其他愚蠢的东西有关。非常感谢任何能为我指明正确方向的人。似乎没有太多关于这个的。
完整跟踪如下:
➜ appengine-try-go gcloud preview app run ./app.yaml
Module [default] found in file [/Users/markhayden/google-cloud-sdk/platform/google_appengine/goroot/src/appengine-try-go/app.yaml]
INFO: Looking for the Dockerfile in /Users/markhayden/google-cloud-sdk/platform/google_appengine/goroot/src/appengine-try-go
INFO: Using Dockerfile found in /Users/markhayden/google-cloud-sdk/platform/google_appengine/goroot/src/appengine-try-go
INFO 2015-03-05 22:21:13,424 devappserver2.py:726] Skipping SDK update check.
INFO 2015-03-05 22:21:13,485 api_server.py:172] Starting API server at: http://localhost:63533
INFO 2015-03-05 22:21:13,521 vm_runtime_proxy_go.py:107] Starting Go VM Deployment process
INFO 2015-03-05 22:21:13,521 dispatcher.py:186] Starting module "default" running at: http://localhost:8080
INFO 2015-03-05 22:21:13,524 admin_server.py:118] Starting admin server at: http://localhost:8000
INFO 2015-03-05 22:21:13,545 containers.py:259] Building docker image whiskey-tango-foxtrot.default.1 from /var/folders/lv/9hzw2s5d25v17j4wph5pl46c0000gn/T/tmpFreenWgo_deployment_dir/Dockerfile:
INFO 2015-03-05 22:21:13,545 containers.py:261] -------------------- DOCKER BUILD --------------------
INFO 2015-03-05 22:21:14,312 containers.py:280] ---> 3b6b889b2273
INFO 2015-03-05 22:21:14,312 containers.py:280] Step 1 : ADD . /app
INFO 2015-03-05 22:21:14,561 containers.py:280] ---> b994e021ab2e
INFO 2015-03-05 22:21:14,570 containers.py:280] Removing intermediate container 332c78e9be28
INFO 2015-03-05 22:21:14,571 containers.py:280] Step 2 : RUN /bin/bash /app/_ah/build.sh
INFO 2015-03-05 22:21:14,676 containers.py:280] ---> Running in 7e4157c8b5b2
INFO 2015-03-05 22:21:14,905 containers.py:280] b02fde1ce30965d84e52f461de37655580e16956 /app/_ah/gab
INFO 2015-03-05 22:21:14,917 containers.py:280] /goroot/pkg/tool/linux_amd64/6g: unknown flag -trimpath
INFO 2015-03-05 22:21:14,922 containers.py:280] 2015/03/05 22:21:14 go-app-builder: build timing: 1×6g (5ms total), 0×gopack (0 total), 0×6l (0 total)
INFO 2015-03-05 22:21:14,923 containers.py:280] 2015/03/05 22:21:14 go-app-builder: failed running 6g: exit status 1
ERROR 2015-03-05 22:21:15,097 containers.py:283] The command [/bin/sh -c /bin/bash /app/_ah/build.sh] returned a non-zero code: 1
INFO 2015-03-05 22:21:15,097 containers.py:292] --------------------------------------------------------
INFO 2015-03-05 22:21:15,098 vm_runtime_proxy_go.py:133] Go VM Deployment process failed: Docker build aborted: The command [/bin/sh -c /bin/bash /app/_ah/build.sh] returned a non-zero code: 1
ERROR 2015-03-05 22:21:15,098 instance.py:280] Docker build aborted: The command [/bin/sh -c /bin/bash /app/_ah/build.sh] returned a non-zero code: 1
INFO 2015-03-05 22:21:15,098 health_check_service.py:101] Health checks starting for instance 0.
任何人都可以在此处找到更详细的输出:https://gist.github.com/markhayden/1090aa3c232f56788a1f
更新
现在在尝试启动时也会得到 2015/03/12 07:34:09 Can't find package "appengine" in $GOPATH: cannot find package "appengine" in any of:
。看起来下面的评论可能已经解决了 trimpath 问题,但现在这个评论阻止我确认。任何人都能够帮助我确认我应该如何设置我的 gopath / goroot 来解决这个问题?另外,不清楚它是在 docker 容器中还是在我的机器上本地查找丢失的包?
INFO 2015-03-12 07:34:11,311 containers.py:280] b02fde1ce30965d84e52f461de37655580e16956 /app/_ah/gab
INFO 2015-03-12 07:34:11,359 containers.py:280] 2015/03/12 07:34:09 Can't find package "appengine" in $GOPATH: cannot find package "appengine" in any of:
INFO 2015-03-12 07:34:11,360 containers.py:280] /goroot/src/appengine (from $GOROOT)
INFO 2015-03-12 07:34:11,364 containers.py:280] /gopath/src/appengine (from $GOPATH)
INFO 2015-03-12 07:34:11,720 containers.py:280] /tmp/work/main.go:4: can't find import: "appengine"
INFO 2015-03-12 07:34:11,721 containers.py:280] 2015/03/12 07:34:09 go-app-builder: build timing: 3×6g (355ms total), 0×gopack (0 total), 0×6l (0 total)
INFO 2015-03-12 07:34:11,722 containers.py:280] 2015/03/12 07:34:09 go-app-builder: failed running 6g: exit status 1
ERROR 2015-03-12 07:34:11,937 containers.py:283] The command [/bin/sh -c /bin/bash /app/_ah/build.sh] returned a non-zero code: 1
我 posted about this 在 google-appengine-go 列表中,解决方案是将以下行添加到您的 Dockerfile,至少在更新基础映像之前。
RUN rm -rf /goroot && mkdir /goroot && curl https://storage.googleapis.com/golang/go1.4.2.linux-amd64.tar.gz | tar xvzf - -C /goroot --strip-components=1