google-app-engine - 使用 'Project not found' 时收到 `gcloud deploy app` 错误

标签 google-app-engine google-cloud-platform gcloud

运行命令 gcloud app deploy --project=my-project-name 给我以下输出:

$ gcloud app deploy --project=my-project-name
You are about to deploy the following services:
 - my-project-name/my-service-name/20160922t110054 (from [/usr/local/projects/my-project/app.yaml])
     Deployed URL: [https://my-service-name-dot-my-project-name.appspot.com]

Do you want to continue (Y/n)?  Y

WARNING: We couldn't validate that your project is ready to deploy to App Engine Flexible Environment. If deployment fails, please try again.
Beginning deployment of service [my-service-name]...
WARNING: Deployment of App Engine Flexible Environment apps is currently in Beta
Building and pushing image for service [my-service-name]
ERROR: (gcloud.app.deploy) Project [my-project-name] not found.

如您所见,它声称找不到该项目。令我困惑的是,该项目清楚地出现在此处:

$ gcloud projects list
PROJECT_ID       NAME               PROJECT_NUMBER
my-project-name  MyProject          980737858333

我找不到此问题的任何其他实例,而且我已经没有解决问题的想法。那么我运行的命令有什么问题呢?或者我还能如何解决问题?

我的 app.yaml 看起来像这样:

entrypoint: gunicorn -b :8080 main.app
runtime: custom
vm: true

service: my-service-name

最佳答案

事实证明,如果您没有启用“Google Cloud Container Builder API”,就会发生这种情况。我通过尝试 --verbosity debug 发现了这一点,它显示了我必须遵循的链接才能为我的项目启用它。

部署时,调用 https://cloudbuild.googleapis.com/v1/projects/my-project-name/builds?alt=json 会返回一条很好的错误消息:

"The cloudbuild API is not enabled for project ID \"my-project-name\": to enable it, visit https://console.cloud.google.com/apis/api/cloudbuild.googleapis.com/overview?project=my-project-name"

如果将其显示给用户以代替“找不到应用”错误,那就太好了

关于google-app-engine - 使用 'Project not found' 时收到 `gcloud deploy app` 错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39645985/

相关文章:

python - 使用什么 Google 应用引擎身份验证仅向我的 GSuite 用户公开我的 "intranet"网站?

python - 谷歌云应用引擎 : Python2 or Python3? 的最佳实践

google-cloud-platform - 云容器集群创建 `compute.networks.get`权限错误

ssh - gcloudcompute ssh 拒绝连接(返回代码 255)

google-app-engine - 使用 Objectify 4 获取实体键

python - Google App Engine 需要索引进行测试

google-app-engine - 尽管我没有使用 AppEngine 或 Datastore,但我无法在项目上启用 firestore

php - 随机获取云存储错误 : UNAUTHORIZED

cassandra - 如何在 Kubernetes 部署文件中启用 Cassandra 密码身份验证

google-cloud-platform - 在不停止 VM 的情况下修改 gcloud VM 服务帐户权限