Cherns
Cherns

Reputation: 91

Permissions error fetching application - Gcloud app deploy

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

Answers (3)

jeffasante
jeffasante

Reputation: 3309

First, Enable billing serivces.

  1. Access IAM:

    • Go to the Google Cloud Console
    • Select your project
    • In the left sidebar, click "IAM & Admin"
  2. Find the user:

    • Look your email needing changes
  3. Edit roles:

    • Click the pencil icon next to their name
    • You'll see a list of current roles
  4. Add or remove roles:

    • To add: Click "Add another role" and search for the needed role
    • To remove: Click the X next to any role you want to remove
  5. Key roles for App Engine:

    • App Engine Admin
    • App Engine Deployer
    • Editor
    • Owner
  6. Save changes:

    • After adjusting roles, click "Save"
  7. Verify:

    • The new roles should now appear next to the user's name

  1. Set your project: Run: gcloud config set project YOUR-PROJECT-ID (Replace YOUR-PROJECT-ID with the actual project ID)

  2. 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]
  1. Verify Credentials
gcloud auth login
  1. If you are using Application Default Credentials (ADC), set the correct quota project

gcloud auth application-default set-quota-project [your-project-id]

  1. Once you're sure that the correct project and credentials are being used, retry the deployment 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

Cherns
Cherns

Reputation: 91

Billing services were not enabled. Enabling billing services fixes this error

Upvotes: 2

NoCommandLine
NoCommandLine

Reputation: 6323

  1. 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.

  2. If the above is not the right email you're expecting, then set the right account (email) by executing

    gcloud config set account <email>

  3. 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

Related Questions