Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
271 views
in Technique[技术] by (71.8m points)

google cloud platform - Firebase Functions deploy requires keyboard input in GCP

Recently, when trying to deploy my Firebase Functions i get the following error:

...
functions[verify(us-central1)]: Deployment error.
Build failed: Build error details not available. Please check the logs at
...

GCP logs:

labels.build_step resource.type severity textPayload
MAIN build INFO ERROR: error fetching storage source: generic::unknown: retry budget exhausted (3 attempts): fetching gcs source: unpacking source from gcs: source fetch container exited with non-zero status: 1
MAIN build INFO ERROR
gsutil:STDOUT build INFO Archive: /tmp/source-archive.zip
gsutil:STDERR build INFO (EOF or read error, treating as "[N]one" ...)
gsutil:STDERR build INFO replace /workspace/.runtimeconfig.json? [y]es, [n]o, [A]ll, [N]one, [r]ename: NULL
gsutil:STDERR build INFO Operation completed over 1 objects/89.4 KiB.
gsutil:STDERR build INFO / [0 files][ 0.0 B/ 89.4 KiB] / [1 files][ 89.4 KiB/ 89.4 KiB]
gsutil:STDERR build INFO Copying gs://gcf-sources-972818261280-us-central1/verify-d55557e5-9fcf-4a3d-b144-17690c85f5a1/version-182/function-source.zip#1611906282665422...
MAIN build INFO Fetching storage object: gs://gcf-sources-972818261280-us-central1/verify-d55557e5-9fcf-4a3d-b144-17690c85f5a1/version-182/function-source.zip#1611906282665422
gsutil:STDERR build INFO (EOF or read error, treating as "[N]one" ...)
gsutil:STDERR build INFO replace /workspace/.runtimeconfig.json? [y]es, [n]o, [A]ll, [N]one, [r]ename: NULL
gsutil:STDOUT build INFO Archive: /tmp/source-archive.zip
gsutil:STDERR build INFO Operation completed over 1 objects/89.4 KiB.
gsutil:STDERR build INFO / [0 files][ 0.0 B/ 89.4 KiB] / [1 files][ 89.4 KiB/ 89.4 KiB]
gsutil:STDERR build INFO Copying gs://gcf-sources-972818261280-us-central1/verify-d55557e5-9fcf-4a3d-b144-17690c85f5a1/version-182/function-source.zip#1611906282665422...
MAIN build INFO Fetching storage object: gs://gcf-sources-972818261280-us-central1/verify-d55557e5-9fcf-4a3d-b144-17690c85f5a1/version-182/function-source.zip#1611906282665422
gsutil:STDERR build INFO bad CRC 4992186c (should be 00000000)
gsutil:STDOUT build INFO inflating: /workspace/tslint.json
gsutil:STDOUT build INFO inflating: /workspace/tsconfig.json
gsutil:STDOUT build INFO inflating: /workspace/src/index.ts
gsutil:STDOUT build INFO inflating: /workspace/src/booking.mjml
gsutil:STDOUT build INFO inflating: /workspace/src/booking.html
gsutil:STDOUT build INFO inflating: /workspace/package.json
gsutil:STDOUT build INFO inflating: /workspace/package-lock.json
gsutil:STDOUT build INFO inflating: /workspace/lib/index.js.map
gsutil:STDOUT build INFO inflating: /workspace/lib/index.js
gsutil:STDOUT build INFO inflating: /workspace/.runtimeconfig.json inflating: /workspace/.gitignore
gsutil:STDOUT build INFO Archive: /tmp/source-archive.zip
gsutil:STDERR build INFO Operation completed over 1 objects/89.4 KiB.
gsutil:STDERR build INFO / [0 files][ 0.0 B/ 89.4 KiB] / [1 files][ 89.4 KiB/ 89.4 KiB]
gsutil:STDERR build INFO Copying gs://gcf-sources-972818261280-us-central1/verify-d55557e5-9fcf-4a3d-b144-17690c85f5a1/version-182/function-source.zip#1611906282665422...
MAIN build INFO Fetching storage object: gs://gcf-sources-972818261280-us-central1/verify-d55557e5-9fcf-4a3d-b144-17690c85f5a1/version-182/function-source.zip#1611906282665422
MAIN build INFO FETCHSOURCE
MAIN build INFO starting build "f8f97fdd-29ff-4964-a080-26ba4bdd5705"
question from:https://stackoverflow.com/questions/65950774/firebase-functions-deploy-requires-keyboard-input-in-gcp

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

<TL/DR> Downgrading from Node 15 to Node 14 or Node 12 solves the problem.

My environment:

I'm running a MacBook Air with the M1 ARM chip. I don't know if it is related or not but it might be.

Version combinations known to work:

Currently running v14.15.4 x64 with firebase-tools 9.2.2. That combination seems to work without a glitch.

Before settling on that I've tried v12.20.1 x64 with firebase-tools 9.2.2 and that worked as well.

Version combinations I tried and failed:

I've tried node v15.6.0, both arm64 and x64, with firebase-tools 9.2.2, 9.2.1, 9.2.0, 9.1.2 and 8.20.0 without success.

Also tried node v15.7.0 arm64 with firebase-tools 9.2.2 without success.

Getting those on an M1 Mac:

If you, like me, are using an M1 Mac, you might already know v14 won't compile in the M1. You'll need to use x64 versions for anything that is not v15.5 or above.

There are many guides and also the official NodeJS download for the x64 versions that will run just fine on rosetta 2 (do not try the ARM ones, those are for Linux only at this point and won't work on your Mac).

If you are using nvm to manage your versions and want to have both x64 and arm64 versions installed, this is how I did it:

Getting x64 and arm64 versions to live together:

nvm install will add a node version. If you did nothing special to your machine then nvm install 15 should work for you. There are no pre-compiled binaries for the M1 just yet, so be prepared to wait some minutes(more than 10).

To get Node 14 setup just open a new terminal window and type in arch -x86_64 zsh, that will start a new zsh process in x64 mode. On that same terminal type nvm install 14. That should be much faster than v15 and, depending on your internet speed, return in just a few seconds. You are all set. close this terminal tab and forget it ever existed.

Now running nvm use 15 will set node to run the v15 arm64 version and running nvm use 14 will run the v14 x64 version.

To check your node version you can run node --version and to check the architecture you can run node -p "process.arch"


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...