12

I'm trying to make use of the firebase emulators, however after trying to start it (using "firebase emulators:start") I always get:

i  emulators: Starting emulators: auth, functions, firestore, hosting
⚠  functions: The following emulators are not running, calls to these services from the Functions emulator will affect production: database, pubsub
✔  functions: Using node@10 from host.
i  firestore: Firestore Emulator logging to firestore-debug.log
⚠  firestore: Fatal error occurred: 
   Firestore Emulator has exited because java is not installed, you can install it from https://openjdk.java.net/install/, 
   stopping all running emulators
i  functions: Stopping Functions Emulator
i  firestore: Stopping Firestore Emulator
⚠  firestore: Error stopping Firestore Emulator
i  hub: Stopping emulator hub

As I get no further error information I can't conclude what's wrong.

I have installed OpenJDK. $java --version gives the following result:

openjdk 15.0.1 2020-10-20
OpenJDK Runtime Environment (build 15.0.1+0-snap)
OpenJDK 64-Bit Server VM (build 15.0.1+0-snap, mixed mode, sharing)

I'm using the as of today latest firebase-tool 8.19.0 and Ubuntu 18.04.5 LTS.

My JAVA_HOME is set using:

. $(openjdk)

I assume it's some missing environment variables but who knows. Any ideas what's wrong?

  • Hard to say what's going on but can you file an issue on the firebase-tools repo and include the full debug logs? – Sam Stern Dec 14 '20 at 15:58
  • @SamStern OK please clarify what log files you suggest that I add. (firestore-debug.log is empty) – Erling Mårtensson Dec 14 '20 at 17:58
  • 3
    After some back and forth I found a way to resolve it. I installed using the Ubuntu Software application and though it installed and definately worked the emulator wasn't happy. When instead installing Java from the command promt, as shown on https://openjdk.java.net/install/ it worked. It assume it's related to what version of OpenJDK that is installed and probably v8 is what the emulators is requesting and it's not happy with a newer version. It least that is my speculation without digging deaper. – Erling Mårtensson Dec 15 '20 at 07:56
  • 3
    For anyone else maybe having this issue on Windows: make sure you're not being stupid like me and trying to run the emulators inside a Node terminal instance in VS Code, as opposed to a Powershell instance. Node does not see Java at all and kept giving me this error. – Lazar Dec 22 '21 at 16:34

0 Answers0