api - 如何使用 gcloud 在 GCP 中启用 API 服务进行故障排除
问题描述
执行 terraform apply 时,我被要求为我的项目启用 IAM API 时收到此错误。
Error: Error creating service account: googleapi: Error 403: Identity and Access
Management (IAM) API has not been used in project [PROJECT-NUMBER] before or it is
disabled. Enable it by visiting
https://console.developers.google.com/apis/api/iam.googleapis.com/overview?
project=[PROJECT-NUMBER] then retry. If you enabled this API recently, wait a few
minutes for the action to propagate to our systems and retry.,
accessNotConfigured
当我尝试使用 gcloud 启用它时,服务启用只是挂起。有什么方法可以获取更多信息吗?
根据Google Dashboard,一切都是绿色的。
我在使用 UI 时也看到了同样的问题。
$ gcloud services enable iam.googleapis.com container.googleapis.com
错误信息
ERROR: gcloud crashed (WaitException): last_result=True, last_retrial=178, time_passed_ms=1790337,time_to_wait=10000
解决方案
添加--log-http
到(任何)gcloud
命令以获取底层 API 调用的详细日志记录。这些可能会提供有关错误发生位置的更多详细信息。
您也可能希望明确引用该项目:--project=...
.
是否需要启用 IAM?这是一项如此基础的服务,如果不启用它,我很惊讶任何东西都会起作用。
推荐阅读
- angular - Angular Rxjs:使用管道运算符的语法错误
- php - 如何组合 2 个不同的过滤器
- node.js - 如何将 Paypal 与 node js 集成到 REST 方式中
- javascript - 读取提取数据javascript
- vb6 - 我是否正确实施了单二极管模型?
- python - gunicorn app.wsgi 在 heroku 中实际上在做什么?
- django - 隐藏所有数据集(chartjs)时如何显示比例?
- graphics - 如何生成“草图”动画来介绍 3D 场景?
- c# - .Net Core Middleware - 从请求中获取表单数据
- python - 从 3 个数字中找出最大的数字