Omar España
Omar España

Reputation: 125

Fail to deploy project to Google Cloud App Engine Standard

I have a project that has been running fine, but I want to make some changes and solve some bugs so I tried to deploy my app using the Google Cloud SDK (gcloud app deploy)

Services to deploy:

descriptor:      [/home/projects/Myproject/app.yaml]
source:          [/home/projects/Myproject/]
target project:  [my-project]
target service:  [default]
target version:  [20200902t153320]
target url:      [https://my-project.uc.r.appspot.com]


Do you want to continue (Y/n)?  

Beginning deployment of service [default]...
╔════════════════════════════════════════════════════════════╗
╠═ Uploading 2 files to Google Cloud Storage                ═╣
╚════════════════════════════════════════════════════════════╝
File upload done.
Updating service [default]...failed.                                                               
ERROR: (gcloud.app.deploy) Error Response: [9] Cloud build 3ebf37fb-b18d-4c68-b352d-10bd8758f90b0 status: FAILURE
Error type: OK
Full build logs: https://console.cloud.google.com/cloud-build/builds/3ebf37fb-b18d-4c68-b32d-10bd8s78f90b0?project=my-projectid

This used to work yesterday fine but now it gives me this error and I cannot make any changes:

ERROR: build step 6 "us.gcr.io/gae-runtimes/buildpacks/python38/builder:python38_20200816_3_8_5_RC01" failed: step exited with non-zero status: 246
ERROR
Finished Step #6 - "exporter"
Step #6 - "exporter": ERROR: failed to export: failed to write image to the following tags: [us.gcr.io/my-project/app-engine-tmp/app/ttl-2h/default/buildpack-app:latest: GET https://us.gcr.io/v2/token?scope=repository%3Amy-project%2Fapp-engine-tmp%2Fapp%2Fttl-2h%2Fdefault%2Fbuildpack-app%3Apush%2Cpull&scope=repository%3Agae-runtimes%2Fbuildpacks%2Fpython38%2Frun%3Apull&service=us.gcr.io: DENIED: Token exchange failed for project 'my-project'. Access denied.]
Step #6 - "exporter": *** Digest: sha256:bd8121f23cb362683e7c32a8bbdf2a900606373f8edfsdf36fe0ffb17014
Step #6 - "exporter": 
Step #6 - "exporter":       us.gcr.io/my-project/app-engine-tmp/app/ttl-2h/default/buildpack-app:latest - GET https://us.gcr.io/v2/token?scope=repository%3Amy-project%2Fapp-engine-tmp%2Fapp%2Fttl-2h%2Fdefault%2Fbuildpack-app%3Apush%2Cpull&scope=repository%3Agae-runtimes%2Fbuildpacks%2Fpython38%2Frun%3Apull&service=us.gcr.io: DENIED: Token exchange failed for project 'my-project'. Access denied.
Step #6 - "exporter": *** Images (sha256:bd8121f23cb362683e7c32adfssd73f8ea51326f36fe0ffb17014):

I tried changing my authentication, so i used gcloud auth revoke and gcloud app login to refresh them. I also deleted the files in the storage and loaded them again. I even tried to upload the code to GitHub and make the deployment from there using an activator. Noting seems to work out.

The project has all the permissions. The service accounts are enabled. And I just don't understand what is wrong. I am not using Docker, so I did not change any of the default configurations in the Standard app engine

Upvotes: 2

Views: 2421

Answers (3)

Diego Mais
Diego Mais

Reputation: 56

Fixed this issue by deleting the offending container in Google Container Registry. This obviously causes GCP to re-pull the image!

Upvotes: 0

Anchit Arnav
Anchit Arnav

Reputation: 421

I have faced this recently.

Billing is not always the issue. Sometimes if there are no changes going in and you are trying to deploy the same version again, creates this problem as well.

Two Workarounds (not solutions)

  1. Use a random versioning scheme instead of --version SOME_STATIC_VALUE
  2. Ensure that there are some changes in the code getting deployed.

Upvotes: 4

dandhlee
dandhlee

Reputation: 26

I ran into the same issue until running other GCP commands lead to the conclusion (for me) that GCP refused to deploy because there was no billing account associated with my project. App Engine and the logs did not tell me about it and just told me about some docker push issues. Try checking to see if you have an active billing account set up and if there's any issues with that billing account.

Linking a billing account solved the issue for me and I was able to deploy my stuff fine using App Engine.

Upvotes: 1

Related Questions