-
Notifications
You must be signed in to change notification settings - Fork 18k
x/build/app/appengine: local development server panics on pageload #34116
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
Comments
Thanks for describing the issue in detail. The suggested fix sounds very reasonable to me. It seems better compared to alternatives 1 and 2. Alternative 3 is also a good one. I want to offer another alternative for us to consider (either as a solution now, or a long term direction to move in): Another way to resolve this problem is to move away from using In the "Migrating your App Engine app from Go 1.9 to Go 1.11" document, one of the described changes is that it's possible to write an App Engine app that's more like non-App Engine apps, meaning it has a We already do this for some projects that need to be deployed to App Engine but also run locally. For example, the tour. See CL 165537. Some disadvantages of this approach:
It's worth considering our longer-term goal of merging the build dashboard code into |
Great point, I forgot about that option! I think that moving off |
It seems CL 194643 implements this, just with an inverse order of the lookups. /cc @bradfitz |
Change https://golang.org/cl/194643 mentions this issue: |
Also, because this is the first CL in this package to add tests, add a helper to return the right template filename depending on the environment (go test vs prod) so tests don't panic in init. Fixes golang/go#34097 Updates golang/go#34116 Change-Id: I4b3e83c2417611cfbdc32e27941dbb90687eb509 Reviewed-on: https://go-review.googlesource.com/c/build/+/194643 Reviewed-by: Dmitri Shuralyov <[email protected]>
I believe this issue is resolved, see #34116 (comment). @toothrot Do you concur? |
I think we can consider this resolved. I'll file a new bug to move off |
Also, because this is the first CL in this package to add tests, add a helper to return the right template filename depending on the environment (go test vs prod) so tests don't panic in init. Fixes golang/go#34097 Updates golang/go#34116 Change-Id: I4b3e83c2417611cfbdc32e27941dbb90687eb509 Reviewed-on: https://go-review.googlesource.com/c/build/+/194643 Reviewed-by: Dmitri Shuralyov <[email protected]>
Issue
Running dev_appserver.py locally causes the following issue:
$ dev_appserver.py app.yaml ... panic: open app/appengine/perf_graph.html: no such file or directory goroutine 1 [running]: html/template.Must(0x0, 0xbbcd80, 0xc0002ce060, 0x1) /home/rakoczy/.goenv/versions/1.13rc1/src/html/template/template.go:372 +0x54 main.init() /home/rakoczy/development/build/app/appengine/perf_graph.go:240 +0x6c4 panic: open app/appengine/perf_graph.html: no such file or directory
Cause
This was caused by a remediation for
go111
module mode in app engine, which calculates repository paths on upload based on the location of thego.mod
file in the repository.See: golang/build@c073844
Suggested fix
To workaround
dev_appserver.py
's differences with App Engine, we could detect if the file exists inapp/appengine
before falling back to a local file (for example,app/appengine/perf_graph.html
andperf_graph.html
as the fallback).Ideally this is temporary until either we can easily create a nested module with AppEngine (see alternative 1 below), or until a fix for
dev_appserver.py
is completed.Alternatives
Create a nested module in
app/appengine/go.mod
This would involve all the complications of migrating to a nested module: cmd/go: setting up a multi-module single repo is difficult #27056 (comment).
I've explored this a bit. The biggest issue is that AppEngine doesn't currently respect rewrite rules at upload time, which means that adding the local dependency for
golang.org/x/build
requires a potentially non-buildable commit to be merged, followed by a correction commit.Move
app/appengine/app.yaml
to the root of x/build, and supply a main directive that points toapp/appengine
.Making this concession seems at odds with the organization of the x/build repo.
Move to Cloud Run and Docker.
See #34107, which discusses deployment time issues with GOPATH vs module mode.
/cc @dmitshur @andybons
The text was updated successfully, but these errors were encountered: