-
Notifications
You must be signed in to change notification settings - Fork 64
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
firestore emulator on wsl2 does not work, results in ERR_CONNECTION_REFUSED #332
firestore emulator on wsl2 does not work, results in ERR_CONNECTION_REFUSED #332
Comments
Looks like the UI cannot reach Firestore emulator at With that being said, I've found microsoft/WSL#4353 seems to describe the issue you're experiencing. Would you mind updating WSL to version 18970 and disable Fast Startup and see if the issue still reproduces? You may have to install Developer Preview (or whatever they call it) to get the latest version. Once you have it and disable Fast Startup, try both |
Yeah I think you're up to date then. Would you mind digging into it a little bit further? Here are some steps to get you started on debugging connectivity: Try Also, does replacing Just in case, please also attach |
Ok, no problem :) Firestore: Host: localhostFirestore: Host: 0.0.0.0WSL: Firestore: Host: 127.0.0.1wsl Firestore: Host: 172.31.46.235WSL My firebase-debug.log |
Thanks! It looks like we're out of luck here, but it bothers me that Angular and Emulator UI web server somehow work while Firestore does not. Could it be... Node.js v.s. Java? Does Realtime Database work for you then? I'll see if I can get someone from the Firebase team to help troubleshooting this hands-on. But to be honest, I don't think there is much that we can do -- again, mostly likely changes will need to be made in WSL or Java or the Java framework used in Firestore Emulator. |
Thank you very much for helping the community . |
The workaround is here: microsoft/WSL#5706 (comment) |
According to microsoft/WSL#5706 (comment), it seems like the Firestore emulator is listening on IPv6 only when |
@yuchenshi I am doing some debugging on my personal Windows machine (WSL2). Here's what I see from
Now if I set the host to
And finally with
So |
I think you meant But either way, ALL of these show that Firestore Emulator listening to The Emulator UI reads hosts from the config, so it tries to connect via IPv4 when tl;dr We should fix Firestore Emulator to listen on IPv4 when |
Another note for To guard against weird |
I guess I'm a bit late in the conversation, but I have the same problem after i converted my WSL installation to version 2, and haven't been able to find a workaround, is there any fix yet? |
Can someone please summarize these instructions into one post for the workaround? I'm pretty sure I've tried most of the suggestions and nothing thus far is working and I'm guessing different suggestions may interfere with one another. Thus far I have
When I try to access the UI it simply says "Not Found"
Initial Error from the first Script here
|
Hi all, it tooks us quite a while to dig into the issue, but I believe we've found an effective workaround, coming with the next CLI release. |
As of 8.15.1, this should work out of the box and you should be able to just reach the Firestore emulator from outside WSL without any special configuration. Make sure Note that the workaround does disable IPv6, so please make sure Client SDKs, browsers, etc. use IPv4 |
Thank you for the update, I'm glad to see that we are making progress. However, I just updated to 8.15.1, did a fresh install using the emulators codelab and I'm still unable to access the emulators UI. It does not appear fixed to me.
|
@b0ot Thanks for opening a new issue! It seems like you are indeed experiencing a different issue, since the Emulator UI isn't working for you at all, compared to all other folks here who can access the Emulator UI but not Firestore. Let's figure it out together on the new issue and I've posted some tips for troubleshooting there. |
Hello, I've just updated to 8.15.1 and I'm still experiencing this issue on WSL2. I can access the Realtime DB UI, however it displays no data and there are errors in the console.
netstat -sh gives me the following:
|
@6apxat Does |
Hey, just as an update. Installed the latest cli and am still seeing the issue. When I'm running things on my WSL2 machine I can start the emulators just fine, open up the UI, but when I go to I'll attach some screenshots of things to hopefully help? I don't have any host specified in my Happy to provide more info if needed, but don't know what would be useful so just let me know 👍🏾 |
Current Builds are working for me. Build
Ensure updated firebase-tools, start emulator from empty directory (no firebase.json)
Test Firebase Emulator from WSL Ubuntu 20.04
Test from Windows
Also, just to be thorough.
|
Thanks @crwilcox ! It looks like things are working for you properly with Build |
Firestore seems to work OK, Realtime DB does not.
From WSL
From Windows PowerShell
|
@6apxat @IsaiahByDayah Based on microsoft/WSL#6240 (comment), you may have run into a different bug in WSL2 (fixed in 20180, probably only available through Dev / Insider builds right now). As a workaround, try changing {
"emulators": {
"firestore": {
"host": "0.0.0.0",
"port": 8080
},
"database": {
"host": "0.0.0.0",
"port": 9000
},
"ui": {
"enabled": true,
"host": "0.0.0.0"
}
}
} (Note the new lines for And then try again with browsers and curl. Make sure to use EDIT: I know this can be frustrating, but the root cause is on the WSL2 side and we can only provide workarounds. Some of those workarounds can be done in the CLI (e.g. v8.15.1) but others require config changes. Either way, I believe we've done what we could on our side and the best path forward would be participating on the discussion on WSL2 repo here: microsoft/WSL#6240, where experts on WSL2 can help. |
@yuchenshi Unfortunately the provided config didn't help. However, I can confirm that switching to Dev channel in Windows Insider Program and updating to the latest build (20262.1010) resolves this issue without any special configuration. |
A little late to responding but finding the same thing as @6apxat. Switched to the dev channel in WIP and installed latest updates. Currently on Side note: After switching channels and updating I ran into an issue where I couldn't see my |
@6apxat @IsaiahByDayah thank you both for following up, we're all very happy to hear that this is (probably) being fixed on the WSL side. We were running out of ideas! |
Thanks for the pointers everyone. Using dev channel worked for me. I'm not sure if this issue is related, but after a certain amount of time of heavy usage of the realtime db emulator, firestore emulator, and a local react server in wsl2, my connections all die; I cannot access either the react app or the emulator via the UI. The error I get is: If I kill my wsl with This behavior is pretty consistent. Has anyone dealt with this issue? What else can I do to troubleshoot? |
The main discussion is here: firebase/firebase-tools#2334
REQUIRED] Environment info
firebase-tools:8.6.0
Platform: wsl2 with Ubuntu-18.04
[REQUIRED] Test case
Start emulator firebase emulators:start --only firestore
Navigate to http://127.0.0.1:4000/firestore
Try to write in the database or simply check console
[NOT WORKING SOLUTION]
The above solution does not work
Summary:
Firebase emulator is running on wsl2 and we want to open firebase-tools-ui on the host machine.The page is loaded and everything works except the connection to the firestore backend. I use the following configuration:
"emulators": {
"firestore": {
"host": "0.0.0.0", // or host: 'localhost' or host: '127.0.0.1'
"port": "8080"
},
"ui": {
"enabled": true,
"port": 4000
}
}
Workaround:
Change host value to wsl2 ip address.
Screenshots:
The text was updated successfully, but these errors were encountered: