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

Request to http://localhost:port #6162

Closed
chapov opened this issue Oct 28, 2020 · 8 comments
Closed

Request to http://localhost:port #6162

chapov opened this issue Oct 28, 2020 · 8 comments
Labels

Comments

@chapov
Copy link

chapov commented Oct 28, 2020

Win32NT 10.0.19041.0 Microsoft Windows NT 10.0.19041.0
wsl2
Ubuntu 18.04
Linux version 4.19.128-microsoft-standard (oe-user@oe-host) (gcc version 8.2.0 (GCC)) #1 SMP Tue Jun 23 12:58:10 UTC 2020

i run in wsl - docker and app nodejs.
all in good, port 5508 is listening, http://localhost:5508 is open:
image

I am saving the js script. nodemon restart my nodejs application.

image

port 5508 is down! http://localhost:5508 not connected.
netstat -aon with cmd shows that the port is not listening

Started yesterday

why? :)

@chapov
Copy link
Author

chapov commented Oct 28, 2020

it turns out there are no correlations between saving scripts with restarting the application.
wsl just stops responding to the localhost anywhere.

@lllama
Copy link

lllama commented Nov 7, 2020

I am also seeing this same behaviour - I used to be able to connect to 127.0.0.1:4200 for my app but this has just stopped working.

I believe this started after installing KB4580364 and KB4580419

@lllama
Copy link

lllama commented Nov 8, 2020

@chapov - I was able to fix this on my machine by removing WSL, doing a couple of reboots, then enabling it again. Not ideal but it's working again so 🤷

@sepbot
Copy link

sepbot commented Nov 21, 2020

You don't need to remove WSL, it stops working every now and then after reboots, rebooting again fixes it. There must be some race condition at the start.

@lllama
Copy link

lllama commented Nov 21, 2020

Nope. Multiple reboots didn't fix this for me. Only that worked for me was removing WSL and adding it back. YMMV, obviously.

@Lite5h4dow
Copy link

disable fast boot. i had this exact issue, just disable fast startup from the control panel => power options

@csMACnz
Copy link

csMACnz commented Feb 23, 2021

I want to cross-post this comment here as well:

I've been around in circles with this and haven't found a single suggestion that helped so thought I should post here what did eventually work.

My symptom was that after many requests to a port mapped through docker (wsl2 mode) traffic would just stop with connection refused, closed, reset etc errors on the ipv6 resolved local host (::1) wsl --shutdown reset the problem until more request load retriggers it again, reliably. 127.0.0.1:49153 keeps working while localhost:49153 hangs.

I ran netstat -ano | findstr :49153 (49153 being my mapped port)
I noticed there were 3 LISTENING

  TCP    0.0.0.0:49153          0.0.0.0:0              LISTENING       20304
  TCP    [::]:49153             [::]:0                 LISTENING       20304
  TCP    [::1]:49153            [::]:0                 LISTENING       22920

20304 is Docker Desktop Backend which is what is meant to be listening, and why ipv4 works.
22920 was one of the wslhost.exe (Microsoft Windows Subsystem for Linux Background Host) processes running - there are a couple.

I killed the offending process matching the id and the problem was fixed. I couldn't reproduce until i shutdown (or restart) the machine.

It is possible this is related to the Fast Startup issue, but i have this disabled according to the UI #6162.

hope that helps someone stuck on this, maybe even inspire someone on where to look for a permanent fix even?

Copy link
Contributor

This issue has been automatically closed since it has not had any activity for the past year. If you're still experiencing this issue please re-file this as a new issue or feature request.

Thank you!

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

No branches or pull requests

6 participants