Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

x/build/app/appengine: deploy fails if done in GOPATH mode #34107

Closed
dmitshur opened this issue Sep 5, 2019 · 2 comments

Comments

@dmitshur
Copy link
Member

commented Sep 5, 2019

If one follows the directions to deploy the build dashboard as written at https://github.com/golang/build/tree/master/app/appengine#deploying, there's a risk of creating a bad deployment that serves 500s due to "panic: open app/appengine/notify.txt: no such file or directory".

(This may explain why we had trouble deploying it recently depending on who did it. /cc @toothrot @andybons)

Cause

It happens if gcloud app deploy ends up using GOPATH mode rather than module mode. That changes the root of the bundle uploaded from repository root to the directory containing app.yaml.¹

¹ https://cloud.google.com/appengine/docs/standard/go111/specifying-dependencies#declaring_and_managing_dependencies


Compare:

Step #1 - "builder": 2019/09/05 12:28:01 Copying /workspace/_gopath/src/golang.org to /tmp/staging828291337/srv/gopath/src/golang.org
[...]
Step #1 - "builder": 2019/09/05 12:28:03 Building from Go source in /tmp/staging104778647/srv/gopath/src/golang.org/x/build/app/appengine, with main package at golang.org/x/build/app/appengine

Step #1 - "builder": 2019/09/05 12:36:38 Building /tmp/staging094441256/srv, with main package at ./app/appengine, saving to /tmp/staging094441256/usr/local/bin/start
Step #1 - "builder": 2019/09/05 12:36:38 Running [...] GO111MODULE=on go build [...]

image

Fix

Setting GO111MODULE=on or deploying from outside GOPATH/src makes it work, but it's easy to accidentally deploy in GOPATH mode, e.g., when relying on Go 1.13 with its new GO111MODULE=auto behavior, because gcloud app deploy doesn't use the same logic.

I'll send a fix by prepending GO111MODULE=on to the deploy command in the README.

@gopherbot

This comment has been minimized.

Copy link

commented Sep 5, 2019

Change https://golang.org/cl/193597 mentions this issue: app/appengine: set GO111MODULE=on for deploy

@toothrot

This comment has been minimized.

Copy link
Contributor

commented Sep 5, 2019

The path differences between module mode and GOPATH mode also complicate local development with dev_appserver.py, which doesn't seem to support module mode in my brief testing. I'll file a bug for that, as well as for moving this deployment to Cloud Build, which should help us form a consistent build environment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.