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

dmitshur opened this issue Sep 5, 2019 · 2 comments

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

dmitshur opened this issue Sep 5, 2019 · 2 comments


Copy link

@dmitshur dmitshur commented Sep 5, 2019

If one follows the directions to deploy the build dashboard as written at, 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)


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



Step #1 - "builder": 2019/09/05 12:28:01 Copying /workspace/_gopath/src/ to /tmp/staging828291337/srv/gopath/src/
Step #1 - "builder": 2019/09/05 12:28:03 Building from Go source in /tmp/staging104778647/srv/gopath/src/, with main package at

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 [...]



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.

Copy link

@gopherbot gopherbot commented Sep 5, 2019

Change mentions this issue: app/appengine: set GO111MODULE=on for deploy

Copy link

@toothrot toothrot commented Sep 5, 2019

The path differences between module mode and GOPATH mode also complicate local development with, 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.

codebien added a commit to codebien/build that referenced this issue Nov 13, 2019
Deploying in GOPATH mode is not supported, so explicitly specify
GO111MODULE=on to use module mode regardless of local setup.

Fixes golang/go#34107

Change-Id: I5bc2518c4cd4c329eea65684fec96aae5b0bf808
GitHub-Last-Rev: 93f780c
GitHub-Pull-Request: golang#23
Reviewed-by: Andrew Bonventre <>
Reviewed-by: Alexander Rakoczy <>
@golang golang locked and limited conversation to collaborators Sep 4, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

3 participants