You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
starting emulators opens a java window that isn't directly controlled by emulators #3871
Reacted by Dominik Korošec, Luiz Américo, Krzysztof Krzeszewski, iwatachan, Adrian Liechti, Wynn Slater, Will Neild, Fernando Mellone, Dživo Jelić, kd496 and 1 more
I've had the exact same issue, but on Windows 10 and firebase-tools: 10.1.0
"Fixed" the issue by switching to OpenJDK @ https://adoptium.net/?variant=openjdk8
Quite annoying, as if the window was not closed the emulator could not start, because ports were in use, and also broke precommit hooks (running emulator in one of the steps caused everything to hung).
This is not an option going forward given that next firebase-tools versions will require java 11 or superior
I've had the exact same issue, but on Windows 10 and firebase-tools: 10.1.0
Same here with windows 10, java 17 and firebase tools 10.6.0
The windows is from firestore and has the following output
Apr 10, 2022 8:14:38 PM com.google.cloud.datastore.emulator.firestore.websocket.WebSocketServer start
INFO: Started WebSocket server on ws://localhost:56350
API endpoint: http://localhost:8082
If you are using a library that supports the FIRESTORE_EMULATOR_HOST environment variable, run:
export FIRESTORE_EMULATOR_HOST=localhost:8082
Dev App Server is now running.
This is not an option going forward given that next firebase-tools versions will require java 11 or superior
I've had the exact same issue, but on Windows 10 and firebase-tools: 10.1.0
Same here with windows 10, java 17 and firebase tools 10.6.0
The windows is from firestore and has the following output
Apr 10, 2022 8:14:38 PM com.google.cloud.datastore.emulator.firestore.websocket.WebSocketServer start
INFO: Started WebSocket server on ws://localhost:56350
API endpoint: http://localhost:8082
If you are using a library that supports the FIRESTORE_EMULATOR_HOST environment variable, run:
export FIRESTORE_EMULATOR_HOST=localhost:8082
Dev App Server is now running.
Seems like this is an issue specific to Java 17 and Windows users; if someone in the open source community has more context on this, we'd happily accept/review any PRs
(Windows 10 + Oracle JDKs, tested with both firebase 10.6.0 and 11.19.0)
Also, in terms of export-on-exit behavior. Closing the popup prevents the export on exit to happen. Detached=false will lead to an error during export, preventing it as well.
If anyone is interested in trying their hand at a fix, here's the relevant location in firebase-tools below. The code will probably need to be moved off of child_process.spawn and on to something else (or somehow make the child processes resistant to SIGINT before export.)
Currently facing the same struggle here, we have Python code that uses Firebase. Unit tests need a firebase emulator, but if I send the main process a SIGINT, it dies immediately and leaves its child processes (the actual emulators) behind and running.
Reproducible with the following:
importsubprocessimportsignalimportshutilimporttimeFIREBASE=shutil.which('firebase')
# Process starts hereproc=subprocess.Popen([FIREBASE, 'emulators:start'])
time.sleep(30)
proc.send_signal(signal.SIGINT)
# Python checks the subprocess and updates the returncodeproc.poll()
assertproc.returncode==-2
will leave any emulators you may have started up and running. I can't find any signal I can send the process to get it to shut down cleanly. Going to do something dumb with firebase emulators:exec running some Python code that will shut down once I ask it to instead. Making my entrypoint for ALL of my tests be the firebase emulator doesn't work for me.
Activity
DKorosec commentedon Jan 19, 2022
I've had the exact same issue, but on Windows 10 and firebase-tools: 10.1.0
"Fixed" the issue by switching to OpenJDK @ https://adoptium.net/?variant=openjdk8
Quite annoying, as if the window was not closed the emulator could not start, because ports were in use, and also broke precommit hooks (running emulator in one of the steps caused everything to hung).
blikblum commentedon Apr 10, 2022
This is not an option going forward given that next firebase-tools versions will require java 11 or superior
Same here with windows 10, java 17 and firebase tools 10.6.0
The windows is from firestore and has the following output
DKorosec commentedon Apr 11, 2022
Then go for Open JDK 17, I'm using it and it works fine (https://adoptium.net/?variant=openjdk17).
Corchoneitor commentedon Jul 25, 2022
Also happens with firebase-tools 10.1.5 and jdk-18.
In my case, there are 2 unwanted java windows:
Really annoying.
lisajian commentedon Jul 25, 2022
Seems like this is an issue specific to Java 17 and Windows users; if someone in the open source community has more context on this, we'd happily accept/review any PRs
Psycarlo commentedon Oct 26, 2022
Why was this closed?
I still have this issue
Windows: Windows 10 Pro
Firebase Tools: v11.15.0
I fixed by installing: https://adoptium.net/temurin/releases/?version=17
And restarting my machine
markgoho commentedon Oct 26, 2022
hey @Psycarlo I don't think the issue was closed -- and I'm still experiencing it too!
it looks like (per this comment) the OpenJDK version doesn't do this.
ishowta commentedon Nov 1, 2022
This is a hack, but I was able to get it to exit by setting
detachedto false. I don't know aboutexport-on-exitas I haven't used it.https://github.com/firebase/firebase-tools/blob/master/src/emulator/downloadableEmulators.ts#L365-L369
Wadeck commentedon Jan 1, 2023
Just to add some data points.
After rollback, everything is fine again.
(Windows 10 + Oracle JDKs, tested with both firebase 10.6.0 and 11.19.0)
Also, in terms of export-on-exit behavior. Closing the popup prevents the export on exit to happen. Detached=false will lead to an error during export, preventing it as well.
christhompsongoogle commentedon Mar 31, 2023
I did some investigation and this seems to be caused by a bug in node's child_process.spawn function:
nodejs/node#21825
If anyone is interested in trying their hand at a fix, here's the relevant location in firebase-tools below. The code will probably need to be moved off of child_process.spawn and on to something else (or somehow make the child processes resistant to SIGINT before export.)
https://cs.opensource.google/firebase-sdk/firebase-tools/+/master:src/emulator/downloadableEmulators.ts;drc=f200dcb4865763a05c0426f4c3ec9640c9c4ff7f;l=369
A proper fix ideally would shut down the entire suite on SIGINT in the main window and needs to preserve export behavior.
akettmann-id commentedon Aug 23, 2024
Currently facing the same struggle here, we have Python code that uses Firebase. Unit tests need a firebase emulator, but if I send the main process a SIGINT, it dies immediately and leaves its child processes (the actual emulators) behind and running.
Reproducible with the following:
will leave any emulators you may have started up and running. I can't find any signal I can send the process to get it to shut down cleanly. Going to do something dumb with firebase emulators:exec running some Python code that will shut down once I ask it to instead. Making my entrypoint for ALL of my tests be the firebase emulator doesn't work for me.
fix(emulators): prevent extra console windows and orphaned java.exe (f…
Psycarlo commentedon Nov 4, 2026
After 5 years, we got a fix! Uh-hu!