Lukas Germerott
Lukas Germerott

Reputation: 361

Permission error while deploying to app enginewith service account

I want to deploy my app via google service account. I am using the test-version of googlecloud with billing enabled. I granted the following permissions to my service account:

When I try to login via keyfile with gcloud auth activate-service-account --key-file file.json and then trying to deploy the app with the service account with the following command: gcloud --quiet --project projecid app deploy app.yaml I get the following error:

(gcloud.app.deploy) Permissions error fetching application [apps/projectid]. Please make sure you are using the correct project ID and that you have permission to view applications on the project.

Also I might have to say, that I am using a account ID which was used before.

Do you guys have an idea what I could do? It works, when I deploy it with my normal google account and a normal login. But I need that because of gitlab-ci

Upvotes: 0

Views: 183

Answers (1)

Deniss T.
Deniss T.

Reputation: 2652

I have tried to reproduce your situation by creating a new service account and giving it the roles you listed. I have authorized access to GCP with its key using the gcloud auth activate-service-account --key-file=<KEY-FILE> command but the deployment has been successful for me.

Run the gcloud auth list command to make sure you're authorized with the correct service account. Also you can try adding the --verbosity=debug flag to the deployment command to see if you can find anything useful in the error logs if the error occurs.

From the error description, however, it seems that you might also have passed an incorrect project ID when deploying the application:

gcloud --quiet --project projecid app deploy app.yaml

- make sure it is not the case.

Upvotes: 2

Related Questions