【问题标题】:(GCP) ERROR: (gcloud.builds.submit) INVALID_ARGUMENT: could not resolve source: googleapi: Error 403: 354778943856@cloudbuild.gserviceaccount.com(GCP)错误:(gcloud.builds.submit)INVALID_ARGUMENT:无法解析来源:googleapi:错误403:354778943856@cloudbuild.gserviceaccount.com
【发布时间】:2022-01-14 13:49:21
【问题描述】:

我正在尝试使用 Cloud Shell 将 docker 映像上传到 GCR(Google Container Registry),但收到以下错误消息:

错误:(gcloud.builds.submit)INVALID_ARGUMENT: 无法解析来源:googleapi:错误 403: 354778943856@cloudbuild.gserviceaccount.com 没有 storage.objects.get 访问 Google Cloud Storage 对象。 禁止

这是我已经完成的步骤。

(第一步)我运行了这个命令:

gcloud builds submit --tag gcr.io/my_project_id/hello_world

(第二步)然后,我被问到是否启用并重试“API [cloudbuild.googleapis.com]”然后,我输入并运行“y”

创建 2 个文件的临时 tarball 存档,总计 478 字节 压缩前。将 [.] 的压缩包上传到 [gs://my_project_id_cloudbuild/source/1642137449.192753-983fc894e2f24fa086f55fa3b56d58aa.tgz] 项目 [354778943856] 上未启用 API [cloudbuild.googleapis.com]。 是否要启用并重试(这需要几分钟)? (是/否)?是的

(第 3 步) 最后,我收到了带有错误消息的消息:

在项目上启用服务 [cloudbuild.googleapis.com] [354778943856]... 操作 “操作/acf.p2-354778943856-e99f6fd8-78ec-4cbd-94a2-07e0697d5455” 顺利完成。错误:(gcloud.builds.submit)INVALID_ARGUMENT: 无法解析来源:googleapi:错误 403: 354778943856@cloudbuild.gserviceaccount.com 没有 storage.objects.get 访问 Google Cloud Storage 对象。 禁止

即使我通过运行 "y" 启用了 "API [cloudbuild.googleapis.com]",我还是收到了错误消息。

错误:(gcloud.builds.submit)INVALID_ARGUMENT: 无法解析来源:googleapi:错误 403: 354778943856@cloudbuild.gserviceaccount.com 没有 storage.objects.get 访问 Google Cloud Storage 对象。 禁止

有没有办法解决这个错误?

【问题讨论】:

    标签: docker google-cloud-platform google-cloud-build google-container-registry google-cloud-shell


    【解决方案1】:

    您是否在第二步的消息末尾找到以下消息?:

    是否要启用并重试(这需要几分钟时间)? (是/否)?是的

    如消息所述,通过运行 "y" 启用 "API [cloudbuild.googleapis.com]" 需要 几分钟 >.

    所以在启用 "API [cloudbuild.googleapis.com]" 几分钟后再次运行命令,方法是运行 "y"

    gcloud builds submit --tag gcr.io/my_project_id/hello_world
    

    那么,就成功了:

    ID:f4478e51-557b-407d-9c30-c379ef707258 CREATE_TIME: 2022-01-14T05:22:29+00:00 持续时间:19S 来源: gs://my_project_id_cloudbuild/source/1642137748.745566-d75b61b6c6bc4acb9aba900650f201b2.tgz 图片:gcr.io/my_project_id/hello_world(+1 更多)状态:成功

    【讨论】:

      猜你喜欢
      • 2019-09-24
      • 2018-11-06
      • 2021-06-16
      • 1970-01-01
      • 2021-08-11
      • 2021-03-20
      • 2016-03-25
      • 2019-11-01
      • 2018-12-27
      相关资源
      最近更新 更多