[GH-ISSUE #8396] Error: could not connect to ollama app, is it running? #5392

Closed
opened 2026-04-12 16:37:27 -05:00 by GiteaMirror · 8 comments
Owner

Originally created by @Eyion on GitHub (Jan 12, 2025).
Original GitHub issue: https://github.com/ollama/ollama/issues/8396

What is the issue?

When I type "ollama -v", it shows "Warning: could not connect to a running Ollama instance
Warning: client version is 0.5.4"

When I type "ollama run qwen2.5:7b", it shows "Error: could not connect to ollama app, is it running?"

When I type "ollama serve", it shows "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."

server.log

I have reinstalled the software once again.

OS

Windows

GPU

Nvidia

CPU

Intel

Ollama version

0.5.4

Originally created by @Eyion on GitHub (Jan 12, 2025). Original GitHub issue: https://github.com/ollama/ollama/issues/8396 ### What is the issue? When I type "ollama -v", it shows "Warning: could not connect to a running Ollama instance Warning: client version is 0.5.4" When I type "ollama run qwen2.5:7b", it shows "Error: could not connect to ollama app, is it running?" When I type "ollama serve", it shows "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." [server.log](https://github.com/user-attachments/files/18389384/server.log) I have reinstalled the software once again. ### OS Windows ### GPU Nvidia ### CPU Intel ### Ollama version 0.5.4
GiteaMirror added the bug label 2026-04-12 16:37:27 -05:00
Author
Owner

@rick-github commented on GitHub (Jan 12, 2025):

Open a Powershell window in administrator mode and run:

netstat -bano | Select-String -Pattern 11434 -Context 0,1
<!-- gh-comment-id:2585730761 --> @rick-github commented on GitHub (Jan 12, 2025): Open a Powershell window in administrator mode and run: ``` netstat -bano | Select-String -Pattern 11434 -Context 0,1 ```
Author
Owner

@Eyion commented on GitHub (Jan 12, 2025):

image
Didn't see any changes

<!-- gh-comment-id:2585738337 --> @Eyion commented on GitHub (Jan 12, 2025): ![image](https://github.com/user-attachments/assets/f71e97e6-5be1-4de2-a1a7-c95c2dcd00aa) Didn't see any changes
Author
Owner

@rick-github commented on GitHub (Jan 12, 2025):

What's the output of the following (Powershell window in administrator mode):

netsh interface ipv4 show excludedportrange protocol=tcp
<!-- gh-comment-id:2585742299 --> @rick-github commented on GitHub (Jan 12, 2025): What's the output of the following (Powershell window in administrator mode): ``` netsh interface ipv4 show excludedportrange protocol=tcp ```
Author
Owner

@Eyion commented on GitHub (Jan 12, 2025):

image

<!-- gh-comment-id:2585742687 --> @Eyion commented on GitHub (Jan 12, 2025): ![image](https://github.com/user-attachments/assets/af4095c2-00b2-4e1d-b741-205aee6d8fe6)
Author
Owner

@rick-github commented on GitHub (Jan 12, 2025):

What's the output of the following: (Powershell window in administrator mode):

net stop winnat
netsh interface ipv4 show excludedportrange protocol=tcp

After screenshot,

net start winnat
<!-- gh-comment-id:2585746387 --> @rick-github commented on GitHub (Jan 12, 2025): What's the output of the following: (Powershell window in administrator mode): ``` net stop winnat netsh interface ipv4 show excludedportrange protocol=tcp ``` After screenshot, ``` net start winnat ```
Author
Owner

@Eyion commented on GitHub (Jan 12, 2025):

image

<!-- gh-comment-id:2585748216 --> @Eyion commented on GitHub (Jan 12, 2025): ![image](https://github.com/user-attachments/assets/0fcb01e1-d361-482a-b708-9aeb3f0935ed)
Author
Owner

@rick-github commented on GitHub (Jan 12, 2025):

OK, so winnat is taking over the port that ollama wants to use. We will turn off winnat and add an 'Administered port exclusion' to allow ollama to use port 11434.

Powershell window in administrator mode:

net stop winnat
netsh int ipv4 add excludedportrange protocol=tcp startport=11434 numberofports=1
net start winnat
netsh interface ipv4 show excludedportrange protocol=tcp

The last command should show port 11434 with '*' after it. If it does, try starting the ollama server.

<!-- gh-comment-id:2585749990 --> @rick-github commented on GitHub (Jan 12, 2025): OK, so winnat is taking over the port that ollama wants to use. We will turn off winnat and add an 'Administered port exclusion' to allow ollama to use port 11434. Powershell window in administrator mode: ``` net stop winnat netsh int ipv4 add excludedportrange protocol=tcp startport=11434 numberofports=1 net start winnat netsh interface ipv4 show excludedportrange protocol=tcp ``` The last command should show port 11434 with '*' after it. If it does, try starting the ollama server.
Author
Owner

@Eyion commented on GitHub (Jan 12, 2025):

image

Thank you very much. Now enter "ollama run qwen2.5:7b" and the model will start downloading.
image

<!-- gh-comment-id:2585750628 --> @Eyion commented on GitHub (Jan 12, 2025): ![image](https://github.com/user-attachments/assets/0189f131-1daa-4350-9ef6-a35bcbd1f0b2) Thank you very much. Now enter "ollama run qwen2.5:7b" and the model will start downloading. ![image](https://github.com/user-attachments/assets/ecb12fce-431e-468a-95eb-003115a89d85)
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/ollama#5392