question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

"firebase emulator:start" will not run

See original GitHub issue

Environment info

firebase-tools: 8.4.1 Platform: Mac OS Sierra

Test case

When I run firebase emulators:start, an error is thrown and the emulators are not run.

If I run firebase emulators:start additional times after this, the same errors are thrown in addition to this warning:

It seems that you are running multiple instances of the emulator suite for project fir-emulator-issue2. This may result in unexpected behavior.

I haven’t been able to get the emulators to run successfully yet.

Steps to reproduce

Create a new public directory and init a newly created firebase project into it. Add emulators to the init: include firestore, hosting and functions. Then, in the console, run: firebase emulators:start.

Here is a github repo of a minimal reproduction

In the readme of the github repo I included the logs for the firebase init configuration just in case.

Here is a live deploy

Expected behavior

I would expect the emulators to start instead of running an error and crashing. I would also expect to see a line saying that the ‘processes shut down’ with each additional run of firebase emulators:start instead of the console telling me that the emulator is already running.

Actual behavior

Elijahs-Air:emulator-issue jah$ firebase emulators:start --debug

[2020-05-29T15:50:10.413Z] > 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"]
[2020-05-29T15:50:10.416Z] > authorizing via signed-in user
i  emulators: Starting emulators: functions, firestore, hosting {"metadata":{"emulator":{"name":"hub"},"message":"Starting emulators: functions, firestore, hosting"}}
[2020-05-29T15:50:10.483Z] [hub] writing locator at /var/folders/s1/kxm01zy17v59z003d47wf0200000gn/T/hub-emulator-issue-49c9f.json
⚠  Your requested "node" version "8" doesn't match your global version "12" {"metadata":{"emulator":{"name":"functions"},"message":"Your requested \"node\" version \"8\" doesn't match your global version \"12\""}}
[2020-05-29T15:50:10.522Z] Ignoring unsupported arg: projectId {"metadata":{"emulator":{"name":"firestore"},"message":"Ignoring unsupported arg: projectId"}}
[2020-05-29T15:50:10.523Z] Ignoring unsupported arg: auto_download {"metadata":{"emulator":{"name":"firestore"},"message":"Ignoring unsupported arg: auto_download"}}
[2020-05-29T15:50:10.523Z] Starting Firestore Emulator with command {"binary":"java","args":["-Duser.language=en","-jar","/Users/jah/.cache/firebase/emulators/cloud-firestore-emulator-v1.11.4.jar","--host","localhost","--port",8080,"--rules","/Users/jah/Desktop/Firebase Projects/emulator-issue/firestore.rules","--functions_emulator","localhost:5001"],"optionalArgs":["port","webchannel_port","host","rules","functions_emulator","seed_from_export"],"joinArgs":false} {"metadata":{"emulator":{"name":"firestore"},"message":"Starting Firestore Emulator with command {\"binary\":\"java\",\"args\":[\"-Duser.language=en\",\"-jar\",\"/Users/jah/.cache/firebase/emulators/cloud-firestore-emulator-v1.11.4.jar\",\"--host\",\"localhost\",\"--port\",8080,\"--rules\",\"/Users/jah/Desktop/Firebase Projects/emulator-issue/firestore.rules\",\"--functions_emulator\",\"localhost:5001\"],\"optionalArgs\":[\"port\",\"webchannel_port\",\"host\",\"rules\",\"functions_emulator\",\"seed_from_export\"],\"joinArgs\":false}"}}
i  firestore: Firestore Emulator logging to firestore-debug.log {"metadata":{"emulator":{"name":"firestore"},"message":"Firestore Emulator logging to \u001b[1mfirestore-debug.log\u001b[22m"}}
[2020-05-29T15:50:11.057Z] Exception in thread "main" java.lang.UnsupportedClassVersionError: com/google/cloud/datastore/emulator/firestore/CloudFirestore : Unsupported major.minor version 52.0
 {"metadata":{"emulator":{"name":"firestore"},"message":"Exception in thread \"main\" java.lang.UnsupportedClassVersionError: com/google/cloud/datastore/emulator/firestore/CloudFirestore : Unsupported major.minor version 52.0\n"}}
[2020-05-29T15:50:11.058Z]      at java.lang.ClassLoader.defineClass1(Native Method)
        at java.lang.ClassLoader.defineClassCond(ClassLoader.java:637)
        at java.lang.ClassLoader.defineClass(ClassLoader.java:621)
        at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:141)
        at java.net.URLClassLoader.defineClass(URLClassLoader.java:283)
        at java.net.URLClassLoader.access$000(URLClassLoader.java:58) {"metadata":{"emulator":{"name":"firestore"},"message":"\tat java.lang.ClassLoader.defineClass1(Native Method)\n\tat java.lang.ClassLoader.defineClassCond(ClassLoader.java:637)\n\tat java.lang.ClassLoader.defineClass(ClassLoader.java:621)\n\tat java.security.SecureClassLoader.defineClass(SecureClassLoader.java:141)\n\tat java.net.URLClassLoader.defineClass(URLClassLoader.java:283)\n\tat java.net.URLClassLoader.access$000(URLClassLoader.java:58)"}}
[2020-05-29T15:50:11.059Z] 
        at java.net.URLClassLoader$1.run(URLClassLoader.java:197)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
 {"metadata":{"emulator":{"name":"firestore"},"message":"\n\tat java.net.URLClassLoader$1.run(URLClassLoader.java:197)\n\tat java.security.AccessController.doPrivileged(Native Method)\n\tat java.net.URLClassLoader.findClass(URLClassLoader.java:190)\n"}}
[2020-05-29T15:50:11.060Z]      at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
        at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
 {"metadata":{"emulator":{"name":"firestore"},"message":"\tat java.lang.ClassLoader.loadClass(ClassLoader.java:306)\n\tat sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)\n\tat java.lang.ClassLoader.loadClass(ClassLoader.java:247)\n"}}

Error: firestore: Firestore Emulator has exited with code: 1

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

3reactions
JamesVanWazacommented, Nov 23, 2020

This is where the download is - https://www.oracle.com/java/technologies/javase-downloads.html

@samtstern however when I updated it I still am getting the error. How do I resolve the issue?

Screen Shot 2020-11-22 at 8 23 12 PM
1reaction
samtsterncommented, Jun 1, 2020

@Elijer thanks! Looks like we check for the existence of java but don’t check for the version. It would be good if we could surface a clearer error here.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Firestore/Firebase Emulator Not Running - Stack Overflow
Run firebase emulators:start . Check if displayed error request to install OpenJDK. · You may need to emulate functions and firestore at the...
Read more >
Install, configure and integrate Local Emulator Suite - Firebase
emulators:start, Start emulators for the Firebase products configured in firebase.json . Emulator processes will continue running until explicitly stopped.
Read more >
Port 8080 is not open on localhost, could not start Firestore ...
This error is because of the failed quitting from firebase emulator. You already have the process of previous firebase emulator. This command will...
Read more >
The Full Guide on how to use the Firebase Emulator for the Web
Using HTTP functions with the Emulator. First you need to make sure you have Firebase Cloud Functions initialized in your project, if not,...
Read more >
Disable Firebase emulators when in production - Egghead.io
When we open the application, you can see both in the console and a big warning here, "Running in emulator mode. Do not...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found