9

Running the command gcloud app deploy --project=my-project-name gives me the following output:

$ gcloud app deploy --project=my-project-name
You are about to deploy the following services:
 - my-project-name/my-service-name/20160922t110054 (from [/usr/local/projects/my-project/app.yaml])
     Deployed URL: [https://my-service-name-dot-my-project-name.appspot.com]

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

WARNING: We couldn't validate that your project is ready to deploy to App Engine Flexible Environment. If deployment fails, please try again.
Beginning deployment of service [my-service-name]...
WARNING: Deployment of App Engine Flexible Environment apps is currently in Beta
Building and pushing image for service [my-service-name]
ERROR: (gcloud.app.deploy) Project [my-project-name] not found.

As you can see, it's claiming the project isn't found. What's confusing me is that the project clearly appears under here:

$ gcloud projects list
PROJECT_ID       NAME               PROJECT_NUMBER
my-project-name  MyProject          980737858333

I can't find any other instance of this issue, and I've run out of ideas to troubleshoot. So what's the problem with the command I'm running? Or how else can I troubleshoot?

My app.yaml looks like this:

entrypoint: gunicorn -b :8080 main.app
runtime: custom
vm: true

service: my-service-name
DaveBensonPhillips
  • 3,134
  • 1
  • 20
  • 32

1 Answers1

10

It turns out this is what happens if you don't have the "Google Cloud Container Builder API" enabled. I found this out by trying --verbosity debug, which displayed the link I had to follow to enable it for my project.

When deploying, the call to https://cloudbuild.googleapis.com/v1/projects/my-project-name/builds?alt=json returns a nice error message:

"The cloudbuild API is not enabled for project ID \"my-project-name\": to enable it, visit https://console.cloud.google.com/apis/api/cloudbuild.googleapis.com/overview?project=my-project-name"

It would be cool if that was displayed to the user in place of the "app not found" error

DaveBensonPhillips
  • 3,134
  • 1
  • 20
  • 32
  • 1
    also use --log-http : which i've found is very helpful – npr Sep 23 '16 at 13:24
  • 1
    I was following the go examples, but started again with a new project, this step seemed automated on the first run.... but had me scratching my head, Your insight and link got me up and runnning again, much thanks. – IndelibleHeff Sep 29 '16 at 21:48
  • You could have explained how to enable it: https://stackoverflow.com/questions/56126481/gcloud-error-gcloud-app-deploy-permissions-error-fetching-application/56136326 – jpruiz114 Jan 26 '21 at 16:30
  • At the time of writing, the link in the logs (like I mentioned above) took you straight to the page where you enable it. Does it no longer do that? – DaveBensonPhillips Jan 26 '21 at 23:23