运行命令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
答案 0 :(得分:8)
事实证明,如果您没有“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"
如果向用户显示“未找到"应用程序”并且#34;那将会很酷。错误