When running in WSL emulator does not properly detect lack of 'java' executable
See original GitHub issueHi Firebase team,
I’ve not had success trying to get emulators working in WSL.
The recent update (https://github.com/firebase/firebase-tools/issues/1458) fixed the port was not active within 3000ms
issue.
End goal is to have console.log() showing function output in the command prompt.
Here are the details:
[REQUIRED] Environment info
firebase-tools: 7.5.0
Platform: Windows/WSL
[REQUIRED] Test case
[REQUIRED] Steps to reproduce
Test commands pasted. The issue happens reliably everytime, emulators are unable to start.
[REQUIRED] Expected behavior
Emulators should start, firebase function output viewable in command prompt.
[REQUIRED] Actual behavior
firebase-debug.log [debug] [2019-10-10T21:19:08.690Z] ---------------------------------------------------------------------- [debug] [2019-10-10T21:19:08.693Z] Command: /home/standard/.nvm/versions/node/v10.16.0/bin/node /home/standard/.nvm/versions/node/v10.16.0/bin/firebase emulators:start [debug] [2019-10-10T21:19:08.693Z] CLI Version: 7.5.0 [debug] [2019-10-10T21:19:08.693Z] Platform: linux [debug] [2019-10-10T21:19:08.693Z] Node Version: v10.16.0 [debug] [2019-10-10T21:19:09.522Z] Time: Fri Oct 11 2019 07:19:08 GMT+1000 (GMT+10:00) [debug] [2019-10-10T21:19:09.522Z] ---------------------------------------------------------------------- [debug] [debug] [2019-10-10T21:19:09.537Z] > command requires scopes: [“email”,“openid”,“https://www.googleapis.com/auth/cloudplatformprojects.readonly",“https://www.googleapis.com/auth/firebase”,"https://www.googleapis.com/auth/cloud-platform”] [debug] [2019-10-10T21:19:09.539Z] > authorizing via signed-in user [info] i Starting emulators: [“functions”,“firestore”,“hosting”] [warn] ⚠ Your requested “node” version “8” doesn’t match your global version “10” [info] ✔ functions: Emulator started at http://localhost:5001 [info] i firestore: Serving ALL traffic (including WebChannel) on http://localhost:8080 [warn] ⚠ firestore: Support for WebChannel on a separate port (8081) is DEPRECATED and will go away soon. Please use port above instead. [debug] [2019-10-10T21:19:09.939Z] Ignoring unsupported arg: projectId [debug] [2019-10-10T21:19:09.939Z] Ignoring unsupported arg: auto_download [debug] [2019-10-10T21:19:09.939Z] Starting emulator firestore with command {“binary”:“java”,“args”:[“-Duser.language=en”,“-jar”,“/home/DIR_NAME/standard/.cache/firebase/emulators/cloud-firestore-emulator-v1.9.0.jar”,“–host”,“localhost”,“–port”,8080,“–rules”,“/mnt/c/Users/Standard/Documents/GitHub/DIR/firestore.rules”,“–functions_emulator”,“localhost:5001”,“–webchannel_port”,8081],“optionalArgs”:[“port”,“webchannel_port”,“host”,“rules”,“functions_emulator”]} [info] i firestore: Emulator logging to firestore-debug.log [info] i Shutting down emulators. [info] i Stopping functions emulator [debug] [2019-10-10T21:19:09.999Z] Error: spawn java EACCES at Process.ChildProcess._handle.onexit (internal/child_process.js:240:19) at onErrorNT (internal/child_process.js:415:16) at process._tickCallback (internal/process/next_tick.js:63:19) [error] [error] Error: An unexpected error has occurred.
Also, running firebase serve: ➜ DIR_NAMEgit:(master) ✗ firebase serve --only functions [11/10/19| 8:19AM] ⚠ Your requested “node” version “8” doesn’t match your global version “10” ✔ functions: Emulator started at http://localhost:5000 i functions: Watching “/mnt/c/Users/Standard/Documents/GitHub/DIR_NAME/functions” for Cloud Functions…
git:(master) ✗ firebase emulators:start --debug [11/10/19| 8:30AM] [2019-10-10T21:31:51.586Z] ---------------------------------------------------------------------- [2019-10-10T21:31:51.594Z] Command: /home/standard/.nvm/versions/node/v10.16.0/bin/node /home/standard/.nvm/versions/node/v10.16.0/bin/firebase emulators:start --debug [2019-10-10T21:31:51.598Z] CLI Version: 7.5.0 [2019-10-10T21:31:51.599Z] Platform: linux [2019-10-10T21:31:51.600Z] Node Version: v10.16.0 [2019-10-10T21:31:52.440Z] Time: Fri Oct 11 2019 07:31:51 GMT+1000 (GMT+10:00) [2019-10-10T21:31:52.444Z] ----------------------------------------------------------------------
[2019-10-10T21:31:52.464Z] > command requires scopes: [“email”,“openid”,“https://www.googleapis.com/auth/cloudplatformprojects.readonly",“https://www.googleapis.com/auth/firebase”,"https://www.googleapis.com/auth/cloud-platform”] [2019-10-10T21:31:52.472Z] > authorizing via signed-in user i Starting emulators: [“functions”,“firestore”,“hosting”] ⚠ Your requested “node” version “8” doesn’t match your global version “10” ✔ functions: Emulator started at http://localhost:5001 i firestore: Serving ALL traffic (including WebChannel) on http://localhost:8080 ⚠ firestore: Support for WebChannel on a separate port (8081) is DEPRECATED and will go away soon. Please use port above instead. [2019-10-10T21:31:52.848Z] Ignoring unsupported arg: projectId [2019-10-10T21:31:52.850Z] Ignoring unsupported arg: auto_download [2019-10-10T21:31:52.851Z] Starting emulator firestore with command {“binary”:“java”,“args”:[“-Duser.language=en”,“-jar”,“/home/standard/.cache/firebase/emulators/cloud-firestore-emulator-v1.9.0.jar”,“–host”,“localhost”,“–port”,8080,“–rules”,“/mnt/c/Users/Standard/Documents/GitHub/DIR_NAME/firestore.rules”,“–functions_emulator”,“localhost:5001”,“–webchannel_port”,8081],“optionalArgs”:[“port”,“webchannel_port”,“host”,“rules”,“functions_emulator”]} i firestore: Emulator logging to firestore-debug.log i Shutting down emulators. i Stopping functions emulator [2019-10-10T21:31:52.924Z] Error: spawn java EACCES at Process.ChildProcess._handle.onexit (internal/child_process.js:240:19) at onErrorNT (internal/child_process.js:415:16) at process._tickCallback (internal/process/next_tick.js:63:19)
Error: An unexpected error has occurred.
Issue Analytics
- State:
- Created 4 years ago
- Comments:7 (5 by maintainers)
I renamed this issue because we should be telling you when you don’t have
java
but clearly we are not.@barnu5 if your function calls
console.log()
you should see that output in the console when the function runs. If you’re not seeing that, please file a new issue for that.