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
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.
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.
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]
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With