[GH-ISSUE #12206] Port Collison Bug (Windows) #70180

Open
opened 2026-05-04 20:36:57 -05:00 by GiteaMirror · 5 comments
Owner

Originally created by @lnorton89 on GitHub (Sep 7, 2025).
Original GitHub issue: https://github.com/ollama/ollama/issues/12206

What is the issue?

Can we please fix the bug that when ollama starts if something is taking up its port ollama just...sits there....does nothing. No indicator of an error, no crash, nothing. The windows API docs for network interfaces is very well documented I implore you to take a look at them. Either support windows and give us some quality of life bug fixes or don't support windows.

https://learn.microsoft.com/en-us/windows/win32/api/winsock2/nf-winsock2-socket

Relevant log output

server.log

Error: listen tcp 127.0.0.1:11434: bind: An attempt was made to access a socket in a way forbidden by its access permissions.

app.log

time=2025-09-06T23:08:36.348-05:00 level=INFO source=app.go:214 msg="initialized tools registry" tool_count=0
time=2025-09-06T23:08:36.373-05:00 level=INFO source=app.go:229 msg="starting ollama server"
time=2025-09-06T23:08:36.525-05:00 level=INFO source=app.go:257 msg="starting ui server" port=7216
time=2025-09-06T23:08:37.442-05:00 level=ERROR source=server.go:177 msg="ollama exited" err="exit status 1"
time=2025-09-06T23:08:38.504-05:00 level=ERROR source=server.go:177 msg="ollama exited" err="exit status 1"
time=2025-09-06T23:08:39.526-05:00 level=INFO source=updater.go:252 msg="beginning update checker" interval=1h0m0s
time=2025-09-06T23:08:39.572-05:00 level=ERROR source=server.go:177 msg="ollama exited" err="exit status 1"
time=2025-09-06T23:08:39.650-05:00 level=INFO source=updater.go:127 msg="New update available at https://github.com/ollama/ollama/releases/download/v0.11.10/OllamaSetup.exe"
time=2025-09-06T23:08:40.635-05:00 level=ERROR source=server.go:177 msg="ollama exited" err="exit status 1"

OS

Windows

GPU

Nvidia

CPU

Intel

Ollama version

No response

Originally created by @lnorton89 on GitHub (Sep 7, 2025). Original GitHub issue: https://github.com/ollama/ollama/issues/12206 ### What is the issue? Can we *please* fix the bug that when ollama starts if something is taking up its port ollama just...sits there....does nothing. No indicator of an error, no crash, nothing. The windows API docs for network interfaces is very well documented I implore you to take a look at them. Either support windows and give us some quality of life bug fixes or don't support windows. https://learn.microsoft.com/en-us/windows/win32/api/winsock2/nf-winsock2-socket ### Relevant log output `server.log` ```shell Error: listen tcp 127.0.0.1:11434: bind: An attempt was made to access a socket in a way forbidden by its access permissions. ``` `app.log` ```shell time=2025-09-06T23:08:36.348-05:00 level=INFO source=app.go:214 msg="initialized tools registry" tool_count=0 time=2025-09-06T23:08:36.373-05:00 level=INFO source=app.go:229 msg="starting ollama server" time=2025-09-06T23:08:36.525-05:00 level=INFO source=app.go:257 msg="starting ui server" port=7216 time=2025-09-06T23:08:37.442-05:00 level=ERROR source=server.go:177 msg="ollama exited" err="exit status 1" time=2025-09-06T23:08:38.504-05:00 level=ERROR source=server.go:177 msg="ollama exited" err="exit status 1" time=2025-09-06T23:08:39.526-05:00 level=INFO source=updater.go:252 msg="beginning update checker" interval=1h0m0s time=2025-09-06T23:08:39.572-05:00 level=ERROR source=server.go:177 msg="ollama exited" err="exit status 1" time=2025-09-06T23:08:39.650-05:00 level=INFO source=updater.go:127 msg="New update available at https://github.com/ollama/ollama/releases/download/v0.11.10/OllamaSetup.exe" time=2025-09-06T23:08:40.635-05:00 level=ERROR source=server.go:177 msg="ollama exited" err="exit status 1" ``` ### OS Windows ### GPU Nvidia ### CPU Intel ### Ollama version _No response_
GiteaMirror added the appbug labels 2026-05-04 20:36:57 -05:00
Author
Owner

@lnorton89 commented on GitHub (Sep 7, 2025):

For anyone else that doesn't want to learn how to nuke what's on port 11434 and just wants to clear whatever process is reserving it:

powershell

Get-NetTCPConnection -LocalPort 11434 | ForEach-Object { Stop-Process -Id $_.OwningProcess -Force }

Seems pretty trivial to just handle this error that is already in server.log plain as day and say hey guy, either kill whats on 11434 or choose a different port but here we are.

<!-- gh-comment-id:3263455956 --> @lnorton89 commented on GitHub (Sep 7, 2025): For anyone else that doesn't want to learn how to nuke what's on port 11434 and just wants to clear whatever process is reserving it: `powershell` ```powershell Get-NetTCPConnection -LocalPort 11434 | ForEach-Object { Stop-Process -Id $_.OwningProcess -Force } ``` Seems pretty trivial to just handle this error that is already in `server.log` plain as day and say hey guy, either kill whats on 11434 or *choose a different port* but here we are.
Author
Owner

@MrMxyzptlk commented on GitHub (Sep 11, 2025):

For anyone else that doesn't want to learn how to nuke what's on port 11434 and just wants to clear whatever process is reserving it:

powershell

Get-NetTCPConnection -LocalPort 11434 | ForEach-Object { Stop-Process -Id $_.OwningProcess -Force }
Seems pretty trivial to just handle this error that is already in server.log plain as day and say hey guy, either kill whats on 11434 or choose a different port but here we are.

The only problem is NOTHING is using that port. netstat or your PS command ever find 11434 is being used.

<!-- gh-comment-id:3281207142 --> @MrMxyzptlk commented on GitHub (Sep 11, 2025): > For anyone else that doesn't want to learn how to nuke what's on port 11434 and just wants to clear whatever process is reserving it: > > `powershell` > > Get-NetTCPConnection -LocalPort 11434 | ForEach-Object { Stop-Process -Id $_.OwningProcess -Force } > Seems pretty trivial to just handle this error that is already in `server.log` plain as day and say hey guy, either kill whats on 11434 or _choose a different port_ but here we are. The only problem is NOTHING is using that port. netstat or your PS command ever find 11434 is being used.
Author
Owner

@lnorton89 commented on GitHub (Sep 15, 2025):

For anyone else that doesn't want to learn how to nuke what's on port 11434 and just wants to clear whatever process is reserving it:
powershell
Get-NetTCPConnection -LocalPort 11434 | ForEach-Object { Stop-Process -Id $_.OwningProcess -Force }
Seems pretty trivial to just handle this error that is already in server.log plain as day and say hey guy, either kill whats on 11434 or choose a different port but here we are.

The only problem is NOTHING is using that port. netstat or your PS command ever find 11434 is being used.

What are you talking about? The powershell command listed above is to kill the Windows process using port 11434. This is not meant for the codebase, just an answer for anyone experiencing ollama not handling port allocation correctly on Windows. The process using the port is tailscale daemon. It doesn't matter if its willy wonka's daemon, you check if the port is bound and don't just show a blank electron window if the port is bound already. I've provided a PR to fix this.

<!-- gh-comment-id:3290450570 --> @lnorton89 commented on GitHub (Sep 15, 2025): > > For anyone else that doesn't want to learn how to nuke what's on port 11434 and just wants to clear whatever process is reserving it: > > `powershell` > > Get-NetTCPConnection -LocalPort 11434 | ForEach-Object { Stop-Process -Id $_.OwningProcess -Force } > > Seems pretty trivial to just handle this error that is already in `server.log` plain as day and say hey guy, either kill whats on 11434 or _choose a different port_ but here we are. > > The only problem is NOTHING is using that port. netstat or your PS command ever find 11434 is being used. What are you talking about? The powershell command listed above is to kill the Windows process using port 11434. This is not meant for the codebase, just an answer for anyone experiencing ollama not handling port allocation correctly on Windows. The process using the port is tailscale daemon. It doesn't matter if its willy wonka's daemon, you check if the port is bound and don't just show a blank electron window if the port is bound already. I've provided a PR to fix this.
Author
Owner

@MrMxyzptlk commented on GitHub (Sep 15, 2025):

Your command doesn't work, as there is nothing to kill using port 11434; that is the issue. The only way I've fixed this is either reboot, or stop the Windows HNS container service. HNS seems to automatically restart immediately and that frees the port.

<!-- gh-comment-id:3291685554 --> @MrMxyzptlk commented on GitHub (Sep 15, 2025): Your command doesn't work, as there is nothing to kill using port 11434; that is the issue. The only way I've fixed this is either reboot, or stop the Windows HNS container service. HNS seems to automatically restart immediately and that frees the port.
Author
Owner

@phdavis commented on GitHub (Oct 13, 2025):

Your command doesn't work, as there is nothing to kill using port 11434; that is the issue. The only way I've fixed this is either reboot, or stop the Windows HNS container service. HNS seems to automatically restart immediately and that frees the port.

Can confirm. Been running Ollama in the background for months perfectly fine but recently noticed it not behaving. Netstat, PowerShell, etc showed nothing listening on 11434. Force restarting the HNS Host Network Service service as mentioned resolved it, though there's a good chance it'll be back to this state again on reboot.

Looks like my dependent automations stopped behaving on 10/11/2025. Only updates have been Windows Defender. Firewall is set to allow.

<!-- gh-comment-id:3397603837 --> @phdavis commented on GitHub (Oct 13, 2025): > Your command doesn't work, as there is nothing to kill using port 11434; that is the issue. The only way I've fixed this is either reboot, or stop the Windows HNS container service. HNS seems to automatically restart immediately and that frees the port. Can confirm. Been running Ollama in the background for months perfectly fine but recently noticed it not behaving. Netstat, PowerShell, etc showed nothing listening on 11434. Force restarting the HNS `Host Network Service` service as mentioned resolved it, though there's a good chance it'll be back to this state again on reboot. Looks like my dependent automations stopped behaving on 10/11/2025. Only updates have been Windows Defender. Firewall is set to allow.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/ollama#70180