firebase-tools: Pub/Sub Emulator has exited with code: 1
[REQUIRED] Environment info
firebase-tools: 11.24.1 Node.js: v16.19.1 Java: OpenJDK 11.0.18
Platform: macOS13.2.1 M1
[REQUIRED] Test case
Run firebase emulators:start --only pubsub
[REQUIRED] Actual behavior
i emulators: Starting emulators: pubsub
i pubsub: Pub/Sub Emulator logging to pubsub-debug.log
⚠ pubsub: Fatal error occurred:
Pub/Sub Emulator has exited with code: 1,
stopping all running emulators
i pubsub: Stopping Pub/Sub Emulator
kill: usage: kill [-s sigspec | -n signum | -sigspec] pid | jobspec ... or kill -l [sigspec]
⚠ pubsub: Error stopping Pub/Sub Emulator
i hub: Stopping emulator hub
// pubsub-debug.log
Error: Invalid or corrupt jarfile /Users/ruisi/.cache/firebase/emulators/pubsub-emulator-0.7.1/pubsub-emulator/lib/cloud-pubsub-emulator-0.7.1.jar
I have tried to manually delete cloud-pubsub-emulator-0.7.1.jar
, and use firebase setup:emulators:pubsub
to reinstall.
About this issue
- Original URL
- State: closed
- Created a year ago
- Reactions: 3
- Comments: 15 (4 by maintainers)
Commits related to this issue
- Replace dependency on broken node-unzipper with native zlib Fixes: https://github.com/firebase/firebase-tools/issues/5614 https://github.com/firebase/firebase-tools/issues/5677 https://github.com/fir... — committed to Durisvk/firebase-tools by Durisvk a year ago
- Replace dependency on broken node-unzipper with native zlib Fixes: https://github.com/firebase/firebase-tools/issues/5614 https://github.com/firebase/firebase-tools/issues/5677 https://github.com/fir... — committed to Durisvk/firebase-tools by Durisvk a year ago
- Replace dependency on broken node-unzipper with native zlib Fixes: https://github.com/firebase/firebase-tools/issues/5614 https://github.com/firebase/firebase-tools/issues/5677 https://github.com/fir... — committed to Durisvk/firebase-tools by Durisvk a year ago
- Replace dependency on broken node-unzipper with native zlib Fixes: https://github.com/firebase/firebase-tools/issues/5614 https://github.com/firebase/firebase-tools/issues/5677 https://github.com/fir... — committed to Durisvk/firebase-tools by Durisvk a year ago
- Replace dependency on broken node-unzipper with native zlib Fixes: https://github.com/firebase/firebase-tools/issues/5614 https://github.com/firebase/firebase-tools/issues/5677 https://github.com/fir... — committed to Durisvk/firebase-tools by Durisvk a year ago
- Replace dependency on broken node-unzipper with native zlib Fixes: https://github.com/firebase/firebase-tools/issues/5614 https://github.com/firebase/firebase-tools/issues/5677 https://github.com/fir... — committed to Durisvk/firebase-tools by Durisvk a year ago
- Replace dependency on broken node-unzipper with native zlib Fixes: https://github.com/firebase/firebase-tools/issues/5614 https://github.com/firebase/firebase-tools/issues/5677 https://github.com/fir... — committed to Durisvk/firebase-tools by Durisvk a year ago
- Replace dependency on broken node-unzipper with native zlib Fixes: https://github.com/firebase/firebase-tools/issues/5614 https://github.com/firebase/firebase-tools/issues/5677 https://github.com/fir... — committed to Durisvk/firebase-tools by Durisvk a year ago
- Replace dependency on broken node-unzipper with native zlib (#5714) * Replace dependency on broken node-unzipper with native zlib Fixes: https://github.com/firebase/firebase-tools/issues/5614 ht... — committed to ProfHercules/firebase-tools by Durisvk a year ago
- Replace dependency on broken node-unzipper with native zlib (#5714) * Replace dependency on broken node-unzipper with native zlib Fixes: https://github.com/firebase/firebase-tools/issues/5614 ht... — committed to firebase/firebase-tools by Durisvk a year ago
- Replace dependency on broken node-unzipper with native zlib (#5714) * Replace dependency on broken node-unzipper with native zlib Fixes: https://github.com/firebase/firebase-tools/issues/5614 ht... — committed to jack-michaud/firebase-tools by Durisvk a year ago
😫 I’ve found the real issue.
To be clear, I’m talking about this error:
firebase-tools
What happens? This issue occurs if you download & set up emulators using node v18.16+ or v19.8+. It works fine if you have emulators installed by other versions of node(I checked only v18.x.x & v19.x.x) even if you upgrade node version afterwards. Since it only happens to
pubsub
&UI
emulators (only those two have to be unzipped after downloading), I suspect thatfirebase-tools
struggle to correctly unpack downloaded archives.firebase-tools
haveunzipper
dependency, hence this may be related: async iteration example no longer works in Node 18x, 19x stream.pipeline [ERR_STREAM_PREMATURE_CLOSE]: Premature close@christhompsongoogle & firebase team, please take a look at the changelogs for the node versions mentioned above to nail down the exact issue:
v19.8.0 changelog v18.16.0 changelog
For those who is out of luck today and have their docker containers rebuilt and perhaps uses ubuntu as a base image to replicate cloud functions environment, me sharing my dockerfile config to use with a specific node version:
maybe it’s not that obvious, but as mentioned in https://github.com/firebase/firebase-tools/issues/5614#issuecomment-1508515106
you can just downgrade to node 18.15. so if you use a
node:18
for your image, you can just pin the version tonode:18.15
and it should fix the issue temporarily.Had the same issue today. The following instructions worked for me on macOS:
--debug
flag.firebase setup:emulators:pubsub
. This will download the jar file.firebase emulators:start --only pubsub
Possible related issue: https://github.com/firebase/firebase-tools-ui/issues/933
As soon as I downgraded to Node 16, it started working again
This started happening to me today (only on Bitrise CI tho). I removed pubsub from firebase.json (since I didn’t need it in my project anyway) and that “fixed” it.
Looks like @iSuslov might be right about something wrong with the unzipper
I had this issue until I downgraded Node from latest (19.x.x) to LTS (18.15.0).