Open GoogleCodeExporter opened 8 years ago
It looks like it could be the default Dockerfile from the SDK. As follows: #
Dockerfile extending the generic Go image with application files for a
# single application.
FROM gcr.io/google_appengine/golang
COPY . /go/src/app
RUN go-wrapper download
RUN go-wrapper install -tags appenginevm
gcloud-golang-todos example has a different Dockerfile:
FROM gcr.io/google_appengine/go-compat
# TODO: Remove once base image updates to 1.4.2 toolchain.
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
ADD . /app
RUN /bin/bash /app/_ah/build.sh
After changing the default Dockerfile, the app was able to run. However I was
not abled to deploy, see following error:
DEBUG: Host: appengine.google.com
DEBUG: _Authenticate configuring auth; needs_auth=False
DEBUG: Sending request to
https://appengine.google.com/api/vms/prepare?app_id=humming-au
headers={'X-appcfg-api-version': '1', 'content-length': '0', 'Content-Type':
'application/octet-stream'} body=
INFO: Attempting refresh to obtain initial access_token
INFO: Refreshing access_token
DEBUG: Got response: {bucket: vm-containers.humming-au.appspot.com, path:
/containers}
INFO: Refreshing access_token
DEBUG: Detected docker environment variables:
DOCKER_HOST=tcp://192.168.59.103:2376,
DOCKER_CERT_PATH=/Users/terry/.boot2docker/certs/boot2docker-vm,
DOCKER_TLS_VERIFY=1
INFO: Starting new HTTPS connection (1): 192.168.59.103
DEBUG: "GET /v1.10/_ping HTTP/1.1" 200 2
Updating module [default] from file [/Users/terry/go/src/demo/app.yaml]
INFO: Looking for the Dockerfile in /Users/terry/go/src/demo
INFO: Using Dockerfile found in /Users/terry/go/src/demo
INFO: Building docker image humming-au.default.20150502t131811 from
/Users/terry/go/src/demo/Dockerfile:
INFO: -------------------- DOCKER BUILD --------------------
DEBUG: "POST
/v1.10/build?pull=True&nocache=False&q=False&t=humming-au.default.20150502t13181
1&forcerm=False&rm=True HTTP/1.1" 200 None
INFO: Step 0 : FROM gcr.io/google_appengine/go-compat
INFO: ---> 0cd813bd386d
INFO: Step 1 : 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
INFO: ---> Using cache
INFO: ---> c04d5ca72d02
INFO: Step 2 : ADD . /app
INFO: ---> c9697e8b62c6
INFO: Removing intermediate container 92da1df4aede
INFO: Step 3 : RUN /bin/bash /app/_ah/build.sh
INFO: ---> Running in b49ad182f4a9
INFO: /bin/bash: /app/_ah/build.sh: No such file or directory
ERROR: The command [/bin/sh -c /bin/bash /app/_ah/build.sh] returned a non-zero
code: 127
INFO: --------------------------------------------------------
Traceback (most recent call last):
File "/Users/terry/google-cloud-sdk/./lib/googlecloudsdk/gcloud/gcloud.py", line 211, in <module>
main()
File "/Users/terry/google-cloud-sdk/./lib/googlecloudsdk/gcloud/gcloud.py", line 207, in main
_cli.Execute()
File "/Users/terry/google-cloud-sdk/./lib/googlecloudsdk/calliope/cli.py", line 617, in Execute
result = args.cmd_func(cli=self, args=args)
File "/Users/terry/google-cloud-sdk/./lib/googlecloudsdk/calliope/backend.py", line 1110, in Run
result = command_instance.Run(args)
File "/Users/terry/google-cloud-sdk/./lib/googlecloudsdk/calliope/exceptions.py", line 86, in TryFunc
return func(*args, **kwargs)
File "/Users/terry/google-cloud-sdk/lib/googlecloudsdk/appengine/app_commands/deploy.py", line 143, in Run
info.runtime, docker_client)
File "/Users/terry/google-cloud-sdk/./lib/googlecloudsdk/appengine/lib/images/push.py", line 64, in BuildAndPushDockerImage
nocache=False)) as image:
File "/Users/terry/google-cloud-sdk/./lib/googlecloudsdk/appengine/lib/docker/containers.py", line 119, in __enter__
self.Build()
File "/Users/terry/google-cloud-sdk/./lib/googlecloudsdk/appengine/lib/docker/containers.py", line 188, in Build
raise ImageError(msg)
googlecloudsdk.appengine.lib.docker.containers.ImageError: Docker build
aborted: The command [/bin/sh -c /bin/bash /app/_ah/build.sh] returned a
non-zero code: 127
Original comment by terry.wa...@gmail.com
on 2 May 2015 at 3:25
I just saw the note on the appengine website, for go developers to use
appcfg.py to update the VM application.
This is no longer an issue unless you plan to use gcloud deploy.
Original comment by terry.wa...@gmail.com
on 2 May 2015 at 11:11
Hi, I'm trying to build a go app and running it in google cloud managed vm
flavour.
My first step is trying to launch the hello world demo app:
https://github.com/golang/appengine/tree/master/demos/guestbook
First of all, I got the error described above, after changing the Dockerfile, I
get lots of 'cannot find package xxxx', then I run 'go get', to download
dependencies, and it throws following error:
helloworld $ go get
go install: no install location for directory
/home/matias/sandbox/appengine/demos/helloworld outside GOPATH
helloworld $
GOPATH is set to /home/matias/sandbox/appengine/demos/helloworld
Lots of packages got downloaded, but it looks like not enough, I'm still
getting some 'cannot find pacakge':
helloworld $ gcloud preview app run app.yaml
INFO 2015-05-23 13:32:29,336 containers.py:280] 2015/05/23 13:32:29 Can't
find package "golang.org/x/text/encoding" in $GOPATH: cannot find package
"golang.org/x/text/encoding" in any of:
/goroot/src/golang.org/x/text/encoding (from $GOROOT)
/gopath/src/golang.org/x/text/encoding (from $GOPATH)
and lots of others...
Regards,
Matías.
Original comment by matias.b...@gmail.com
on 23 May 2015 at 1:34
It may have something to do with your GOPATH structure. Try and set you
structure and GOPATH as describe in this
https://golang.org/doc/code.html#Organization.
Original comment by terry.wa...@gmail.com
on 24 May 2015 at 12:17
Is this issue still active? Can anyone still effected comment on whether
they've verified the correct project structure as mentionde by @terry.warwar in
post #4?
Original comment by pay...@google.com
on 4 Apr 2016 at 7:16
I am also affected as well, I have my own custom packages hosted via google
cloud platform and also import the google.golang.org/appengine package in my
source code, builds find with python build tool but borks on both packages in
the deploy process.
//Output
+ exec go install -v -tags appenginevm
app.go:7:2: cannot find package "google.golang.org/appengine" in any of:
/usr/local/go/src/google.golang.org/appengine (from $GOROOT)
/go/src/google.golang.org/appengine (from $GOPATH)
/go/src/app/_gopath/src/google.golang.org/appengine
The command '/bin/sh -c go-wrapper install -tags appenginevm' returned a
non-zero code: 1
ERROR
ERROR: build step "gcr.io/cloud-builders/dockerizer" failed: exit status 1
ERROR: (gcloud.preview.app.deploy) Error Response: [2] Build failed; check
build logs for details
Original comment by ppark...@v4development.com
on 8 Apr 2016 at 4:14
@pparkins, Do you still get the same error when deploying using 'appcfg.py
update' or 'goapp deploy'?
Original comment by ngeli...@google.com
on 8 Apr 2016 at 6:18
I tried going the python go_appengine/appcfg.py update method but the
differences in the yaml file for the flexible environment kicked back on
vm:true, I'm pretty sure I've got the latest version of the goappeng sdk from a
couple days ago but it may be something in my environment. I am running
natively golang v1.6 if that is any help.
Original comment by ppark...@v4development.com
on 8 Apr 2016 at 6:50
To provide more specific helpful information, we would need to know the
following:
What error or stack trace are you getting?
Which command line tool are you using? (appcfg.py update or goapp deploy)
Are you indeed using the flexible environment with vm: true in app.yaml?
Are you using the go runtime with runtime: go or within a Docker container
using runtime: custom?
If the latter, which Docker image are you pulling?
Original comment by ngeli...@google.com
on 11 Apr 2016 at 8:36
Any response on the questions asked by ngelinas?
Original comment by pay...@google.com
on 20 Apr 2016 at 11:24
I think I have it figured out, my $GOPATH at the time and the structure of my
dependent packages was causing some kind of circular dependency. I've got it
working correctly now after some tweaking. To answer your questions though for
others my config when it was not working was this:
- The command line tool I was using: appcfg.py
- Flexible environment flag in yaml was vm: true
- runtime: go flag was used
- using the standard docker container for above flag
Original comment by ppark...@v4development.com
on 21 Apr 2016 at 1:13
[deleted comment]
@pparkins:
Great to hear it's resolved, and thank you so much for going to the lengths of
helping future users with an explanation!
---
Is anybody else still experiencing this issue?
Original comment by pay...@google.com
on 21 Apr 2016 at 7:43
Original issue reported on code.google.com by
terry.wa...@gmail.com
on 1 May 2015 at 10:58