Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Receiving 'Project not found' errors when using `gcloud deploy app`

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
like image 598
DaveBensonPhillips Avatar asked Sep 22 '16 18:09

DaveBensonPhillips


People also ask

How do I select a project using gcloud?

Check the available projects by running: gcloud projects list . This will give you a list of projects which you can access. To switch between projects: gcloud config set project <project-id> . Save this answer.

How long does gcloud app deploy take?

This is required because Cloud Build build steps and builds have a default timeout of 10 minutes and App Engine deployments could take longer than that to complete. Specifying a longer timeout will make sure that the build doesn't timeout if gcloud app deploy takes longer than 10 minutes to complete.

How do I deploy an app in GCP App Engine?

Deploying the app to App Engine Include the --project flag to specify an alternate Google Cloud console project ID to what you initialized as the default in the gcloud CLI. Example: --project [YOUR_PROJECT_ID] Include the -v flag to specify a version ID, otherwise one is generated for you. Example: -v [YOUR_VERSION_ID]


1 Answers

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

like image 142
DaveBensonPhillips Avatar answered Oct 12 '22 14:10

DaveBensonPhillips