为什么重定向 stderr 会使我的 App Engine 部署始终失败?

Why does redirecting stderr make my App Engine deployment failing consistently?

我正在部署一个简单的 App Engine 标准环境应用程序。 (字面意思是最短的,一个 Python 3 “hello world”。)我正在使用带 zshell 的 Macbook。

如果我将标准错误重定向到文件,我每次都会收到错误(如下)。

  gcloud app deploy -q  2>>err.log 

如果我省略重定向,每次都会成功。

使用>>>没有区别。使用管道重定向,例如到 grep,不会导致问题。

所以这是一个“解决方案”(通过 passthrough grep 发送输出),它可以满足我的需要并且不会触发问题,但这是非常迂回的。

  gcloud app deploy -q 2>&1 >/dev/null |egrep "." >> err.txt 

请注意,我使用 -q,所以等待我的 Y 批准不是问题。

错误是这样的。 (标识符已匿名。)

..................failed.
ERROR: (gcloud.app.deploy) Error Response: [9] Cloud build BUILD_ID status: FAILURE
Build error details: Failed to download at least one file. Cannot continue.

Full build logs: https://console.cloud.google.com/cloud-build/builds/BUILD_ID?project=PROJECT_ID

查看日志,我看到了这个。

starting build "BUILD_ID"
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.joshua-playground.appspot.com/ae/BUILD_ID/manifest.json.
Step #0 - "fetcher": Processing 728 files.
Step #0 - "fetcher": Failed to fetch gs://staging.my-project.appspot.com/BUILD_ID, will no longer retry: fetching "gs://staging.my-project.appspot.com/BUILD_ID" with timeout 1h0m0s to temp file "/workspace/.download/staging.joshua-playground.appspot.com-BUILD_ID": err SHA mismatch, got "SHA_VALUE", want "SHA_VALUE"
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

Google 已确认此问题。请追踪here.