Go Appengine托管VM问题:未知标志-trimpath

时间:2015-03-05 22:27:44

标签: google-app-engine go gcloud

我正在尝试使用托管虚拟机在appengine上启动应用程序。据我所知,我在本地运行的docker很好并且所有依赖项都已完成但是当我尝试在本地服务时遇到以下错误:

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

运行MacOs& 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

1 个答案:

答案 0 :(得分:2)

google-appengine-go列表中的

posted about this,解决方案是将以下行添加到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