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
Closed

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

dmitshur opened this issue Sep 5, 2019 · 2 comments
Labels
Builders x/build issues (builders, bots, dashboards) FrozenDueToAge NeedsFix The path to resolution is known, but the work has not been done.
Milestone

Comments

@dmitshur
Copy link
Contributor

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

@dmitshur dmitshur added Builders x/build issues (builders, bots, dashboards) NeedsFix The path to resolution is known, but the work has not been done. labels Sep 5, 2019
@dmitshur dmitshur added this to the Unreleased milestone Sep 5, 2019
@dmitshur dmitshur self-assigned this Sep 5, 2019
@gopherbot
Copy link

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

@toothrot
Copy link
Contributor

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

codebien pushed 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-on: https://go-review.googlesource.com/c/build/+/193597
Reviewed-by: Andrew Bonventre <andybons@golang.org>
Reviewed-by: Alexander Rakoczy <alex@golang.org>
@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.
Labels
Builders x/build issues (builders, bots, dashboards) FrozenDueToAge NeedsFix The path to resolution is known, but the work has not been done.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants