firebase-tools: Error: It seems that you are running multiple instances of the emulator suite

[REQUIRED] Environment info

8.2.0 firebase-tools:

Platform: Macos

[REQUIRED] Test case

https://github.com/QuantumInformation/svelte-fullstack-starter

[REQUIRED] Steps to reproduce

Run firebase emulators:start at the root of the above url

[REQUIRED] Expected behavior

emulator to start

[REQUIRED] Actual behavior

the following output

image

debug log:

svelte-fullstack-starter git:(master) firebase emulators:start --debug
[2020-05-09T19:44:10.572Z] > 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-09T19:44:10.574Z] > authorizing via signed-in user
i  emulators: Starting emulators: functions, firestore, database, hosting, pubsub
⚠  emulators: It seems that you are running multiple instances of the emulator suite for project svelte-fullstack-starter. This may result in unexpected behavior.
[2020-05-09T19:44:10.593Z] [hub] writing locator at /var/folders/wk/xpjrzzgj0937n2ys2j951wyr0000gn/T/hub-svelte-fullstack-starter.json
✔  hub: emulator hub started at http://localhost:4400
⚠  Your requested "node" version "8" doesn't match your global version "12"
✔  functions: functions emulator started at http://localhost:5002
⚠  firestore: Did not find a Cloud Firestore rules file specified in a firebase.json config file.
⚠  firestore: The emulator will default to allowing all reads and writes. Learn more about this option: https://firebase.google.com/docs/emulator-suite/install_and_configure#security_rules_configuration.
[2020-05-09T19:44:10.875Z] Ignoring unsupported arg: projectId
[2020-05-09T19:44:10.875Z] Ignoring unsupported arg: auto_download
[2020-05-09T19:44:10.875Z] Starting firestore emulator with command {"binary":"java","args":["-Duser.language=en","-jar","/Users/nikos/.cache/firebase/emulators/cloud-firestore-emulator-v1.11.3.jar","--host","localhost","--port",8080,"--functions_emulator","localhost:5002"],"optionalArgs":["port","webchannel_port","host","rules","functions_emulator","seed_from_export"],"joinArgs":false}
i  firestore: firestore emulator logging to firestore-debug.log
[2020-05-09T19:44:11.974Z] API endpoint: http://localhost:
[2020-05-09T19:44:11.974Z] 8080
If you are using a library that supports the FIRESTORE_EMULATOR_HOST environment variable, run:

   export FIRESTORE_EMULATOR_HOST=localhost:8080

Dev App Server is now running.


✔  firestore: firestore emulator started at http://localhost:8080
i  firestore: For testing set FIRESTORE_EMULATOR_HOST=localhost:8080
⚠  database: Did not find a Realtime Database rules file specified in a firebase.json config file.
⚠  database: The emulator will default to allowing all reads and writes. Learn more about this option: https://firebase.google.com/docs/emulator-suite/install_and_configure#security_rules_configuration.
[2020-05-09T19:44:12.158Z] Ignoring unsupported arg: projectId
[2020-05-09T19:44:12.158Z] Ignoring unsupported arg: auto_download
[2020-05-09T19:44:12.158Z] Starting database emulator with command {"binary":"java","args":["-Duser.language=en","-jar","/Users/nikos/.cache/firebase/emulators/firebase-database-emulator-v4.4.1.jar","--host","localhost","--port",9000,"--functions_emulator_host","localhost","--functions_emulator_port",5002],"optionalArgs":["port","host","functions_emulator_port","functions_emulator_host"],"joinArgs":false}
i  database: database emulator logging to database-debug.log
[2020-05-09T19:44:13.695Z] 21:44:13.694 [NamespaceSystem-akka.actor.default-dispatcher-5] INFO akka.event.slf4j.Slf4jLogger - Slf4jLogger started

[2020-05-09T19:44:13.874Z] 21:44:13.873 [main] INFO com.firebase.server.forge.App$ - Listening at localhost:9000

✔  database: database emulator started at http://localhost:9000
i  database: For testing set FIREBASE_DATABASE_EMULATOR_HOST=localhost:9000
[2020-05-09T19:44:13.950Z] > refreshing access token with scopes: ["email","https://www.googleapis.com/auth/cloud-platform","https://www.googleapis.com/auth/cloudplatformprojects.readonly","https://www.googleapis.com/auth/firebase","openid"]
[2020-05-09T19:44:13.950Z] >>> HTTP REQUEST POST https://www.googleapis.com/oauth2/v3/token
 <request body omitted>
[2020-05-09T19:44:14.125Z] <<< HTTP RESPONSE 200 {"content-type":"application/json; charset=utf-8","vary":"X-Origin, Referer, Origin,Accept-Encoding","date":"Sat, 09 May 2020 19:44:14 GMT","server":"scaffolding on HTTPServer2","cache-control":"private","x-xss-protection":"0","x-frame-options":"SAMEORIGIN","x-content-type-options":"nosniff","alt-svc":"h3-27=\":443\"; ma=2592000,h3-25=\":443\"; ma=2592000,h3-Q050=\":443\"; ma=2592000,h3-Q049=\":443\"; ma=2592000,h3-Q048=\":443\"; ma=2592000,h3-Q046=\":443\"; ma=2592000,h3-Q043=\":443\"; ma=2592000,quic=\":443\"; ma=2592000; v=\"46,43\"","accept-ranges":"none","transfer-encoding":"chunked"}
[2020-05-09T19:44:14.137Z] >>> HTTP REQUEST GET https://firebase.googleapis.com/v1beta1/projects/svelte-fullstack-starter/webApps/-/config

[2020-05-09T19:44:14.786Z] <<< HTTP RESPONSE 200 {"content-type":"application/json; charset=UTF-8","vary":"X-Origin, Referer, Origin,Accept-Encoding","date":"Sat, 09 May 2020 19:44:14 GMT","server":"ESF","cache-control":"private","x-xss-protection":"0","x-frame-options":"SAMEORIGIN","x-content-type-options":"nosniff","alt-svc":"h3-27=\":443\"; ma=2592000,h3-25=\":443\"; ma=2592000,h3-Q050=\":443\"; ma=2592000,h3-Q049=\":443\"; ma=2592000,h3-Q048=\":443\"; ma=2592000,h3-Q046=\":443\"; ma=2592000,h3-Q043=\":443\"; ma=2592000,quic=\":443\"; ma=2592000; v=\"46,43\"","accept-ranges":"none","transfer-encoding":"chunked"}
i  hosting: Serving hosting files from: public
✔  hosting: Local server: http://localhost:5000
✔  hosting: hosting emulator started at http://localhost:5000
[2020-05-09T19:44:14.811Z] Ignoring unsupported arg: projectId
[2020-05-09T19:44:14.811Z] Ignoring unsupported arg: auto_download
[2020-05-09T19:44:14.811Z] Starting pubsub emulator with command {"binary":"/Users/nikos/.cache/firebase/emulators/pubsub-emulator-0.1.0/pubsub-emulator/bin/cloud-pubsub-emulator","args":["--host=localhost","--port=8085"],"optionalArgs":["port","host"],"joinArgs":true}
i  pubsub: pubsub emulator logging to pubsub-debug.log
[2020-05-09T19:44:14.985Z] This is the Google Pub/Sub fake.

[2020-05-09T19:44:14.986Z] Implementation may be incomplete or differ from the real system.

[2020-05-09T19:44:15.015Z] May 09, 2020 9:44:14 PM com.google.cloud.pubsub.testing.v1.Main main
INFO: IAM integration is disabled. IAM policy methods and ACL checks are not supported

[2020-05-09T19:44:15.547Z] May 09, 2020 9:44:15 PM io.gapi.emulators.netty.NettyUtil applyJava7LongHostnameWorkaround
INFO: Unable to apply Java 7 long hostname workaround.

[2020-05-09T19:44:15.630Z] May 09, 2020 9:44:15 PM com.google.cloud.pubsub.testing.v1.Main main
INFO: Server started, listening on 8085

✔  pubsub: pubsub emulator started at http://localhost:8085
i  functions: Watching "/Users/nikos/WebstormProjects/svelte-fullstack-starter/functions" for Cloud Functions...
[2020-05-09T19:44:15.845Z] [worker-pool] addWorker(~diagnostic~)
[2020-05-09T19:44:15.846Z] [worker-pool] Adding worker with key ~diagnostic~, total=1
[2020-05-09T19:44:15.846Z] [worker-pool] submitWork(triggerId=)
[2020-05-09T19:44:15.847Z] [worker-~diagnostic~-d5e3219e-99af-4c9f-85e3-90482760af04]: Assigning socketPath: /var/folders/wk/xpjrzzgj0937n2ys2j951wyr0000gn/T/fire_emu_31830.sock
[2020-05-09T19:44:15.847Z] [worker-~diagnostic~-d5e3219e-99af-4c9f-85e3-90482760af04]: BUSY
[2020-05-09T19:44:15.991Z] May 09, 2020 9:44:15 PM io.gapi.emulators.grpc.GrpcServer$3 operationComplete
INFO: Adding handler(s) to newly registered Channel.

[2020-05-09T19:44:16.076Z] [runtime-status] [31830] Functions runtime initialized. {"cwd":"/Users/nikos/WebstormProjects/svelte-fullstack-starter/functions","node_version":"12.13.1"}
[2020-05-09T19:44:16.077Z] [runtime-status] [31830] Disabled runtime features: undefined
[2020-05-09T19:44:16.080Z] [runtime-status] [31830] Resolved module firebase-admin {"declared":true,"installed":true,"version":"8.12.1","resolution":"/Users/nikos/WebstormProjects/svelte-fullstack-starter/functions/node_modules/firebase-admin/lib/index.js"}
[2020-05-09T19:44:16.082Z] [runtime-status] [31830] Resolved module firebase-functions {"declared":true,"installed":true,"version":"3.6.1","resolution":"/Users/nikos/WebstormProjects/svelte-fullstack-starter/functions/node_modules/firebase-functions/lib/index.js"}
[2020-05-09T19:44:16.082Z] [runtime-status] [31830] Set PUBSUB_EMULATOR_HOST to localhost:8085
[2020-05-09T19:44:16.085Z] [runtime-status] [31830] Outgoing network have been stubbed. [{"name":"http","status":"mocked"},{"name":"http","status":"mocked"},{"name":"https","status":"mocked"},{"name":"https","status":"mocked"},{"name":"net","status":"mocked"}]
[2020-05-09T19:44:16.133Z] [runtime-status] [31830] Checked functions.config() {"config":{}}
[2020-05-09T19:44:16.133Z] [runtime-status] [31830] Resolved module firebase-functions {"declared":true,"installed":true,"version":"3.6.1","resolution":"/Users/nikos/WebstormProjects/svelte-fullstack-starter/functions/node_modules/firebase-functions/lib/index.js"}
[2020-05-09T19:44:16.134Z] [runtime-status] [31830] Resolved module firebase-admin {"declared":true,"installed":true,"version":"8.12.1","resolution":"/Users/nikos/WebstormProjects/svelte-fullstack-starter/functions/node_modules/firebase-admin/lib/index.js"}
[2020-05-09T19:44:16.134Z] [runtime-status] [31830] Resolved module firebase-functions {"declared":true,"installed":true,"version":"3.6.1","resolution":"/Users/nikos/WebstormProjects/svelte-fullstack-starter/functions/node_modules/firebase-functions/lib/index.js"}
[2020-05-09T19:44:16.134Z] [runtime-status] [31830] firebase-admin has been stubbed. {"adminResolution":{"declared":true,"installed":true,"version":"8.12.1","resolution":"/Users/nikos/WebstormProjects/svelte-fullstack-starter/functions/node_modules/firebase-admin/lib/index.js"}}
[2020-05-09T19:44:16.137Z] [runtime-status] [31830] initializeApp(DEFAULT) {"databaseURL":"https://svelte-fullstack-starter.firebaseio.com","storageBucket":"svelte-fullstack-starter.appspot.com","projectId":"svelte-fullstack-starter"}
✔  functions[listUsers]: http function initialized (http://localhost:5002/svelte-fullstack-starter/us-central1/listUsers).
✔  functions[upsertUsername]: http function initialized (http://localhost:5002/svelte-fullstack-starter/us-central1/upsertUsername).
✔  emulators: All emulators started, it is now safe to connect.
[2020-05-09T19:44:16.139Z] [worker-~diagnostic~-d5e3219e-99af-4c9f-85e3-90482760af04]: IDLE

About this issue

  • Original URL
  • State: open
  • Created 4 years ago
  • Reactions: 9
  • Comments: 47 (10 by maintainers)

Most upvoted comments

@christhompsongoogle a simple pkill -f firebase is working for me on Ubuntu.

Hi folks - I’m running into this issue with firebase-tools: 10.7.2, which is how I found this thread. Seems like this was fixed a couple of years ago - is this an issue that has re-emerged?

I had this problem too, in having instances of the emulator working even after finishing/shut down (Ctrl + C).

So, I used a script on my package.json with all the ports I use in my firebase.json file, and after the shot down I run the script, I believe it can be a good workaround.

package.json

"scripts": {
...
"stopall": "lsof -t -i:2000 -i:6001 -i:9080 -i:8086 -i:9099 | xargs kill -9",
...
}

firebase.json

 ...
"emulators": {
    "hosting": {
      "port": 2000
    },
    "functions": {
      "port": 6001
    },
    "firestore": {
      "port": 9080
    },
    "pubsub": {
      "port": 8086
    },
    "auth": {
      "port": 9099
    },
    "ui": {
      "enabled": true
    },
  }
... 

On the project root:

  • Ctrl + C
  • npm run stopall

Couldn’t be there an firebase emulators:stop to kill any running emulators?

Edit: this seems closed but still happens here.

I had this problem too, in having instances of the emulator working even after finishing/shut down (Ctrl + C).

So, I used a script on my package.json with all the ports I use in my firebase.json file, and after the shot down I run the script, I believe it can be a good workaround.

package.json

"scripts": {
...
"stopall": "lsof -t -i:2000 -i:6001 -i:9080 -i:8086 -i:9099 | xargs kill -9",
...
}

firebase.json

 ...
"emulators": {
    "hosting": {
      "port": 2000
    },
    "functions": {
      "port": 6001
    },
    "firestore": {
      "port": 9080
    },
    "pubsub": {
      "port": 8086
    },
    "auth": {
      "port": 9099
    },
    "ui": {
      "enabled": true
    },
  }
... 

On the project root:

  • Ctrl + C
  • npm run stopall

That’s good! I’ve been using sudo pkill node and sometimes java, but this may kill other non related processes.

10.1.14 (I think) but after reading through some other threads, I ran the update code from the cli and it fixed the issue. Sorry for not coming back! Thanks for checking in!!

@joehan I found that the issue occurs when I run the script using turbo from the root of my turborepo and the emulator is not able to shut down correctly when I do ctrl+c, but if I use pnpm or run It from the subworkspace it works and shuts down correctly.

Any update on this? I am having the issue on 13.2.1, neither pids=$(ps aux | grep '[p]ubsub' | awk '{print $2}'); if [ ! -z "$pids" ]; then kill $pids; fi; nor pkill -f firebase worked for me, it still shows ⚠ emulators: It seems that you are running multiple instances of the emulator suite for project hello-world. This may result in unexpected behavior..

Yeah, I’ll start a new issue. To be clear, the

⚠ emulators: It seems that you are running multiple instances of the emulator suite for project firestripe-boilerplate. This may result in unexpected behavior.

still comes up every time afterwards, just not the first time firestore emulators:start is run after changing the port in the firebase.json, or after initiating a new project.

@samstern thanks for the quick reply. So I think I’m missing something about npm: when I do npm install -g firebase-tools I get +firebase-tools@8.4.1 but when I print npm firebase-tools -v I get 6.14.4. Sorry I know this isn’t how the issues should be used.

I don’t think I’m running multiple copies of the emulator, but I might also be missing something there. I don’t have any other terminals open that are running any processes. Is there any other way I could have other copies of the emulator running?

How do I find the sentinel file to delete it?

I restarted my system and this error went away, close ticket?

Same on Linux with firebase-tools:8.2.0

Start/Stop all emulators command shows warning after repeated use.

If I run firebase emulators:start for the first time I see normal expected output:

╰─$ firebase emulators:start                                                                         1 ↵
i  emulators: Starting emulators: functions, firestore, database, hosting, pubsub
✔  hub: emulator hub started at http://localhost:4400
✔  functions: functions emulator started at http://localhost:5001
<...>

But then I press CTRL+C seems that some resources are not cleaned-up (no msg about stopping emulators)

If I try to run firebase emulators:start for the 2nd time I see output with warning:

╰─$ firebase emulators:start                                                                       130 ↵
i  emulators: Starting emulators: functions, firestore, database, hosting, pubsub
⚠  emulators: It seems that you are running multiple instances of the emulator suite for project my-project. This may result in unexpected behavior.
✔  hub: emulator hub started at http://localhost:4400
✔  functions: functions emulator started at http://localhost:5001
<...>

Start/Stop --only emulators command works as expected after repeated use.

I start command firebase emulators:start --only functions,firestore,database

╰─$ firebase emulators:start --only functions,firestore,database                                     1 ↵
i  emulators: Starting emulators: functions, firestore, database
✔  hub: emulator hub started at http://localhost:4400
✔  functions: functions emulator started at http://localhost:5001
<...>

Then I press CTRL+C I see printed out message about emulators being stopped

i  emulators: Shutting down emulators.
i  hub: Stopping emulator hub
i  functions: Stopping functions emulator
i  firestore: Stopping firestore emulator
i  database: Stopping database emulator

I can repeat this as many times, and never see It seems that you are running multiple instances<...> warning


Maybe only one type of emulator is not being stopped which is not in my --only functions,firestore,database list. I haven’t tested this much. But maybe this help to find root cause.