首页 > 解决方案 > Google Cloud Build - source-context.json SHA 不匹配

问题描述

我有一个 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

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

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

gcloud --project my-project app deploy app.yaml

标签: google-app-enginegoogle-cloud-platformdeploymentgoogle-cloud-build

解决方案


在与谷歌工程师( 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


推荐阅读