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.

Emulators start and suddenly shutting down

See original GitHub issue

[REQUIRED] Environment info

firebase-tools: 9.16.0

Platform: macOS 11.4

[REQUIRED] Test case

I’ve 2 mac which 10.15.7 working fine but 11.4 refuse to start emulator.

[REQUIRED] Steps to reproduce

firebase emulators:start

[REQUIRED] Expected behavior

emulator start

[REQUIRED] Actual behavior

i  emulators: Starting emulators: functions, firestore
i  emulators: Shutting down emulators.
i  hub: Stopping emulator hub
:warning:  functions: Port 5001 is not open on localhost, could not start Functions Emulator.
:warning:  functions: To select a different host/port, specify that host/port in a firebase.json config file:
      {
        // ...
        "emulators": {
          "functions": {
            "host": "HOST",
            "port": "PORT"
          }
        }
      }
i  emulators: Shutting down emulators.

Error: Could not start Functions Emulator, port taken.
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

Issue Analytics

  • State:open
  • Created 2 years ago
  • Comments:5

github_iconTop GitHub Comments

2reactions
galaxyblurcommented, Dec 1, 2021

Just experienced this on a new Mac and it would definitely help if this error (“Unable to locate a Java Runtime.”) was printed to the console instead. Additionally, I don’t see any mention of Java in the emulator docs.

0reactions
katopzcommented, Jul 29, 2021

I think so at first, so I try lsof -ti:5001 with no result. To make sure, I kill all related port I can think of. And even reboot and try again with no luck. Retry firebase init didn’t work either.

Anyway when I try change function port to 9991. I got

i  emulators: Starting emulators: functions, firestore
:warning:  functions: The following emulators are not running, calls to these services from the Functions emulator will affect production: auth, database, hosting, pubsub, storage
:heavy_check_mark:  functions: Using node@16 from host.
i  firestore: Firestore Emulator logging to firestore-debug.log
:warning:  firestore: Fatal error occurred: 
   Firestore Emulator has exited with code: 1, 
   stopping all running emulators
i  functions: Stopping Functions Emulator
i  firestore: Stopping Firestore Emulator
:warning:  firestore: Error stopping Firestore Emulator
i  hub: Stopping emulator hub

Which is fine because I’vefirestore-debug.log to investigate now and it said.

The operation couldn’t be completed. Unable to locate a Java Runtime.
Please visit http://www.java.com/ for information on installing Java.

Cool, This is new mac which I didn’t install java runtime yet so I install it and try again. And now it’s working!

But, I’m still curious about 5001 port which no one using it so I switch back to 5001 and try again… didn’t work! I’ve to stick with other port number then.

TLDR

  • firestore-debug.log not create and emu shutting down when no java installed.
  • port 5001 didn’t work for some reason even no one using it.
  • Error detail seem incorrect about port taken?

I’ll leave issue open and let the team desire to close it as is or fix or investigate it somehow.

Thanks

Read more comments on GitHub >

github_iconTop Results From Across the Web

emulators shutting down immediately on Github CI if hosting ...
I've noticed that if I disable the hosting emulator (with --only), then the other emulators start fine. yarn run v1.22.19 $ concurrently --names ......
Read more >
Android Emulator Shutting down in few seconds after launching
Solution.1 By setting the Graphics option on the Android Virtual Device to Software instead of Automatic or Hardware.
Read more >
Firebase Emulators Not Properly Shutting Down - Medium
Just when the dread of spinning up a local server with a database started creeping up my spine, I found out about Firebase...
Read more >
Troubleshoot known issues with Android Emulator
To avoid crashes and hangs due to lack of free disk space, the emulator checks for sufficient free disk space on startup and...
Read more >
[Solved] My android emulator (AVD) shut down automatically
Go to Menu->Tools->Android and uncheck the option Enable ADB Integration Run the application. Now the emulator will be launched, but app will ...
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