google-app-engine - 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:
- App Engine Administrator
- App Engine Deployer
- App Engine Service Administrator
- Cloud Build Service Account
- Cloud Build Editor
- Storage Administrator
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
解决方案
我试图通过创建一个新的服务帐户并为其提供您列出的角色来重现您的情况。我已使用该命令授权使用其密钥访问 GCP,gcloud auth activate-service-account --key-file=<KEY-FILE>
但部署对我来说是成功的。
运行gcloud auth list
命令以确保您已获得正确的服务帐户的授权。您也可以尝试将--verbosity=debug
标志添加到部署命令中,看看如果发生错误,您是否可以在错误日志中找到任何有用的信息。
但是,从错误描述来看,您似乎在部署应用程序时也传递了错误的项目 ID:
gcloud --quiet --project projecid app deploy app.yaml
- 确保不是这种情况。
推荐阅读
- hashmap - Splitter EIP 可以拆分 HashMap 还是必须是 List
- django - 如何以正确的方式在 Django 中存储 URL?
- python-3.x - 使用 XPath 将图像 URL 提取为字符串
- c++ - 数字小于机器精度的安全算术?
- java - 如何在启动期间操作配置类中的自动装配对象并稍后使用?
- docker - Docker 容器以 137 退出
- angular - 在这种情况下如何获取 url 参数
- python - Django 多次检查表单有效性
- c# - STream 类的哪些子类支持在 C# 中查找(不在文档 ffs 中)
- vala - Idris:如何从 Vala/C 调用 Idris 函数并将字符串返回给 C/Vala