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: deploying with dirty working tree affects the deploy #34936

Closed
bradfitz opened this issue Oct 16, 2019 · 9 comments
Milestone

Comments

@bradfitz
Copy link
Member

@bradfitz bradfitz commented Oct 16, 2019

Following the instructions at https://github.com/golang/build/tree/master/app/appengine#deploying I can no longer deploy:

bradfitz@go:~/src/golang.org/x/build/app/appengine$ GO111MODULE=on gcloud app --account=bradfitz@google.com --project=golang-org deploy app.yaml
Services to deploy:
        
descriptor:      [/home/bradfitz/src/golang.org/x/build/app/appengine/app.yaml]
source:          [/home/bradfitz/src/golang.org/x/build/app/appengine]
target project:  [golang-org]
target service:  [build]
target version:  [20191016t151730]
target url:      [https://build-dot-golang-org.appspot.com]


Do you want to continue (Y/n)?

Beginning deployment of service [build]...
╔════════════════════════════════════════════════════════════╗
╠═ Uploading 263 files to Google Cloud Storage              ═╣
╚════════════════════════════════════════════════════════════╝
File upload done.
ERROR: (gcloud.app.deploy) INVALID_ARGUMENT: Filename cannot contain '.', '..', '\r', start with '-', '_ah/', or '\n': cmd/coordinator/coordinator.

What changed?

Docs old?

/cc @toothrot @dmitshur @bcmills @andybons

@gopherbot gopherbot added this to the Unreleased milestone Oct 16, 2019
@gopherbot gopherbot added the Builders label Oct 16, 2019
@dmitshur

This comment has been minimized.

Copy link
Member

@dmitshur dmitshur commented Oct 16, 2019

Docs worked when I deployed last, on Oct 8. I use --no-promote flag explicitly and then promote after making sure the new version looks okay, but I don't expect that to cause the difference above.

Is your git status clean and are you on latest master commit of x/build?

I'm trying a --no-promote deploy now and not seeing any issues so far:


appengine $ GO111MODULE=on gcloud --project=golang-org app deploy --no-promote app.yaml
Services to deploy:

descriptor:      [/Users/dmitshur/go/src/golang.org/x/build/app/appengine/app.yaml]
source:          [/Users/dmitshur/go/src/golang.org/x/build/app/appengine]
target project:  [golang-org]
target service:  [build]
target version:  [20191016t122939]
target url:      [https://20191016t122939-dot-build-dot-golang-org.appspot.com]


     (add --promote if you also want to make this service available from
     [https://build-dot-golang-org.appspot.com])

Do you want to continue (Y/n)?  Y

Beginning deployment of service [build]...
╔════════════════════════════════════════════════════════════╗
╠═ Uploading 1 file to Google Cloud Storage                 ═╣
╚════════════════════════════════════════════════════════════╝
File upload done.
Updating service [build]...done.                                               
Deployed service [build] to [https://20191016t122939-dot-build-dot-golang-org.appspot.com]

You can stream logs from the command line by running:
  $ gcloud app logs tail -s build

To view your application in the web browser run:
  $ gcloud app browse -s build --project=golang-org


Updates are available for some Cloud SDK components.  To install them,
please run:
  $ gcloud components update

@gopherbot

This comment has been minimized.

Copy link

@gopherbot gopherbot commented Oct 16, 2019

Change https://golang.org/cl/201477 mentions this issue: app/appengine: update deploy instructions

@bradfitz

This comment has been minimized.

Copy link
Member Author

@bradfitz bradfitz commented Oct 16, 2019

I did have an empty file cmd/coordinator/coordinator. (final period). Now that that's deleted, it makes it further but fails with Cloud build did not succeed within 10m:

^Cbradfitz@go:~/src/golang.org/x/build/app/appengine$ GO111MODULE=on gcloud app --account=bradfitz@google.com --project=golang-org deploy app.yaml
Services to deploy:

descriptor:      [/home/bradfitz/src/golang.org/x/build/app/appengine/app.yaml]
source:          [/home/bradfitz/src/golang.org/x/build/app/appengine]
target project:  [golang-org]
target service:  [build]
target version:  [20191016t165030]
target url:      [https://build-dot-golang-org.appspot.com]


Do you want to continue (Y/n)?

Beginning deployment of service [build]...
╔════════════════════════════════════════════════════════════╗
╠═ Uploading 1 file to Google Cloud Storage                 ═╣
╚════════════════════════════════════════════════════════════╝
File upload done.
Updating service [build]...failed.                                                                                                                                                      
ERROR: (gcloud.app.deploy) Error Response: [4] Cloud build did not succeed within 10m.
Build error details: Build error details not available..
Check the build log for errors: https://console.cloud.google.com/gcr/builds/4d8f8f8a-bf65-4e0d-9cc6-ebc8053c8422?project=397748307997

Versions:

$ gcloud version
Google Cloud SDK 246.0.0
alpha 2019.05.10
app-engine-go 
app-engine-python 1.9.85
beta 2019.05.10
bq 2.0.43
cloud-datastore-emulator 2.1.0
core 2019.05.10
gsutil 4.38
kubectl 2019.05.10
@dmitshur

This comment has been minimized.

Copy link
Member

@dmitshur dmitshur commented Oct 16, 2019

That's very strange. The deploy took 2~ minutes for me when I tried it just now.

The error is similar to an issue we had when deploying the playground was taking too long, and hitting that time limit. See #28046. You can try increasing the cloud build timeout with gcloud config set app/cloud_build_timeout 900, but I think we need to fix the build taking more than 10 minutes in the first place.

Looking at the cloud build log mentioned in your output, it just says:

[...]
Finished Step #1 - "builder"
TIMEOUT
ERROR: context deadline exceeded

Compare with my earlier successful build (https://console.cloud.google.com/cloud-build/builds/65043963-4de2-4a3d-bf06-9862eace8b0b?project=golang-org):

[...]
Finished Step #1 - "builder"
PUSH
DONE

Not a lot of relevant detail here. Maybe it was a flake, so try again?

@bradfitz

This comment has been minimized.

Copy link
Member Author

@bradfitz bradfitz commented Oct 16, 2019

I can't wait for #34744 to delete all this.

@bradfitz

This comment has been minimized.

Copy link
Member Author

@bradfitz bradfitz commented Oct 16, 2019

Ah, I did have some extra files in git status. It was an unknown directory I thought was harmless but it had some huge iso/disk images in it.

That didn't matter prior to the GO111MODULE=on addition. Now I guess we upload everything to The Cloud, rather than just the relevant files.

Maybe I'll add a sanity check step in there to look for big unknown files.

@dmitshur

This comment has been minimized.

Copy link
Member

@dmitshur dmitshur commented Oct 16, 2019

Yeah, GO111MODULE=on makes gcloud app deploy use the module root as the root, rather than the directory containing app.yaml. It was added to make deploys consistent regardless of who was deploying and their local environment’s GO111MODULE value.

I think there are ways to ignore certain files or directories from being included, for example via .gcloudignore file. See https://cloud.google.com/sdk/gcloud/reference/topic/gcloudignore.

@dmitshur dmitshur changed the title x/build/app/appengine: can't deploy anymore x/build/app/appengine: deploying with dirty working tree affects the deploy Oct 31, 2019
@dmitshur

This comment has been minimized.

Copy link
Member

@dmitshur dmitshur commented Nov 6, 2019

@bradfitz Is there more to do here, or did CL 205597 fix this by adding the .cloudignore .gcloudignore file?

Edit: Fixed typo.

@bradfitz

This comment has been minimized.

Copy link
Member Author

@bradfitz bradfitz commented Nov 6, 2019

@dmitshur, the .gcloudignore (with a g) file fixes the worst of it. That could be enough probably.

@bradfitz bradfitz closed this Nov 6, 2019
@dmitshur dmitshur added NeedsFix and removed WaitingForInfo labels Nov 6, 2019
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.