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

Unable to run emulators:start #5677

Closed
bilalsammour opened this issue Apr 10, 2023 · 8 comments
Closed

Unable to run emulators:start #5677

bilalsammour opened this issue Apr 10, 2023 · 8 comments

Comments

@bilalsammour
Copy link

[REQUIRED] Environment info

11.25.3

firebase-tools:

macOS

Platform:

[REQUIRED] Steps to reproduce

[REQUIRED] Expected behavior

Run firebase emulators:start I get the following error:


i  emulators: Starting emulators: auth, functions, firestore
⚠  functions: The following emulators are not running, calls to these services from the Functions emulator will affect production: database, hosting, pubsub, storage
i  firestore: Firestore Emulator logging to firestore-debug.log
✔  firestore: Firestore Emulator UI websocket is running on 9150.
i  ui: Emulator UI logging to ui-debug.log
⚠  ui: Fatal error occurred: 
   Emulator UI has exited with code: 1, 
   stopping all running emulators
i  ui: Stopping Emulator UI
⚠  ui: Error stopping Emulator UI
i  functions: Stopping Functions Emulator
i  firestore: Stopping Firestore Emulator
i  auth: Stopping Authentication Emulator
i  eventarc: Stopping Eventarc Emulator
i  hub: Stopping emulator hub
i  logging: Stopping Logging Emulator

[REQUIRED] Actual behavior

[2023-04-10T18:47:55.144Z] > 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"]
[2023-04-10T18:47:55.144Z] > authorizing via signed-in user (bilal.sammour@toptal.com)
[2023-04-10T18:47:55.167Z] openjdk version "20" 2023-03-21

[2023-04-10T18:47:55.167Z] OpenJDK Runtime Environment Homebrew (build 20)
OpenJDK 64-Bit Server VM Homebrew (build 20, mixed mode, sharing)

[2023-04-10T18:47:55.169Z] Parsed Java major version: 20
i emulators: Starting emulators: auth, functions, firestore {"metadata":{"emulator":{"name":"hub"},"message":"Starting emulators: auth, functions, firestore"}}
[2023-04-10T18:47:56.636Z] [logging] Logging Emulator only supports listening on one address (127.0.0.1). Not listening on ::1
[2023-04-10T18:47:56.636Z] [auth] Authentication Emulator only supports listening on one address (127.0.0.1). Not listening on ::1
[2023-04-10T18:47:56.636Z] [firestore] Firestore Emulator only supports listening on one address (127.0.0.1). Not listening on ::1
[2023-04-10T18:47:56.636Z] [firestore.websocket] websocket server for firestore only supports listening on one address (127.0.0.1). Not listening on ::1
[2023-04-10T18:47:56.636Z] 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":8080}],"firestore.websocket":[{"address":"127.0.0.1","family":"IPv4","port":9150}]},"metadata":{"message":"assigned listening specs for emulators"}}
[2023-04-10T18:47:56.640Z] [hub] writing locator at /tmp/hub-scorit-46f42.json
[2023-04-10T18:47:57.133Z] [functions] Functions Emulator only supports listening on one address (127.0.0.1). Not listening on ::1
[2023-04-10T18:47:57.134Z] [eventarc] Eventarc Emulator only supports listening on one address (127.0.0.1). Not listening on ::1
[2023-04-10T18:47:57.134Z] 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":8080}],"firestore.websocket":[{"address":"127.0.0.1","family":"IPv4","port":9150}],"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"}}
⚠ functions: The following emulators are not running, calls to these services from the Functions emulator will affect production: database, hosting, 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, hosting, pubsub, storage\u001b[22m"}}
[2023-04-10T18:47:57.136Z] defaultcredentials: writing to file /Users/[USER]/.config/firebase/bilal_sammour_toptal.com_application_default_credentials.json
[2023-04-10T18:47:57.138Z] Setting GAC to /Users/[USER]/.config/firebase/bilal_sammour_toptal.com_application_default_credentials.json {"metadata":{"emulator":{"name":"functions"},"message":"Setting GAC to /Users/[USER]/.config/firebase/bilal_sammour_toptal.com_application_default_credentials.json"}}
[2023-04-10T18:47:57.139Z] >>> [apiv2][query] GET https://firebase.googleapis.com/v1beta1/projects/scorit-46f42/adminSdkConfig [none]
[2023-04-10T18:47:57.553Z] <<< [apiv2][status] GET https://firebase.googleapis.com/v1beta1/projects/scorit-46f42/adminSdkConfig 403
[2023-04-10T18:47:57.554Z] <<< [apiv2][body] GET https://firebase.googleapis.com/v1beta1/projects/scorit-46f42/adminSdkConfig {"error":{"code":403,"message":"The caller does not have permission","status":"PERMISSION_DENIED"}}
[2023-04-10T18:47:57.554Z] Failed to get Admin SDK config for scorit-46f42, falling back to cacheFailed to get Admin SDK for Firebase project scorit-46f42. 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 scorit-46f42. Please make sure the project exists and your account has permission to access it.","original":{"name":"FirebaseError","children":[],"context":{"body":{"error":{"code":403,"message":"The caller does not have permission","status":"PERMISSION_DENIED"}},"response":{"statusCode":403}},"exit":1,"message":"HTTP Error: 403, The caller does not have permission","status":403},"status":500}
[2023-04-10T18:47:57.560Z] Ignoring unsupported arg: auto_download {"metadata":{"emulator":{"name":"firestore"},"message":"Ignoring unsupported arg: auto_download"}}
[2023-04-10T18:47:57.560Z] Ignoring unsupported arg: single_project_mode_error {"metadata":{"emulator":{"name":"firestore"},"message":"Ignoring unsupported arg: single_project_mode_error"}}
[2023-04-10T18:47:57.560Z] Starting Firestore Emulator with command {"binary":"java","args":["-Dgoogle.cloud_firestore.debug_log_level=FINE","-Duser.language=en","-jar","/Users/[USER]/.cache/firebase/emulators/cloud-firestore-emulator-v1.16.2.jar","--host","127.0.0.1","--port",8080,"--websocket_port",9150,"--project_id","scorit-46f42","--rules","/Users/[USER]/Professional/Development/Projects/Firebase/scorit_backend/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","/Users/[USER]/.cache/firebase/emulators/cloud-firestore-emulator-v1.16.2.jar","--host","127.0.0.1","--port",8080,"--websocket_port",9150,"--project_id","scorit-46f42","--rules","/Users/[USER]/Professional/Development/Projects/Firebase/scorit_backend/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}"}}
i firestore: Firestore Emulator logging to firestore-debug.log {"metadata":{"emulator":{"name":"firestore"},"message":"Firestore Emulator logging to \u001b[1mfirestore-debug.log\u001b[22m"}}
[2023-04-10T18:47:58.044Z] Apr 10, 2023 9:47:58 PM com.google.cloud.datastore.emulator.firestore.websocket.WebSocketServer start
INFO: Started WebSocket server on ws://127.0.0.1:9150
{"metadata":{"emulator":{"name":"firestore"},"message":"Apr 10, 2023 9:47:58 PM com.google.cloud.datastore.emulator.firestore.websocket.WebSocketServer start\nINFO: Started WebSocket server on ws://127.0.0.1:9150\n"}}
[2023-04-10T18:47:58.055Z] API endpoint: http://127.0.0.1:8080
{"metadata":{"emulator":{"name":"firestore"},"message":"API endpoint: http://127.0.0.1:8080\n"}}
[2023-04-10T18:47:58.055Z] If you are using a library that supports the FIRESTORE_EMULATOR_HOST environment variable, run:

export FIRESTORE_EMULATOR_HOST=127.0.0.1:8080

Dev App Server is now running.

{"metadata":{"emulator":{"name":"firestore"},"message":"If you are using a library that supports the FIRESTORE_EMULATOR_HOST environment variable, run:\n\n export FIRESTORE_EMULATOR_HOST=127.0.0.1:8080\n\nDev App Server is now running.\n\n"}}
✔ firestore: Firestore Emulator UI websocket is running on 9150. {"metadata":{"emulator":{"name":"firestore"},"message":"Firestore Emulator UI websocket is running on 9150."}}
[2023-04-10T18:48:01.151Z] Ignoring unsupported arg: auto_download {"metadata":{"emulator":{"name":"ui"},"message":"Ignoring unsupported arg: auto_download"}}
[2023-04-10T18:48:01.151Z] Ignoring unsupported arg: port {"metadata":{"emulator":{"name":"ui"},"message":"Ignoring unsupported arg: port"}}
[2023-04-10T18:48:01.151Z] Starting Emulator UI with command {"binary":"node","args":["/Users/[USER]/.cache/firebase/emulators/ui-v1.11.5/server/server.js"],"optionalArgs":[],"joinArgs":false} {"metadata":{"emulator":{"name":"ui"},"message":"Starting Emulator UI with command {"binary":"node","args":["/Users/[USER]/.cache/firebase/emulators/ui-v1.11.5/server/server.js"],"optionalArgs":[],"joinArgs":false}"}}
i ui: Emulator UI logging to ui-debug.log {"metadata":{"emulator":{"name":"ui"},"message":"Emulator UI logging to \u001b[1mui-debug.log\u001b[22m"}}
[2023-04-10T18:48:01.197Z] /Users/[USER]/.cache/firebase/emulators/ui-v1.11.5/server/server.js:569
re"use strict";
^^^^^^^^^^^^

SyntaxError: Unexpected string
at internalCompileFunction (node:internal/vm:73:18)
at wrapSafe (node:internal/modules/cjs/loader:1195:20)
at Module._compile (node:internal/modules/cjs/loader:1239:27)
at Module._extensions..js (node:internal/modules/cjs/loader:1329:10)
at Module.load (node:internal/modules/cjs/loader:1133:32)
at Module._load (node:internal/modules/cjs/loader:972:12)
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:83:12)
at node:internal/main/run_main_module:23:47

Node.js v19.8.1
{"metadata":{"emulator":{"name":"ui"},"message":"/Users/[USER]/.cache/firebase/emulators/ui-v1.11.5/server/server.js:569\n re"use strict";\n ^^^^^^^^^^^^\n\nSyntaxError: Unexpected string\n at internalCompileFunction (node:internal/vm:73:18)\n at wrapSafe (node:internal/modules/cjs/loader:1195:20)\n at Module._compile (node:internal/modules/cjs/loader:1239:27)\n at Module._extensions..js (node:internal/modules/cjs/loader:1329:10)\n at Module.load (node:internal/modules/cjs/loader:1133:32)\n at Module._load (node:internal/modules/cjs/loader:972:12)\n at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:83:12)\n at node:internal/main/run_main_module:23:47\n\nNode.js v19.8.1\n"}}
⚠ ui: Fatal error occurred:
Emulator UI has exited with code: 1,
stopping all running emulators {"metadata":{"emulator":{"name":"ui"},"message":"Fatal error occurred: \n Emulator UI has exited with code: 1, \n stopping all running emulators"}}
i ui: Stopping Emulator UI {"metadata":{"emulator":{"name":"ui"},"message":"Stopping Emulator UI"}}
[2023-04-10T18:48:05.202Z] Emulator UI: Unable to terminate process (PID=2065) {"metadata":{"emulator":{"name":"ui"},"message":"Emulator UI: Unable to terminate process (PID=2065)"}}
⚠ ui: Error stopping Emulator UI {"metadata":{"emulator":{"name":"ui"},"message":"Error stopping Emulator UI"}}
i functions: Stopping Functions Emulator {"metadata":{"emulator":{"name":"functions"},"message":"Stopping Functions Emulator"}}
i firestore: Stopping Firestore Emulator {"metadata":{"emulator":{"name":"firestore"},"message":"Stopping Firestore Emulator"}}
[2023-04-10T18:48:05.205Z] *** shutting down gRPC server since JVM is shutting down
{"metadata":{"emulator":{"name":"firestore"},"message":"*** shutting down gRPC server since JVM is shutting down\n"}}
[2023-04-10T18:48:05.208Z] *** server shut down
{"metadata":{"emulator":{"name":"firestore"},"message":"*** server shut down\n"}}
i auth: Stopping Authentication Emulator {"metadata":{"emulator":{"name":"auth"},"message":"Stopping Authentication Emulator"}}
i eventarc: Stopping Eventarc Emulator {"metadata":{"emulator":{"name":"eventarc"},"message":"Stopping Eventarc Emulator"}}
i hub: Stopping emulator hub {"metadata":{"emulator":{"name":"hub"},"message":"Stopping emulator hub"}}
i logging: Stopping Logging Emulator {"metadata":{"emulator":{"name":"logging"},"message":"Stopping Logging Emulator"}}

Having trouble? Try firebase [command] --help

@google-oss-bot
Copy link
Contributor

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

@aalej
Copy link
Contributor

aalej commented Apr 10, 2023

Hi @bilalsammour, thanks for reaching out to us. I noticed that you are using Node.js v19.8.1 and that the issue you described is similar to #5608. Since odd versions of Node are experimental, I would recommend using an even version of Node such as v18.x.x.

After switching to an even version of Node, delete the contents of .cache/firebase/emulators then run firebase emulators:start to re-install the emulators. If you are still encountering any issues starting the emulator, feel free to reopen the ticket.

@aalej aalej closed this as completed Apr 10, 2023
@bilalsammour
Copy link
Author

That was helpful, thank you @aalej

@baughmann
Copy link

baughmann commented Apr 15, 2023

@aalej

This is now happening on Linux with Node 18 as well:

Firebase version

firebase --version
11.27.0

Node JS version

node --version
v18.16.0

Linux kernel version

uname -r
6.2.10-300.fc38.x86_64

NVM version (Node Version Manager)

nvm --version
0.39.3

In an attempt to fix this, I changed the engines to 18 in my functions/package.json file. No dice.

The only error I'm getting after running firebase emulators:start is in ui-debug.log

.cache/firebase/emulators/ui-v1.11.5/server/server.js:569
        re"use strict";
          ^^^^^^^^^^^^

SyntaxError: Unexpected string

@mirao
Copy link

mirao commented Apr 17, 2023

@baughmann
Yes, the same issue in my environment with Ubuntu 22.04 and NodeJS 18.16.
Note that 18.15 is not affected.

@onatyy
Copy link

onatyy commented Apr 18, 2023

I have the same issue with NodeJS v18.16.0

@iSuslov
Copy link

iSuslov commented Apr 19, 2023

joehan added a commit that referenced this issue May 2, 2023
* Replace dependency on broken node-unzipper with native zlib

Fixes:
#5614
#5677
firebase/firebase-tools-ui#939
firebase/firebase-tools-ui#940

* remove unused broken.zip fixture

* add changelog record

* fix timing out test

* fix use operating system file delimiter

* addressing code review comments from @joehan

* better support for Windows path separators

TODO: remove console logs after @christhompsongoogle tries it out.

* addressing code review comments from @joehan

* Add support for zip files that use signed data descriptors instead of a full entry header

* Formats, fixes uneeded async/await

* Remove unnecessary handling for empty files

* Remove console.log

---------

Co-authored-by: joehan <joehanley@google.com>
ProfHercules pushed a commit to ProfHercules/firebase-tools that referenced this issue May 5, 2023
…#5714)

* Replace dependency on broken node-unzipper with native zlib

Fixes:
firebase#5614
firebase#5677
firebase/firebase-tools-ui#939
firebase/firebase-tools-ui#940

* remove unused broken.zip fixture

* add changelog record

* fix timing out test

* fix use operating system file delimiter

* addressing code review comments from @joehan

* better support for Windows path separators

TODO: remove console logs after @christhompsongoogle tries it out.

* addressing code review comments from @joehan

* Add support for zip files that use signed data descriptors instead of a full entry header

* Formats, fixes uneeded async/await

* Remove unnecessary handling for empty files

* Remove console.log

---------

Co-authored-by: joehan <joehanley@google.com>
@christhompsongoogle
Copy link
Contributor

The fix for this was released in v11.30.0, see here: https://github.com/firebase/firebase-tools/releases/tag/v11.30.0

Please upgrade past this to resolve the issue and let me know if you're still encountering any issues.

tonyjhuang pushed a commit that referenced this issue May 22, 2023
* Replace dependency on broken node-unzipper with native zlib

Fixes:
#5614
#5677
firebase/firebase-tools-ui#939
firebase/firebase-tools-ui#940

* remove unused broken.zip fixture

* add changelog record

* fix timing out test

* fix use operating system file delimiter

* addressing code review comments from @joehan

* better support for Windows path separators

TODO: remove console logs after @christhompsongoogle tries it out.

* addressing code review comments from @joehan

* Add support for zip files that use signed data descriptors instead of a full entry header

* Formats, fixes uneeded async/await

* Remove unnecessary handling for empty files

* Remove console.log

---------

Co-authored-by: joehan <joehanley@google.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

8 participants