This is a "solution" that does what I need and does not cause the problem (by passing output through a passthrough grep, and then to the desired file), but this is very roundabout.
What is causing appengine deployment to fail when I redirect stderr to a file?
for i in {1..5}; do gcloud app deploy -q 2>&1 >/dev/null |egrep -i "." >> err.txt ; done
I am deploying a trivial App Engine app. (Literally the shortest possible, a Python "hello world"-- full code attached.)
If I redirect standard error to file, I get an error (below) every time. If I omit the redirection, it succeeds every time. (There is no difference between using
>or>>.) Redirecting with a pipe, e.g. to grep, does not cause the problem.Note that I use
-q, so waiting for myYfor approval is not the issue.for i in {1..5}; do gcloud app deploy -q 2>>err.log ; doneThe error is
..................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_IDError follows (Identifiers were anonymized.)
(Note also StackOverflow question.)
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
The cost of App Engine will depend on the resources you are using. The main factors in determining your expenses are the type of machine [1] and the amount of instances [2] you have in your services. Check the needs of your application and assess if the resources you are using are really required or if you can lower them to avoid extra unneeded costs.
______
[1]: https://cloud.google.com/appengine/pricing
[2]: https://cloud.google.com/appengine/docs/managing-costs#specify_the_maximum_number_of_instances
I was able to reproduce this issue with a NodeJS deployment in standard. I have created a PIT thread [1] in which all upcoming communications regarding this issue will be made. Please star it to receive future notifications and give it more visibility. You can also comment more information there if you consider.
[1]: https://issuetracker.google.com/175953528