【问题标题】:Ubuntu - Running gcloud app deploy command is throwing errorUbuntu - 运行 gcloud app deploy 命令抛出错误
【发布时间】:2021-09-16 20:29:35
【问题描述】:

我在 YouTube 上关注 this 教程。我在 gcp 上创建了一个空项目,然后运行 ​​gcloud init 并切换到该项目,然后运行 ​​gcloud app deploy 并遇到问题。在本教程视频中,没有提到我应该启用 Cloud Build API 来部署。所以我不知道是没有启用 Cloud Build API 还是其他问题。

这是我的 app.yaml
runtime: nodejs12

我尝试了许多其他堆栈溢出帖子的答案,例如 this 之一,但对我没有任何帮助。当我在新项目中运行gcloud app deploy 时,出现此错误:

ERROR: (gcloud.app.deploy) Error Response: [7] Access Not Configured. Cloud Build has not been used in project XXX before or it is disabled. Enable it by visiting https://console.developers.google.com/apis/api/cloudbuild.googleapis.com/overview?project=[projectId] then retry. If you enabled this API recently, wait a few minutes for the action to propagate to our systems and retry.

我使用的是 Ubuntu 20.04 LTS - x86-64。

【问题讨论】:

  • 好的,但不清楚,您是否尝试启用 Cloud Build API?这是必需的,因为 Cloud Build 将在将代码部署到 App Engine 之前构建您的代码,我猜教程没有提到它,因为它假设您已经启用它。另外,请记住,启用 API 后,您可能需要等待几分钟才能正常工作。
  • @RafaelLemos 我确实尝试启用 Cloud Build API,但要求提供付款详细信息。有没有办法跳过这一步?

标签: node.js google-cloud-platform gcloud


【解决方案1】:

您必须完成两个步骤:

  1. 启用 Google Cloud Billing。
  2. 启用 Cloud Build API。

您不能跳过启用 Cloud Billing。设置结算帐户后,您可能需要等待几分钟才能启用 API。

Cloud Build 的前 120 分钟免费。然后将向您收取每分钟 0.003 美元的费用。

该页面是 Google Cloud Billing 上的文档集合。

Google Cloud Billing Documentation

您可以在控制台中或通过 CLI 启用 Cloud Build API。

Enable Cloud Build API in the console

gcloud services enable cloudbuild.googleapis.com

gcloud services enable

【讨论】:

    猜你喜欢
    • 2018-11-12
    • 1970-01-01
    • 2018-11-29
    • 2020-12-29
    • 2021-01-31
    • 2015-08-28
    • 1970-01-01
    • 2015-10-09
    • 2016-09-26
    相关资源
    最近更新 更多