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

firebase emulators:start not working on WLS on Windows 10 #1458

Closed
FezVrasta opened this issue Jul 2, 2019 · 15 comments · Fixed by #1699
Closed

firebase emulators:start not working on WLS on Windows 10 #1458

FezVrasta opened this issue Jul 2, 2019 · 15 comments · Fixed by #1699
Assignees

Comments

@FezVrasta
Copy link

FezVrasta commented Jul 2, 2019

[REQUIRED] Environment info

firebase-tools:
7.0.2

Platform:
WSL on Windows 10

[REQUIRED] Test case

An empty project with the auto-generated Cloud Functions boilerplate is enough to reproduce it.

[REQUIRED] Steps to reproduce

Run firebase emulators:start

[REQUIRED] Expected behavior

I should be able to use the local environment.

[REQUIRED] Actual behavior

It starts the local server at port 5001, if I open it in Chrome I get a { "status": "alive" } response, but after 30 seconds it shuts down by itself because of a "timeout".

✔  functions: Emulator started at http://localhost:5001
i  Shutting down emulators.
i  Stopping functions emulator

Error: TIMEOUT: Port 5001 was not active within 30000ms

The project works fine when deployed to Google Cloud. I tried to run it with sudo also.

If I visit the demo "hello world" endpoint I get an error saying the endpoint is not available.

I tried to run it with --debug but no additional information is displayed during the shutdown/timeout

@samtstern
Copy link
Contributor

Reading this page:
https://docs.microsoft.com/en-us/windows/wsl/wsl2-ux-changes

It says:

In initial builds of the WSL 2 preview you will need to access network applications using an IP address and not using localhost

Then it goes on to say:

In the initial builds of the WSL 2 preview, you will need to access any Linux server from Windows using the IP address of your Linux distro, and any Windows server from Linux using the IP address of your host machine. This is something that is temporary, and very high on our priority list to fix.

So this is something that is new in WSL2 but also going to change before WSL2 is finalized, meaning that I don't think we should do anything within firebase-tools to accommodate this for now.

Thanks for reporting this @FezVrasta !

@FezVrasta
Copy link
Author

I'm not using WSL 2 tho, AFAIK I'm using version 1

@samtstern samtstern reopened this Jul 2, 2019
@samtstern
Copy link
Contributor

@FezVrasta oh that's interesting, thanks for sharing! Assigning to @abeisgoat since he has a Windows setup and I don't.

@amkoehler
Copy link

Hi, any update on this? Running into the same problem.

@samtstern
Copy link
Contributor

cc @Karasuni

@Karasuni
Copy link
Contributor

Karasuni commented Jul 17, 2019

I'm seeing this issue on Windows 10 Build 18362 running WSL 1, not WSL 2.

Also the issue I reported is with firebase-tools 7.1.0 but does not occur with 7.0.2.

@RoryDungan
Copy link

I've reproduced the same issue with Win 10 1903 (build 18362.239), WSL 1, firebase-tools 7.1.0 and 7.1.1. For now downgrading to 7.0.2 is fine as a workaround.

@samtstern
Copy link
Contributor

samtstern commented Jul 23, 2019 via email

@samtstern
Copy link
Contributor

I was able to reproduce this bug at home on my personal machine (we don't have Windows at work) so it's definitely real! I didn't have time to start debugging but I will try that next.

@yegorius
Copy link

Just a clue.
Environment:
firebase-tools 7.1.0 or 7.2.0
Arch Linux
> node_modules/.bin/firebase serve --only functions terminates after timeout
> $HOME/.npm/bin/firebase serve --only functions doesn't terminate

So it only terminates if firebase-tools are installed locally. My npm config get prefix is $HOME/.npm so if I do npm i -g firebase-tools everything works ok, but it doesn't work from local node_modules in my project directory.

@simonesestito
Copy link

simonesestito commented Sep 2, 2019

Issue persists with firebase-tools 7.3.0 on WSL 1.

Error: TIMEOUT: Port 5000 was not active within 30000ms
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! functions@ prod: `firebase serve --only functions`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the functions@ prod script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/simone/.npm/_logs/2019-09-02T09_24_45_392Z-debug.log

WSL version: 1
firebase --version: 7.3.0
Node.js version: 12.9.0
NPM version: 6.11.2
Windows 10 Pro 1903 build 18362.295 (Stable)
Linux 4.4.0-18362-Microsoft

@amkoehler
Copy link

Can confirm the issue persists on 7.4.0 as well.

@barnu5
Copy link

barnu5 commented Oct 2, 2019

Emulator is unusable on WSL due to this issue.

Doesn't work on actual Windows either! firebase/functions-samples#572

@samtstern
Copy link
Contributor

Ok version 7.5.0 should work well for all you Windows Linux Subsystem users out there!

@amkoehler
Copy link

Thanks Sam. Working great for me now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

9 participants