首页 > 解决方案 > 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

标签: google-app-engine

解决方案


我试图通过创建一个新的服务帐户并为其提供您列出的角色来重现您的情况。我已使用该命令授权使用其密钥访问 GCP,gcloud auth activate-service-account --key-file=<KEY-FILE>但部署对我来说是成功的。

运行gcloud auth list命令以确保您已获得正确的服务帐户的授权。您也可以尝试将--verbosity=debug标志添加到部署命令中,看看如果发生错误,您是否可以在错误日志中找到任何有用的信息。

但是,从错误描述来看,您似乎在部署应用程序时也传递了错误的项目 ID:

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

- 确保不是这种情况。


推荐阅读