OpenHands icon indicating copy to clipboard operation
OpenHands copied to clipboard

[Bug]: Windows ports not available

Open SergiuDeveloper opened this issue 6 months ago • 2 comments

Is there an existing issue for the same bug? (If one exists, thumbs up or comment on the issue instead).

  • [x] I have checked the existing issues.

Describe the bug and reproduction steps

Sometimes, when creating a new conversation, I get the following error:

Internal Server Error ("ports are not available: exposing port TCP 0.0.0.0:50281 -> 127.0.0.1:0: listen tcp4 0.0.0.0:50281: bind: An attempt was made to access a socket in a way forbidden by its access permissions.")

OpenHands Installation

Docker command in README

OpenHands Version

0.44

Operating System

WSL on Windows

Logs, Errors, Screenshots, and Additional Context

Internal Server Error ("ports are not available: exposing port TCP 0.0.0.0:50281 -> 127.0.0.1:0: listen tcp4 0.0.0.0:50281: bind: An attempt was made to access a socket in a way forbidden by its access permissions.")

SergiuDeveloper avatar Jun 17 '25 23:06 SergiuDeveloper

Unfortunately, this is a known Docker issue on Windows.

As a workaround, you can run the following PowerShell command (as Administrator) to reset the NAT service and release the ports: Restart-Service -Name "winnat"

llamantino avatar Jun 17 '25 23:06 llamantino

Thanks! This should be added in the docs.

SergiuDeveloper avatar Jun 18 '25 19:06 SergiuDeveloper

I added an item to the troubleshooting for this but as llamantino mentions, I think there should be code changes around this to make it better as well so let's leave this open.

mamoodi avatar Jul 03 '25 13:07 mamoodi

This issue is stale because it has been open for 30 days with no activity. Remove stale label or comment or this will be closed in 7 days.

github-actions[bot] avatar Aug 03 '25 02:08 github-actions[bot]