Google Cloud Functions 部署 - 创建删除规则后 NoSuchKey 失败(us.artifacts.sha256 映像)

问题描述 投票:0回答:1

意识到我因 Google Cloud Functions 部署而被收取存储费用后,我阅读了此帖子,并为我的 us.artifacts.{myproject}.appspot.com 文件夹创建了 3 天删除规则。现在我正在尝试部署现有功能并得到以下信息。我该如何解决这个问题?我应该删除整个图像文件夹吗?

[0mfailed to export: failed to write image to the following tags: [us.gcr.io/myproject/gcf/us-central1/3a36a5e8-92b5-426e-b230-ba19ffc92ba8:MYFUNCTION_version-64: 
GET https://storage.googleapis.com/us.artifacts.myproject.appspot.com/containers/images/sha256:{some long string}?access_token=REDACTED:
unsupported status code 404; body: <?xml version='1.0' encoding='UTF-8'?>
<Error><Code>NoSuchKey</Code>
<Message>The specified key does not exist.</Message><Details>No such object: us.artifacts.myproject.appspot.com/containers/images/sha256:{some long string}</Details></Error>]

编辑 1:我的部署命令(之前已经运行了几个月):

gcloud functions deploy MYFUNCTIONNAME --source https://source.developers.google.com/projects/MYPROJECT/repos/MYREPO --trigger-http --runtime nodejs10 --allow-unauthenticated

2023 年 10 月更新:本周我们部署了全新的 v1 云函数,在第一次尝试更新时再次遇到了这个错误。目前最好的解决方案似乎是从ContainerRegistry迁移到ArtifactRegistry,因为似乎存在一个错误,即使删除生命周期规则和容器存储桶仍然会导致构建错误。

node.js google-cloud-platform google-cloud-functions google-cloud-storage
1个回答
2
投票

正如在另一个问题的回答中所建议的,最好删除整个存储桶,此操作将销毁与该存储桶相关的所有元素和配置,避免功能、存储和容器注册表之间的问题,如果您仅删除容器的某些配置将仍然影响进一步部署。

© www.soinside.com 2019 - 2024. All rights reserved.