firebase-tools: emulators shutting down immediately on Github CI if hosting emulator is not disabled since v11.14.2

[REQUIRED] Environment info

firebase-tools: 11.14.2

Platform: Ubuntu

[REQUIRED] Test case

See this PR: https://github.com/jnizet/decouvertes-nature/pull/399 and the build failing in this github action: https://github.com/jnizet/decouvertes-nature/actions/runs/3232299633/jobs/5292764406

[REQUIRED] Steps to reproduce

The github action starts the emulators with the command

firebase emulators:start --debug --import=emulator-data

[REQUIRED] Expected behavior

The emulators start (that was the case in previous version of firebase tools)

[REQUIRED] Actual behavior

They start, then shut down immediately (see output of the github action)

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 "emulators,app,test" --success first --kill-others "firebase emulators:start --debug --import=emulator-data" "yarn build:e2e:ci && yarn serve:e2e:ci" "wait-on --timeout 180000 http://localhost:4201 http://localhost:4000 && yarn playwright test"
[app] $ ng build -c e2e
[emulators] [2022-10-12T05:43:49.515Z] > 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"]
[emulators] Failed to authenticate, have you run firebase login?
[emulators] ⚠  emulators: You are not currently authenticated so some features may not work correctly. Please run firebase login to authenticate the CLI. 
[emulators] [2022-10-12T05:43:49.740Z] <<< [apiv2][status] GET https://firebase-public.firebaseio.com/cli.json 200
[emulators] [2022-10-12T05:43:49.741Z] <<< [apiv2][body] GET https://firebase-public.firebaseio.com/cli.json {"cloudBuildErrorAfter":1594252800000,"cloudBuildWarnAfter":1590019200000,"defaultNode10After":1594252800000,"minVersion":"3.0.5","node8DeploysDisabledAfter":1613390400000,"node8RuntimeDisabledAfter":1615809600000,"node8WarnAfter":1600128000000}
[emulators] [2022-10-12T05:43:49.822Z] openjdk version "11.0.16.1" 2022-08-12
[emulators] 
[emulators] [2022-10-12T05:43:49.823Z] OpenJDK Runtime Environment Temurin-11.0.16.1+1 (build 11.0.16.1+1)
[emulators] OpenJDK 64-Bit Server VM Temurin-11.0.16.1+1 (build 11.0.16.1+1, mixed mode)
[emulators] 
[emulators] [2022-10-12T05:43:49.827Z] Parsed Java major version: 11
[emulators] i  emulators: Starting emulators: auth, functions, firestore, hosting {"metadata":{"emulator":{"name":"hub"},"message":"Starting emulators: auth, functions, firestore, hosting"}}
[emulators] [2022-10-12T05:43:49.835Z] [logging] Logging Emulator only supports listening on one address (127.0.0.1). Not listening on ::1
[emulators] [2022-10-12T05:43:49.836Z] [auth] Authentication Emulator only supports listening on one address (127.0.0.1). Not listening on ::1
[emulators] [2022-10-12T05:43:49.837Z] [firestore] Firestore Emulator only supports listening on one address (127.0.0.1). Not listening on ::1
[emulators] [2022-10-12T05:43:49.838Z] [firestore.websocket] websocket server for firestore only supports listening on one address (127.0.0.1). Not listening on ::1
[emulators] [2022-10-12T05:43:49.838Z] [hosting] Hosting Emulator only supports listening on one address (127.0.0.1). Not listening on ::1
[emulators] [2022-10-12T05:43:49.839Z] assigned listening specs for emulators {"user":{"hub":[{"address":"127.0.0.1","family":"IPv4","port":4400},{"address":"::1","family":"IPv6","port":4400}],"ui":[{"address":"127.0.0.1","family":"IPv4","port":4000},{"address":"::1","family":"IPv6","port":4000}],"logging":[{"address":"127.0.0.1","family":"IPv4","port":4500}],"auth":[{"address":"127.0.0.1","family":"IPv4","port":9099}],"firestore":[{"address":"127.0.0.1","family":"IPv4","port":7070}],"firestore.websocket":[{"address":"127.0.0.1","family":"IPv4","port":9150}],"hosting":[{"address":"127.0.0.1","family":"IPv4","port":12000}]},"metadata":{"message":"assigned listening specs for emulators"}}
[emulators] [2022-10-12T05:43:49.844Z] [hub] writing locator at /tmp/hub-decouvertes-nature.json
[emulators] [2022-10-12T05:43:49.848Z] [functions] Functions Emulator only supports listening on one address (127.0.0.1). Not listening on ::1
[emulators] [2022-10-12T05:43:49.855Z] [eventarc] Eventarc Emulator only supports listening on one address (127.0.0.1). Not listening on ::1
[emulators] [2022-10-12T05:43:49.855Z] late-assigned ports for functions and eventarc emulators {"user":{"hub":[{"address":"127.0.0.1","family":"IPv4","port":4400},{"address":"::1","family":"IPv6","port":4400}],"ui":[{"address":"127.0.0.1","family":"IPv4","port":4000},{"address":"::1","family":"IPv6","port":4000}],"logging":[{"address":"127.0.0.1","family":"IPv4","port":4500}],"auth":[{"address":"127.0.0.1","family":"IPv4","port":9099}],"firestore":[{"address":"127.0.0.1","family":"IPv4","port":7070}],"firestore.websocket":[{"address":"127.0.0.1","family":"IPv4","port":9150}],"hosting":[{"address":"127.0.0.1","family":"IPv4","port":12000}],"functions":[{"address":"127.0.0.1","family":"IPv4","port":5001}],"eventarc":[{"address":"127.0.0.1","family":"IPv4","port":9299}]},"metadata":{"message":"late-assigned ports for functions and eventarc emulators"}}
[emulators] ⚠  functions: The following emulators are not running, calls to these services from the Functions emulator will affect production: database, pubsub, storage {"metadata":{"emulator":{"name":"functions"},"message":"The following emulators are not running, calls to these services from the Functions emulator will affect production: \u001b[1mdatabase, pubsub, storage\u001b[22m"}}
[emulators] ✔  functions: Using node@14 from host. {"metadata":{"emulator":{"name":"functions"},"message":"Using node@14 from host."}}
[emulators] ⚠  functions: You are not signed in to the Firebase CLI. If you have authorized this machine using gcloud application-default credentials those may be discovered and used to access production services. {"metadata":{"emulator":{"name":"functions"},"message":"You are not signed in to the Firebase CLI. If you have authorized this machine using gcloud application-default credentials those may be discovered and used to access production services."}}
[emulators] [2022-10-12T05:43:49.866Z] > refreshing access token with scopes: []
[emulators] [2022-10-12T05:43:49.867Z] >>> [apiv2][query] POST https://www.googleapis.com/oauth2/v3/token [none]
[emulators] [2022-10-12T05:43:49.867Z] >>> [apiv2][body] POST https://www.googleapis.com/oauth2/v3/token [omitted]
[emulators] [2022-10-12T05:43:49.918Z] <<< [apiv2][status] POST https://www.googleapis.com/oauth2/v3/token 400
[emulators] [2022-10-12T05:43:49.919Z] <<< [apiv2][body] POST https://www.googleapis.com/oauth2/v3/token [omitted]
[emulators] [2022-10-12T05:43:49.920Z] >>> [apiv2][query] GET https://firebase.googleapis.com/v1beta1/projects/decouvertes-nature/adminSdkConfig [none]
[emulators] [2022-10-12T05:43:50.032Z] <<< [apiv2][status] GET https://firebase.googleapis.com/v1beta1/projects/decouvertes-nature/adminSdkConfig 401
[emulators] [2022-10-12T05:43:50.033Z] <<< [apiv2][body] GET https://firebase.googleapis.com/v1beta1/projects/decouvertes-nature/adminSdkConfig {"error":{"code":401,"message":"Request is missing required authentication credential. Expected OAuth 2 access token, login cookie or other valid authentication credential. See https://developers.google.com/identity/sign-in/web/devconsole-project.","status":"UNAUTHENTICATED","details":[{"@type":"type.googleapis.com/google.rpc.ErrorInfo","reason":"CREDENTIALS_MISSING","domain":"googleapis.com","metadata":{"method":"google.firebase.service.v1beta1.FirebaseProjectService.GetAdminSdkConfig","service":"firebase.googleapis.com"}}]}}
[emulators] [2022-10-12T05:43:50.035Z] Failed to get Admin SDK config for decouvertes-nature, falling back to cache Failed to get Admin SDK for Firebase project decouvertes-nature. Please make sure the project exists and your account has permission to access it. {"name":"FirebaseError","children":[],"exit":2,"message":"Failed to get Admin SDK for Firebase project decouvertes-nature. Please make sure the project exists and your account has permission to access it.","original":{"name":"FirebaseError","children":[],"context":{"body":{"error":{"code":401,"message":"Request is missing required authentication credential. Expected OAuth 2 access token, login cookie or other valid authentication credential. See https://developers.google.com/identity/sign-in/web/devconsole-project.","status":"UNAUTHENTICATED","details":[{"@type":"type.googleapis.com/google.rpc.ErrorInfo","reason":"CREDENTIALS_MISSING","domain":"googleapis.com","metadata":{"method":"google.firebase.service.v1beta1.FirebaseProjectService.GetAdminSdkConfig","service":"firebase.googleapis.com"}}]}},"response":{"statusCode":401}},"exit":1,"message":"HTTP Error: 401, Request is missing required authentication credential. Expected OAuth 2 access token, login cookie or other valid authentication credential. See https://developers.google.com/identity/sign-in/web/devconsole-project.","status":401},"status":500}
[emulators] ⚠  functions: Unable to fetch project Admin SDK configuration, Admin SDK behavior in Cloud Functions emulator may be incorrect. {"metadata":{"emulator":{"name":"functions"},"message":"Unable to fetch project Admin SDK configuration, Admin SDK behavior in Cloud Functions emulator may be incorrect."}}
[emulators] i  firestore: Importing data from /home/runner/work/decouvertes-nature/decouvertes-nature/emulator-data/firestore_export/firestore_export.overall_export_metadata {"metadata":{"emulator":{"name":"firestore"},"message":"Importing data from /home/runner/work/decouvertes-nature/decouvertes-nature/emulator-data/firestore_export/firestore_export.overall_export_metadata"}}
[emulators] ⚠  It appears you are running in a CI environment. You can avoid downloading the Firestore Emulator repeatedly by caching the /home/runner/.cache/firebase/emulators directory. 
[emulators] i  firestore: downloading cloud-firestore-emulator-v1.15.1.jar... {"metadata":{"emulator":{"name":"firestore"},"message":"downloading cloud-firestore-emulator-v1.15.1.jar..."}}
[emulators] [2022-10-12T05:43:50.053Z] >>> [apiv2][query] GET https://storage.googleapis.com/firebase-preview-drop/emulator/cloud-firestore-emulator-v1.15.1.jar 
[emulators] [2022-10-12T05:43:50.134Z] <<< [apiv2][status] GET https://storage.googleapis.com/firebase-preview-drop/emulator/cloud-firestore-emulator-v1.15.1.jar 200
[emulators] [2022-10-12T05:43:50.134Z] <<< [apiv2][body] GET https://storage.googleapis.com/firebase-preview-drop/emulator/cloud-firestore-emulator-v1.15.1.jar [stream]
[emulators] 
[app] - Generating browser application bundles (phase: setup)...
[emulators] [2022-10-12T05:43:50.921Z] Ignoring unsupported arg: auto_download {"metadata":{"emulator":{"name":"firestore"},"message":"Ignoring unsupported arg: auto_download"}}
[emulators] [2022-10-12T05:43:50.921Z] Ignoring unsupported arg: single_project_mode_error {"metadata":{"emulator":{"name":"firestore"},"message":"Ignoring unsupported arg: single_project_mode_error"}}
[emulators] [2022-10-12T05:43:50.922Z] Starting Firestore Emulator with command {"binary":"java","args":["-Dgoogle.cloud_firestore.debug_log_level=FINE","-Duser.language=en","-jar","/home/runner/.cache/firebase/emulators/cloud-firestore-emulator-v1.15.1.jar","--host","127.0.0.1","--port",7070,"--websocket_port",9150,"--project_id","decouvertes-nature","--seed_from_export","/home/runner/work/decouvertes-nature/decouvertes-nature/emulator-data/firestore_export/firestore_export.overall_export_metadata","--rules","/home/runner/work/decouvertes-nature/decouvertes-nature/firestore.rules","--single_project_mode",true,"--functions_emulator","127.0.0.1:5001"],"optionalArgs":["port","webchannel_port","host","rules","websocket_port","functions_emulator","seed_from_export","project_id","single_project_mode"],"joinArgs":false} {"metadata":{"emulator":{"name":"firestore"},"message":"Starting Firestore Emulator with command {\"binary\":\"java\",\"args\":[\"-Dgoogle.cloud_firestore.debug_log_level=FINE\",\"-Duser.language=en\",\"-jar\",\"/home/runner/.cache/firebase/emulators/cloud-firestore-emulator-v1.15.1.jar\",\"--host\",\"127.0.0.1\",\"--port\",7070,\"--websocket_port\",9150,\"--project_id\",\"decouvertes-nature\",\"--seed_from_export\",\"/home/runner/work/decouvertes-nature/decouvertes-nature/emulator-data/firestore_export/firestore_export.overall_export_metadata\",\"--rules\",\"/home/runner/work/decouvertes-nature/decouvertes-nature/firestore.rules\",\"--single_project_mode\",true,\"--functions_emulator\",\"127.0.0.1:5001\"],\"optionalArgs\":[\"port\",\"webchannel_port\",\"host\",\"rules\",\"websocket_port\",\"functions_emulator\",\"seed_from_export\",\"project_id\",\"single_project_mode\"],\"joinArgs\":false}"}}
[emulators] i  firestore: Firestore Emulator logging to firestore-debug.log {"metadata":{"emulator":{"name":"firestore"},"message":"Firestore Emulator logging to \u001b[1mfirestore-debug.log\u001b[22m"}}
[emulators] [2022-10-12T05:43:52.935Z] Oct 12, 2022 5:43:52 AM com.google.cloud.datastore.emulator.firestore.websocket.WebSocketServer start
[emulators] INFO: Started WebSocket server on ws://127.0.0.1:9150
[emulators]  {"metadata":{"emulator":{"name":"firestore"},"message":"Oct 12, 2022 5:43:52 AM com.google.cloud.datastore.emulator.firestore.websocket.WebSocketServer start\nINFO: Started WebSocket server on ws://127.0.0.1:9150\n"}}
[emulators] [2022-10-12T05:43:52.967Z] API endpoint: http://127.0.0.1:7070/
[emulators] If you are using a library that supports the FIRESTORE_EMULATOR_HOST environment variable, run:
[emulators] 
[emulators]    export FIRESTORE_EMULATOR_HOST=127.0.0.1:7070
[emulators] 
[emulators] Dev App Server is now running.
[emulators] 
[emulators]  {"metadata":{"emulator":{"name":"firestore"},"message":"API endpoint: [http://127.0.0.1:7070\nIf](http://127.0.0.1:7070/nIf) you are using a library that supports the FIRESTORE_EMULATOR_HOST environment variable, run:\n\n   export FIRESTORE_EMULATOR_HOST=127.0.0.1:7070\n\nDev App Server is now running.\n\n"}}
[emulators] ✔  firestore: Firestore Emulator UI websocket is running on 9150. {"metadata":{"emulator":{"name":"firestore"},"message":"Firestore Emulator UI websocket is running on 9150."}}
[emulators] i  auth: Importing config from /home/runner/work/decouvertes-nature/decouvertes-nature/emulator-data/auth_export/config.json {"metadata":{"emulator":{"name":"auth"},"message":"Importing config from /home/runner/work/decouvertes-nature/decouvertes-nature/emulator-data/auth_export/config.json"}}
[emulators] i  auth: Importing accounts from /home/runner/work/decouvertes-nature/decouvertes-nature/emulator-data/auth_export/accounts.json {"metadata":{"emulator":{"name":"auth"},"message":"Importing accounts from /home/runner/work/decouvertes-nature/decouvertes-nature/emulator-data/auth_export/accounts.json"}}
[emulators] [2022-10-12T05:44:04.511Z] > refreshing access token with scopes: []
[emulators] [2022-10-12T05:44:04.512Z] >>> [apiv2][query] POST https://www.googleapis.com/oauth2/v3/token [none]
[emulators] [2022-10-12T05:44:04.512Z] >>> [apiv2][body] POST https://www.googleapis.com/oauth2/v3/token [omitted]
[emulators] [2022-10-12T05:44:04.555Z] <<< [apiv2][status] POST https://www.googleapis.com/oauth2/v3/token 400
[emulators] [2022-10-12T05:44:04.555Z] <<< [apiv2][body] POST https://www.googleapis.com/oauth2/v3/token [omitted]
[emulators] [2022-10-12T05:44:04.556Z] >>> [apiv2][query] GET https://firebasehosting.googleapis.com/v1beta1/projects/decouvertes-nature/sites 
[emulators] [2022-10-12T05:44:04.751Z] <<< [apiv2][status] GET https://firebasehosting.googleapis.com/v1beta1/projects/decouvertes-nature/sites 401
[emulators] [2022-10-12T05:44:04.751Z] <<< [apiv2][body] GET https://firebasehosting.googleapis.com/v1beta1/projects/decouvertes-nature/sites {"error":{"code":401,"message":"Request is missing required authentication credential. Expected OAuth 2 access token, login cookie or other valid authentication credential. See https://developers.google.com/identity/sign-in/web/devconsole-project.","status":"UNAUTHENTICATED","details":[{"@type":"type.googleapis.com/google.rpc.ErrorInfo","reason":"CREDENTIALS_MISSING","domain":"googleapis.com","metadata":{"service":"firebasehosting.googleapis.com","method":"google.firebase.hosting.v1beta1.MetadataService.ListSites"}}]}}
[emulators] [2022-10-12T05:44:04.752Z] Failed to list hosting sites
[emulators] HTTP Error: 401, Request is missing required authentication credential. Expected OAuth 2 access token, login cookie or other valid authentication credential. See https://developers.google.com/identity/sign-in/web/devconsole-project.
[emulators] [2022-10-12T05:44:04.753Z] > refreshing access token with scopes: []
[emulators] [2022-10-12T05:44:04.754Z] >>> [apiv2][query] POST https://www.googleapis.com/oauth2/v3/token [none]
[emulators] [2022-10-12T05:44:04.754Z] >>> [apiv2][body] POST https://www.googleapis.com/oauth2/v3/token [omitted]
[emulators] [2022-10-12T05:44:04.797Z] <<< [apiv2][status] POST https://www.googleapis.com/oauth2/v3/token 400
[emulators] [2022-10-12T05:44:04.798Z] <<< [apiv2][body] POST https://www.googleapis.com/oauth2/v3/token [omitted]
[emulators] [2022-10-12T05:44:04.798Z] >>> [apiv2][query] GET https://firebase.googleapis.com/v1beta1/projects/decouvertes-nature/webApps/-/config [none]
[emulators] [2022-10-12T05:44:04.900Z] <<< [apiv2][status] GET https://firebase.googleapis.com/v1beta1/projects/decouvertes-nature/webApps/-/config 401
[emulators] [2022-10-12T05:44:04.900Z] <<< [apiv2][body] GET https://firebase.googleapis.com/v1beta1/projects/decouvertes-nature/webApps/-/config {"error":{"code":401,"message":"Request is missing required authentication credential. Expected OAuth 2 access token, login cookie or other valid authentication credential. See https://developers.google.com/identity/sign-in/web/devconsole-project.","status":"UNAUTHENTICATED","details":[{"@type":"type.googleapis.com/google.rpc.ErrorInfo","reason":"CREDENTIALS_MISSING","domain":"googleapis.com","metadata":{"service":"firebase.googleapis.com","method":"google.firebase.service.v1beta1.WebAppService.GetWebAppConfig"}}]}}
[emulators] [2022-10-12T05:44:04.900Z] fetchWebSetup error: FirebaseError: HTTP Error: 401, Request is missing required authentication credential. Expected OAuth 2 access token, login cookie or other valid authentication credential. See https://developers.google.com/identity/sign-in/web/devconsole-project.
[emulators] ⚠  hosting: Could not fetch web app configuration and there is no cached configuration on this machine. Check your internet connection and make sure you are authenticated. To continue, you must call firebase.initializeApp({...}) in your code before using Firebase. 
[emulators] [2022-10-12T05:44:04.901Z] > refreshing access token with scopes: []
[emulators] [2022-10-12T05:44:04.901Z] >>> [apiv2][query] POST https://www.googleapis.com/oauth2/v3/token [none]
[emulators] [2022-10-12T05:44:04.901Z] >>> [apiv2][body] POST https://www.googleapis.com/oauth2/v3/token [omitted]
[emulators] [2022-10-12T05:44:04.957Z] <<< [apiv2][status] POST https://www.googleapis.com/oauth2/v3/token 400
[emulators] [2022-10-12T05:44:04.957Z] <<< [apiv2][body] POST https://www.googleapis.com/oauth2/v3/token [omitted]
[emulators] [2022-10-12T05:44:04.968Z] >>> [apiv2][query] GET https://firebase.googleapis.com/v1beta1/projects/decouvertes-nature [none]
[emulators] [2022-10-12T05:44:05.077Z] <<< [apiv2][status] GET https://firebase.googleapis.com/v1beta1/projects/decouvertes-nature 401
[emulators] [2022-10-12T05:44:05.077Z] <<< [apiv2][body] GET https://firebase.googleapis.com/v1beta1/projects/decouvertes-nature {"error":{"code":401,"message":"Request is missing required authentication credential. Expected OAuth 2 access token, login cookie or other valid authentication credential. See https://developers.google.com/identity/sign-in/web/devconsole-project.","status":"UNAUTHENTICATED","details":[{"@type":"type.googleapis.com/google.rpc.ErrorInfo","reason":"CREDENTIALS_MISSING","domain":"googleapis.com","metadata":{"method":"google.firebase.service.v1beta1.FirebaseProjectService.GetFirebaseProject","service":"firebase.googleapis.com"}}]}}
[emulators] [2022-10-12T05:44:05.077Z] HTTP Error: 401, Request is missing required authentication credential. Expected OAuth 2 access token, login cookie or other valid authentication credential. See https://developers.google.com/identity/sign-in/web/devconsole-project.
[emulators] i  emulators: Shutting down emulators. {"metadata":{"emulator":{"name":"hub"},"message":"Shutting down emulators."}}
[emulators] i  functions: Stopping Functions Emulator {"metadata":{"emulator":{"name":"functions"},"message":"Stopping Functions Emulator"}}
[emulators] i  hosting: Stopping Hosting Emulator {"metadata":{"emulator":{"name":"hosting"},"message":"Stopping Hosting Emulator"}}
[emulators] i  firestore: Stopping Firestore Emulator {"metadata":{"emulator":{"name":"firestore"},"message":"Stopping Firestore Emulator"}}
[emulators] [2022-10-12T05:44:05.137Z] *** shutting down gRPC server since JVM is shutting down {"metadata":{"emulator":{"name":"firestore"},"message":"*** shutting down gRPC server since JVM is shutting down"}}
[emulators] [2022-10-12T05:44:05.138Z] 
[emulators]  {"metadata":{"emulator":{"name":"firestore"},"message":"\n"}}
[emulators] [2022-10-12T05:44:05.194Z] 221012 05:44:05.147:I 1 [main] [com.google.cloud.datastore.emulator.firestore.websocket.WebSocketServer.stop:80] Stopping WebSocket server...
[emulators] *** server shut down
[emulators]  {"metadata":{"emulator":{"name":"firestore"},"message":"221012 05:44:05.147:I 1 [main] [com.google.cloud.datastore.emulator.firestore.websocket.WebSocketServer.stop:80] Stopping WebSocket server...\n*** server shut down\n"}}
[emulators] i  auth: Stopping Authentication Emulator {"metadata":{"emulator":{"name":"auth"},"message":"Stopping Authentication Emulator"}}
[emulators] i  eventarc: Stopping Eventarc Emulator {"metadata":{"emulator":{"name":"eventarc"},"message":"Stopping Eventarc Emulator"}}
[emulators] i  hub: Stopping emulator hub {"metadata":{"emulator":{"name":"hub"},"message":"Stopping emulator hub"}}
[emulators] [2022-10-12T05:44:05.542Z] SyntaxError: Unexpected token u in JSON at position 0
[emulators]     at JSON.parse (<anonymous>)
[emulators]     at Object.start (/home/runner/work/decouvertes-nature/decouvertes-nature/node_modules/firebase-tools/lib/serve/hosting.js:110:33)
[emulators]     at runMicrotasks (<anonymous>)
[emulators]     at processTicksAndRejections (internal/process/task_queues.js:95:5)
[emulators]     at async Function.start (/home/runner/work/decouvertes-nature/decouvertes-nature/node_modules/firebase-tools/lib/emulator/registry.js:18:9)
[emulators]     at async Object.startAll (/home/runner/work/decouvertes-nature/decouvertes-nature/node_modules/firebase-tools/lib/emulator/controller.js:519:9)
[emulators]     at async /home/runner/work/decouvertes-nature/decouvertes-nature/node_modules/firebase-tools/lib/commands/emulators-start.js:32:43
[emulators] 
[emulators] Error: An unexpected error has occurred.
[emulators] firebase emulators:start --debug --import=emulator-data exited with code 2

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Reactions: 4
  • Comments: 17 (7 by maintainers)

Commits related to this issue

Most upvoted comments

@bkendall Just my two cents here: I also use the emulators expecting that they replace the actual production firebase environment, hence the lack of authentication. I understand where you came from, but IMHO, the whole point of using emulators is to be able to fully test an application during development without having to deploy anything, nor impact the production environment and data in any way.

@jnizet 👍 'tis the goal! I think the “does it require authentication to the CLI” has simply been an overlooked question. But not any more! 🙂

Patch release is coming out Soon.

I do believe this should be fixed by #5112, #5115, and #5119. It turns out that dealing with addresses (and managing multiple things talking to each other via these addresses) continues to be hard! Likely a patch going out tomorrow morning with these fixes.

I can confirm this issue. We are running firebase emulators inside docker container and it started failing with 11.14.2.

The container uses it like:

FROM node:16-slim
...
RUN npm install -g firebase-tools && firebase --version

and then ENTRYPOINT starts the application and firebase emulators.

Debug logs shows:

cat firebase-debug.log
[debug] [2022-10-12T10:58:20.105Z] ----------------------------------------------------------------------
[debug] [2022-10-12T10:58:20.107Z] Command:       /usr/local/bin/node /usr/local/bin/firebase emulators:start
[debug] [2022-10-12T10:58:20.107Z] CLI Version:   11.14.2
[debug] [2022-10-12T10:58:20.107Z] Platform:      linux
[debug] [2022-10-12T10:58:20.107Z] Node Version:  v16.17.0
[debug] [2022-10-12T10:58:20.108Z] Time:          Wed Oct 12 2022 10:58:20 GMT+0000 (Coordinated Universal Time)
[debug] [2022-10-12T10:58:20.108Z] ----------------------------------------------------------------------
[debug]
[debug] [2022-10-12T10:58:20.110Z] >>> [apiv2][query] GET https://firebase-public.firebaseio.com/cli.json [none]
[debug] [2022-10-12T10:58:20.199Z] > 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"]
[debug] Failed to authenticate, have you run firebase login?
[warn] ⚠  emulators: You are not currently authenticated so some features may not work correctly. Please run firebase login to authenticate the CLI.
[info] i  emulators: Starting emulators: auth, functions {"metadata":{"emulator":{"name":"hub"},"message":"Starting emulators: auth, functions"}}
[info] i  emulators: Shutting down emulators. {"metadata":{"emulator":{"name":"hub"},"message":"Shutting down emulators."}}
[debug] [2022-10-12T10:58:20.297Z] Error: listen EADDRNOTAVAIL: address not available ::1:4400
    at Server.setupListenHandle [as _listen2] (node:net:1415:21)
    at listenInCluster (node:net:1480:12)
    at doListen (node:net:1629:7)
    at processTicksAndRejections (node:internal/process/task_queues:84:21)
[error]
[error] Error: An unexpected error has occurred.