Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"firebase emulator:start" will not run #2307

Closed
Elijer opened this issue May 29, 2020 · 7 comments · Fixed by #2318
Closed

"firebase emulator:start" will not run #2307

Elijer opened this issue May 29, 2020 · 7 comments · Fixed by #2318

Comments

@Elijer
Copy link

Elijer commented May 29, 2020

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
@google-oss-bot
Copy link
Contributor

This issue does not seem to follow the issue template. Make sure you provide all the required information.

@samtstern
Copy link
Contributor

@Elijer thanks for filing this. Looks like the Firestore emulator is crashing on startup.

@Elijer
Copy link
Author

Elijer commented May 31, 2020

I tried rolling back the node version on my computer to node 8 according to the console warning but it didn't help.

@Elijer
Copy link
Author

Elijer commented May 31, 2020

Okay! Got it. definitely a slight facepalm. My Java SDK was woefully out of date.

Figure it out at this stackexchange issue.

Updated Java Developer Kit

Elijahs-Air:wtfwtf jah$ firebase emulators:start
i  emulators: Starting emulators: firestore
⚠  emulators: It seems that you are running multiple instances of the emulator suite for project wtfwtf-4aad5. This may result in unexpected behavior.
i  firestore: Firestore Emulator logging to firestore-debug.log

Error: firestore: Firestore Emulator has exited with code: 1
Elijahs-Air:wtfwtf jah$ javac -version
javac 1.6.0_65
Elijahs-Air:wtfwtf jah$ javac -version
javac 14.0.1
Elijahs-Air:wtfwtf jah$

@samtstern
Copy link
Contributor

@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.

@Elijer
Copy link
Author

Elijer commented Jun 1, 2020

Definitely! Would love to save that time for other users. Thanks again for the help.

@Elijer Elijer closed this as completed Jun 1, 2020
@JamesVanWaza
Copy link

JamesVanWaza commented 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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants