首页 > 解决方案 > 为什么重定向 stderr 会使我的 App Engine 部署始终失败?

问题描述

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

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

  gcloud app deploy -q  2>>err.log 

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

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

所以这是一个“解决方案”(通过传递通过 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-app-enginegoogle-cloud-build

解决方案


谷歌已经确认了这个问题。请在此处跟踪。


推荐阅读