Google Cloud Build - source-context.json SHA 不匹配

Sev*_*rin 5 deployment google-app-engine google-cloud-platform google-cloud-build

我有一个 Python 3 项目,我托管在 Google AppEngine Standard 上。直到几天前,我才能够正常部署(自从我在 2019 年 7 月进行初始设置以来),直到几天前。现在我得到以下回复:

starting build "abc"

FETCHSOURCE
BUILD
Starting Step #0 - "fetcher"
Step #0 - "fetcher": Already have image (with digest): gcr.io/cloud-builders/gcs-fetcher
Step #0 - "fetcher": Fetching manifest gs://staging.my-project.appspot.com/ae/xxx/manifest.json.
Step #0 - "fetcher": Processing 312 files.
Step #0 - "fetcher": Failed to fetch gs://staging.my-project.appspot.com/xxx, will no longer retry: fetching "gs://staging.my-project.appspot.com/xxx" with timeout 1h0m0s to temp file "/workspace/.download/staging.my-project.appspot.com-xxx": source-context.json SHA mismatch, got "xxx", want "yyy"
Step #0 - "fetcher": Failed to download at least one file. Cannot continue.
Finished Step #0 - "fetcher"
ERROR
ERROR: build step 0 "gcr.io/cloud-builders/gcs-fetcher" failed: step exited with non-zero status: 1
Run Code Online (Sandbox Code Playgroud)

知道为什么会发生这种情况以及如何解决吗?

PS我使用以下命令进行部署:

gcloud --project my-project app deploy app.yaml
Run Code Online (Sandbox Code Playgroud)

小智 9

这就是我所做的并且它对我有用:

1. 转到错误描述中的链接:

在此输入图像描述

2. 您会看到有些行暂存失败,复制第一行中的文件名:

在此输入图像描述

3. 转到此处的Google 存储并输入名称以“staging.***”开头的存储桶,然后在该存储桶中搜索我在步骤 2 中复制的字符串:

在此输入图像描述

4. 删除该文件,然后对您将在错误详细信息链接中看到的每一行重试该步骤(在我的示例中有 4 行)。

在此输入图像描述

5.再次部署!


Nav*_*vid 6

在与 Google 工程师(https://issuetracker.google.com/issues/154588981?pli=1)交谈后,以下工作:

  1. 删除source-context.json文件
  2. 删除部署文件所在的bucket,例如gs://staging.my-project.appspot.com
  3. 再次部署

如果您需要该source-context.json文件,您可以按照以下步骤操作:https : //www.google.com/url?q=https : //cloud.google.com/debugger/docs/source-context&sa=D&usg=AFQjCNHMB7Dm_jISwG2AnpokQ7XN5GmLAw