You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Error: TIMEOUT: Port 8080 on localhost was not active within 30000ms #2379
$ firebase emulators:exec --only firestore 'npm test'
i emulators: Starting emulators: firestore
i firestore: Firestore Emulator logging to firestore-debug.log
i emulators: Shutting down emulators.
Error: TIMEOUT: Port 8080 on localhost was not active within 30000ms
Reacted by Allen Calderwood, rubenesque-code, Alexander Cai, Saurabh Thakur, Robin Bedemann, AJ, Ben Winding, Manas Nagelia, Sven Jacobs, Eyoel Defare and 5 more
@dave-k when you say "unchanged project" do you mean this was working before and has since stopped? I haven't seen an error like this on macOS yet, could you try two things:
I don't think anyone on our team is using Node 14 yet, most of us are on 12 or below. Does changing your Node version change anything?
If you change the host for the Firestore emulator to 0.0.0.0 instead of localhost does that change anything? You can set this in firebase.json alongside the port.
Reacted by Niloofar, Cesar Alviz, Serg and Roland Wimmer
The exact version of the jar may vary but you should have a cloud-firestore-emulator-*.jar in that location. You can also pass --port=<number> if you don't want to use 8080.
$ java -jar ~/.cache/firebase/emulators/cloud-firestore-emulator-v1.11.4.jar
API endpoint: http://localhost: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.
I'm having the same timeout issue with Node 17. In case you are using Volta for managing your Node versions, you can use the volta command for running firebase with a specific Node version, for example:
Just FYI same behavior on Windows machine with latest firebase tool
node -v
v18.5.0
firebase --version
11.2.2
Adding "host" : "127.0.0.1" allowed to start emulator, but UI still not working. Message below appears each time i'm trying to reach emulator's UI.
[2022-07-13T12:51:39.938Z] u [FetchError]: request to http://localhost:4400/emulators failed, reason: connect ECONNREFUSED ::1:4400
at ClientRequest.<anonymous> (C:\Users\User\.cache\firebase\emulators\ui-v1.7.0\server.bundle.js:326:16909)
at ClientRequest.emit (node:events:537:28)
at Socket.socketErrorListener (node:_http_client:465:9)
at Socket.emit (node:events:537:28)
at emitErrorNT (node:internal/streams/destroy:151:8)
at emitErrorCloseNT (node:internal/streams/destroy:116:3)
at process.processTicksAndRejections (node:internal/process/task_queues:82:21) {
type: 'system',
errno: 'ECONNREFUSED',
code: 'ECONNREFUSED'
}
{"metadata":{"emulator":{"name":"ui"},"message":"u [FetchError]: request to http://localhost:4400/emulators failed, reason: connect ECONNREFUSED ::1:4400\n at ClientRequest.<anonymous> (C:\\Users\\User\\.cache\\firebase\\emulators\\ui-v1.7.0\\server.bundle.js:326:16909)\n at ClientRequest.emit (node:events:537:28)\n at Socket.socketErrorListener (node:_http_client:465:9)\n at Socket.emit (node:events:537:28)\n at emitErrorNT (node:internal/streams/destroy:151:8)\n at emitErrorCloseNT (node:internal/streams/destroy:116:3)\n at process.processTicksAndRejections (node:internal/process/task_queues:82:21) {\n type: 'system',\n errno: 'ECONNREFUSED',\n code: 'ECONNREFUSED'\n}\n"}}
I faced similar error where it failed to initialise the ports and faced a timeout while checking for it to be active.
I checked the logs and it had the following message.
'auth: Port 5002 is available on 127.0.0.1 but not ::1. This may cause issues with some clients.'
It suggested me to change the port and try. I did and it worked but I am still curious as to why it did not work with 500X ports.
Hi everyone!
I ran into this issue and am unsure how to fix it.
I hope this is the right place to post this.
My Console Output:
i emulators: Starting emulators: firestore
i firestore: Importing data from ...location/firestore/backup/backup/backup_1.overall_export_metadata
⚠ 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.
i firestore: Firestore Emulator logging to firestore-debug.log
i emulators: Shutting down emulators.
i firestore: Stopping Firestore Emulator
i hub: Stopping emulator hub
Error: TIMEOUT: Port 8080 on 127.0.0.1 was not active within 60000ms
I believe the cause to be the size of the dataset (it's about 7GB).
I was trying to find a way to increase the timeout time, but couldn't find it.
Maybe someone here could help me out?
Can't test with <100mb, but with 750mb it's still reproducible. Also, is there a way to increase the timeout? Idc if I have to wait an hour as long as it works. I'm just using the emulator to look at backups and afaik there is no way to "shrink" them by filtering for only the collections I'm interested in.
EDIT:
So apparently, when running without export JAVA_TOOL_OPTIONS="-Xmx4g", it will throw a heap error. When setting the JAVA_TOOL_OPTIONS variable to 4g, it would throw no error and time out. When running the jar directly, it will throw a heap error.
Solution:
Increase to 8g, no more timeout. Probably doesn't scale very well, but for my usecase with 750gb it seems to work...
Is there a step by step known documentation on how to configure firebase emulator to work with either the android/ios emulator or read devices, for me, NONE of the above has ever worked for me. The only thing which works is using the firebase emulators with web (Chrome or Edge) or connecting directly to Firebase live. Those works like charm. But connecting android emulator with firebase emulators or real device with firebase emulator has NEVER worked despite all those snip steps. Is there a known step by step procedure on this, this will be useful. The documentation on Firebase seems to miss a lot, and even the codelabs still do not point exactly what is to be done when, where and how. To me it seems it is all guesswork.
Activity
samtstern commentedon Jun 19, 2020
@dave-k when you say "unchanged project" do you mean this was working before and has since stopped? I haven't seen an error like this on macOS yet, could you try two things:
0.0.0.0instead oflocalhostdoes that change anything? You can set this infirebase.jsonalongside theport.samtstern commentedon Jun 19, 2020
Oh also I'm gonna transfer this issue over to the Firebase CLI repo.
dave-k commentedon Jun 20, 2020
@samtstern Unchanged i.e. no changes made to the tests.
Same Timeout error: [error] Error: TIMEOUT: Port 8080 on 0.0.0.0 was not active within 30000ms
firebase-debug.log
firebase.json
package.json
samtstern commentedon Jun 22, 2020
@dave-k thanks for trying hose things ... I am still pretty stumped on this issue.
Could you try running the Firestore emulator JAR directly and see if it works for you:
The exact version of the
jarmay vary but you should have acloud-firestore-emulator-*.jarin that location. You can also pass--port=<number>if you don't want to use8080.dave-k commentedon Jun 22, 2020
@samtstern
52 remaining items
msrumon commentedon Jan 3, 2022
Confirmed that #2379 (comment) works. I'm on Windows 10 Pro machine with Node.js v17.2.0.
svenjacobs commentedon Apr 13, 2022
I'm having the same timeout issue with Node 17. In case you are using Volta for managing your Node versions, you can use the
voltacommand for runningfirebasewith a specific Node version, for example:ninest commentedon Jun 4, 2022
I found this issue after Googling the error:
#2379 (comment) sent me in the right direction. All I had to do was change
localhostto127.0.0.1in the environment variablesBut my
firebase.jsonis still the same and there seem to be no issues:{ "emulators": { "auth": { "port": 9099 }, "ui": { "enabled": true, "port": 9098 } } }(I am only using Firebase and the emulator for authentication)
ktsin commentedon Jul 13, 2022
Just FYI same behavior on Windows machine with latest firebase tool
Adding
"host" : "127.0.0.1"allowed to start emulator, but UI still not working. Message below appears each time i'm trying to reach emulator's UI.[UPDATE]

Extra strange, but I can reach http://localhost:4400/emulators via browser and see list of configured "nodes".
bkendall commentedon Jul 18, 2022
(internal bug reference: b/172852315)
christhompsongoogle commentedon Oct 13, 2022
Hi everyone, there have been some changes recently to the IP resolution logic - if anyone is still hitting this issue please leave a comment.
VikashFluxon commentedon Oct 21, 2022
I faced similar error where it failed to initialise the ports and faced a timeout while checking for it to be active.
I checked the logs and it had the following message.
'auth: Port 5002 is available on 127.0.0.1 but not ::1. This may cause issues with some clients.'
It suggested me to change the port and try. I did and it worked but I am still curious as to why it did not work with 500X ports.
This started happening after the latest firebase release.
https://github.com/firebase/firebase-tools/releases/tag/v11.14.4
christhompsongoogle commentedon Oct 24, 2022
Hi VikashFluxon, please open a new ticket with the relevant repro case(s) and logs.
mono-sudo2 commentedon Nov 23, 2022
Hi everyone!
I ran into this issue and am unsure how to fix it.
I hope this is the right place to post this.
My Console Output:
i emulators: Starting emulators: firestore
i firestore: Importing data from ...location/firestore/backup/backup/backup_1.overall_export_metadata
⚠ 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.
i firestore: Firestore Emulator logging to firestore-debug.log
i emulators: Shutting down emulators.
i firestore: Stopping Firestore Emulator
i hub: Stopping emulator hub
Error: TIMEOUT: Port 8080 on 127.0.0.1 was not active within 60000ms
My firebase-export-metadata.json:
{ "version": "11.16.1", "firestore": { "version": "1.15.1", "path": "backup/backup", "metadata_file": "backup/backup/backup_1.overall_export_metadata" } }I believe the cause to be the size of the dataset (it's about 7GB).
I was trying to find a way to increase the timeout time, but couldn't find it.
Maybe someone here could help me out?
Thanks in advance!
christhompsongoogle commentedon Nov 23, 2022
Is the problem reproducible with smaller sets of data? < 100MB type of size
ciriousjoker commentedon Jun 14, 2023
Can't test with <100mb, but with 750mb it's still reproducible. Also, is there a way to increase the timeout? Idc if I have to wait an hour as long as it works. I'm just using the emulator to look at backups and afaik there is no way to "shrink" them by filtering for only the collections I'm interested in.
EDIT:
So apparently, when running without
export JAVA_TOOL_OPTIONS="-Xmx4g", it will throw a heap error. When setting the JAVA_TOOL_OPTIONS variable to 4g, it would throw no error and time out. When running the jar directly, it will throw a heap error.Solution:
Increase to 8g, no more timeout. Probably doesn't scale very well, but for my usecase with 750gb it seems to work...
IncognitoGK9 commentedon Sep 14, 2023
Is there a step by step known documentation on how to configure firebase emulator to work with either the android/ios emulator or read devices, for me, NONE of the above has ever worked for me. The only thing which works is using the firebase emulators with web (Chrome or Edge) or connecting directly to Firebase live. Those works like charm. But connecting android emulator with firebase emulators or real device with firebase emulator has NEVER worked despite all those snip steps. Is there a known step by step procedure on this, this will be useful. The documentation on Firebase seems to miss a lot, and even the codelabs still do not point exactly what is to be done when, where and how. To me it seems it is all guesswork.
Bind to ethernet ip address