dongmou9260 2015-03-05 22:27
浏览 43
已采纳

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

I am attempting to get a go app up on appengine using managed vms. As far as I can tell I have docker running locally fine and all the dependencies fulfilled but when I try and serve it locally I run into the following error:

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

Running MacOs & boot2docker. Have always been able to run appengine locally without issue so I assume this has something to do with docker / the go version there or something else goofy. Would be super grateful to anyone that can point me in the right direction. Doesn't seem to be much out there on this one.

Full trace is below:

➜  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.

For anyone looking, more verbose output can be found here: https://gist.github.com/markhayden/1090aa3c232f56788a1f

Update

Now also getting 2015/03/12 07:34:09 Can't find package "appengine" in $GOPATH: cannot find package "appengine" in any of: when trying to fire things up. Looks like the comment below might have solved the trimpath issue but now this one is stopping me from confirming. Anyone able to help me confirm how I should be setting my gopath / goroot to get this one resolved? Also, its unclear if its trying to locate the missing packages in the docker container or locally on my machine?

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条回答 默认 最新

  • douliao5942 2015-03-10 10:32
    关注

    I posted about this on the google-appengine-go list, the solution is to add the following line to your Dockerfile, at least until the base image is updated.

    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
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥50 远程桌面打开Mastercam、没有许可证、物理机打开正常
  • ¥15 ubuntu安装gdal后java读取tif文件报错
  • ¥15 请问lammps怎么做两种金属连接的原子浓度分布图
  • ¥15 求jacquard数据集
  • ¥15 w10部分软件不能联网
  • ¥15 关于安装hbase的问题(操作系统-windows)
  • ¥15 novnc连接pve虚拟机报错安全协议不支持262
  • ¥15 设备精度0.03给多少公差能达到CPK1.33
  • ¥15 qt+ffmpeg报错non-existing PPS 0 referenced
  • ¥50 MacOS 使用虚拟机安装k8s