-
Notifications
You must be signed in to change notification settings - Fork 959
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
ECONNREFUSED ::1:4400 error even though firestore port and host are explicitly specified #4741
Comments
Alright, so this is known, but hard to address fully. In short, it has to do with how DNS on a machine is being resolved in Node. Most of the emulators bind to the ipv4 addresses, but if a process resolves @yuchenshi has been looking into addressing this in a couple places around the emulators. Working on addressing this, but it's been difficult. |
Same issue here on latest version, downgrade to 10.9.2 solved the problem. This is the error message of
I feel like if there was a option to change the Hub port it might resolve this as I've seen the same error before when using a "blocked" port, and it was solved by using another. |
+1 What is the preferred method to downgrade firebase globally? |
|
Whoops, wrong issue -- sorry for the confusion. We've fixed some other issues related to Emulator UI, not Emulator hub (used in |
While we work on this, I think a better workaround than downgrading Firebase CLI is specifying the hub address explicitly using IPv4: e.g. change the command:
Or in configuration: env = await firebaseTesting.initializeTestEnvironment({
projectId: "demo-project",
/* firestore and other emulators omitted, new hub options below */
hub: {
host: "127.0.0.1",
port: 4400,
},
}); |
👏🦾❤️ Upgrading to 11.3.0 fixed this for me! Thanks, @yuchenshi ! |
setting the Hub host resolved the ECONNREFUSED error for me however, now every test I run storage tests... all the test time out using Mocha at 20seconds. If I set the storage configuration with host: "127.0.0.1", port:9199, I can get tests with getDownloadURL() to complete appropriately. However, tests with uploadBytes still timeout. In fact I am not able to get any upload statements to work with the emulators! |
@kris-kolve-jumio Would you mind opening a different issue for the storage emulator timeout? |
|
+1 |
Hi all, we've updated how the emulator listens on ports in v11.14.2 and we believe it now should work for most cases (including the OP's repro, quickstart-testing, emulators-codelab, etc.) without any need of workarounds. Please let us know if this isn't the case for you even after the upgrade. To provide more details, we've changed the Emulator Hub to listen on both IPv4 and IPv6 address by default (if possible) (#5088), and the discovery now returns |
hi @yuchenshi - with this config:
we get:
and adding this block:
gives us a new failure:
|
@modosc Thanks for the follow-up. Would it be possible to get the full |
@modosc I have a guess on what's going on here -- the error may be happening with our new port detection logic and somehow IPv6 isn't available in your Docker network. But we'd still appreciate full logs to confirm this. Also, if that's the case, I think you can work around this by adding
|
It is a IPv6 issue within the Docker container for us too @yuchenshi If someone is emulating functions as well, you have to define eventarc's host as well to make it work again:
The full debug log:
|
i can confirm that adding both of these blocks fixes the issue for us:
i can also confirm the exact same log output as above. running docker on mac and there's no ipv6 support. |
|
@yuchenshi I'm still encountering this issue in v11.15.0 in Docker. Adding the |
The same issue happens inside a github action. Are there any fixes for that? Specifying the host to PS: Downgrading to node 16 fixed the issue. |
TRY THIS. So, I added node runtime options in my |
Same issue here, node 18.15.0 |
For me the problem was fixed by changing From this: testEnv = await initializeTestEnvironment({
projectId: PROJECT_ID,
firestore: {
rules: fs.readFileSync("firestore.rules", "utf8"),
host: "localhost",
port: 8080,
},
}); to this: testEnv = await initializeTestEnvironment({
projectId: PROJECT_ID,
firestore: {
rules: fs.readFileSync("firestore.rules", "utf8"),
host: "127.0.0.1",
port: 8080,
},
}); |
solution reference firebase/firebase-tools#4741
@gkawin thank you! It worked on node18 by adding |
I have the same issue but is when I use the firestore emulator with the sdk admin in a NextJS app on Mac and adding this to my |
[REQUIRED] Environment info
firebase-tools: 11.2.2
Platform: macOS
[REQUIRED] Test case
[REQUIRED] Steps to reproduce
Run
yarn run test
[REQUIRED] Expected behavior
Expected to exit with code 0
[REQUIRED] Actual behavior
Fails with
FetchError: request to http://localhost:4400/emulators failed, reason: connect ECONNREFUSED ::1:4400
This error was introduced in release 11.0.0 and is not present in 10.9.2
Seems like it still tries to find emulators hub, even though host and port for firestore are explicitly specified.
Same error can be observed if a flag
FIRESTORE_EMULATOR_HOST=127.0.0.1:8080
is passed.Currently I solved this error in my project by locking firebase-tools to 10.9.2
The text was updated successfully, but these errors were encountered: