Reputation: 91
I am trying to deploy to a gcloud app (following the steps here: https://realpython.com/python-web-applications/). My gmail account is the owner of the project (and just to be safe, I've added lots of other roles like app engine deployer, viewer etc even though I think owner should cover all of them). When I enter "gcloud app deploy" I am getting the following error:
ERROR: (gcloud.app.deploy) Permissions error fetching application [apps/hello-app-389902]. Please make sure that you have permission to view applications on the project and that [email protected] has the App Engine Deployer (roles/appengine.deployer) role.
I've tried re-authenticating, adding more roles and I keep getting the same error. I've googled but none of the solutions posted there worked for me
Upvotes: 1
Views: 1129
Reputation: 3309
First, Enable billing serivces.
Access IAM:
Find the user:
Edit roles:
Add or remove roles:
Key roles for App Engine:
Save changes:
Verify:
Set your project:
Run:
gcloud config set project YOUR-PROJECT-ID
(Replace YOUR-PROJECT-ID with the actual project ID)
Verify gcloud config list
this will output
[compute]
region = [your-region-you-choose] eg. us-east1
zone = [your-region-you-zone] eg. us-east1-b
[core]
account = [your-email]
disable_usage_reporting = False
project = [your-project-id]
gcloud auth login
gcloud auth application-default set-quota-project [your-project-id]
gcloud app deploy
or gcloud app deploy --verbosity=debug
this will provide more detailed output.If issue still persists, change the App Engine roles
Upvotes: 0
Reputation: 91
Billing services were not enabled. Enabling billing services fixes this error
Upvotes: 2
Reputation: 6323
Confirm you're trying to deploy with the right account. Execute the command
gcloud config list account
to get the current account (email) that you're deploying with.
If the above is not the right email you're expecting, then set the right account (email) by executing
gcloud config set account <email>
After executing steps 1 and/or 2 above, open a new shell/command prompt and then try deploying again (the key here is to try it again in a new shell/command prompt)
Upvotes: 1