[GH-ISSUE #8719] config.go:45: WARN invalid port #5653

Closed
opened 2026-04-12 16:56:46 -05:00 by GiteaMirror · 22 comments
Owner

Originally created by @ZaEvab55555 on GitHub (Jan 31, 2025).
Original GitHub issue: https://github.com/ollama/ollama/issues/8719

What is the issue?

Hi, I was using Ollama in powershell, and whatever command I type, it gives me "config.go:45: WARN invalid port." I have tried to change the Ollama_Host environment variable, but it does not change anything. Ollama still works, but it is way slower. Can you please tell me how to fix it? I expected a direct response instead of "config.go:45: WARN invalid port, using default port=127.0.0.1 default=11434"

OS

Windows

GPU

Intel

CPU

Intel

Ollama version

0.5.7

Originally created by @ZaEvab55555 on GitHub (Jan 31, 2025). Original GitHub issue: https://github.com/ollama/ollama/issues/8719 ### What is the issue? Hi, I was using Ollama in powershell, and whatever command I type, it gives me "config.go:45: WARN invalid port." I have tried to change the Ollama_Host environment variable, but it does not change anything. Ollama still works, but it is way slower. Can you please tell me how to fix it? I expected a direct response instead of "config.go:45: WARN invalid port, using default port=127.0.0.1 default=11434" ### OS Windows ### GPU Intel ### CPU Intel ### Ollama version 0.5.7
GiteaMirror added the bug label 2026-04-12 16:56:46 -05:00
Author
Owner

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

What did you set OLLAMA_HOST to?

<!-- gh-comment-id:2626200621 --> @rick-github commented on GitHub (Jan 31, 2025): What did you set `OLLAMA_HOST` to?
Author
Owner

@ZaEvab55555 commented on GitHub (Jan 31, 2025):

i set it to 0.0.0.0 and then I decided to delete the environment variable.

<!-- gh-comment-id:2627391702 --> @ZaEvab55555 commented on GitHub (Jan 31, 2025): i set it to 0.0.0.0 and then I decided to delete the environment variable.
Author
Owner

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

Server logs will aid in debugging.

<!-- gh-comment-id:2627524816 --> @rick-github commented on GitHub (Jan 31, 2025): [Server logs](https://github.com/ollama/ollama/blob/main/docs/troubleshooting.md#how-to-troubleshoot-issues) will aid in debugging.
Author
Owner

@ZaEvab55555 commented on GitHub (Jan 31, 2025):

server-1.log
server-2.log
server-3.log
server-4.log
server-5.log

<!-- gh-comment-id:2627571012 --> @ZaEvab55555 commented on GitHub (Jan 31, 2025): [server-1.log](https://github.com/user-attachments/files/18620305/server-1.log) [server-2.log](https://github.com/user-attachments/files/18620307/server-2.log) [server-3.log](https://github.com/user-attachments/files/18620306/server-3.log) [server-4.log](https://github.com/user-attachments/files/18620303/server-4.log) [server-5.log](https://github.com/user-attachments/files/18620304/server-5.log)
Author
Owner

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

What's the output of

echo %OLLAMA_HOST%

or

echo $env:OLLAMA_HOST

The reason inference is slow is your drivers are old:

time=2025-01-30T10:19:39.464-06:00 level=INFO source=gpu.go:630 msg="Unable to load cudart library C:\\WINDOWS\\system32\\nvcuda.dll: symbol lookup for cuCtxCreate_v3 failed: The specified procedure could not be found.\r\n"

Update your Nvidia drivers.

<!-- gh-comment-id:2627725739 --> @rick-github commented on GitHub (Jan 31, 2025): What's the output of ``` echo %OLLAMA_HOST% ``` or ``` echo $env:OLLAMA_HOST ``` The reason inference is slow is your drivers are old: ``` time=2025-01-30T10:19:39.464-06:00 level=INFO source=gpu.go:630 msg="Unable to load cudart library C:\\WINDOWS\\system32\\nvcuda.dll: symbol lookup for cuCtxCreate_v3 failed: The specified procedure could not be found.\r\n" ``` Update your Nvidia drivers.
Author
Owner

@ZaEvab55555 commented on GitHub (Feb 1, 2025):

I just get %OLLAMA_HOST% when I echo it. Also, I have intel drivers?

<!-- gh-comment-id:2629162525 --> @ZaEvab55555 commented on GitHub (Feb 1, 2025): I just get %OLLAMA_HOST% when I echo it. Also, I have intel drivers?
Author
Owner

@ZaEvab55555 commented on GitHub (Feb 1, 2025):

updated server logs

server-1.log
server-2.log
server-3.log
server-4.log
server-5.log

<!-- gh-comment-id:2629162796 --> @ZaEvab55555 commented on GitHub (Feb 1, 2025): updated server logs [server-1.log](https://github.com/user-attachments/files/18630613/server-1.log) [server-2.log](https://github.com/user-attachments/files/18630616/server-2.log) [server-3.log](https://github.com/user-attachments/files/18630614/server-3.log) [server-4.log](https://github.com/user-attachments/files/18630612/server-4.log) [server-5.log](https://github.com/user-attachments/files/18630615/server-5.log)
Author
Owner

@ZaEvab55555 commented on GitHub (Feb 1, 2025):

Image

<!-- gh-comment-id:2629167327 --> @ZaEvab55555 commented on GitHub (Feb 1, 2025): ![Image](https://github.com/user-attachments/assets/c40b3858-7e85-41fc-aeca-59fd8f60e572)
Author
Owner

@rick-github commented on GitHub (Feb 2, 2025):

OLLAMA_HOST is malformed.

$ export OLLAMA_HOST=:127.0.0.1
$ ollama --version
2025/02/02 01:11:12 config.go:45: WARN invalid port, using default port=127.0.0.1 default=11434
2025/02/02 01:11:12 config.go:45: WARN invalid port, using default port=127.0.0.1 default=11434
ollama version is 0.5.7
$ export OLLAMA_HOST=127.0.0.1
$ ollama --version
ollama version is 0.5.7

Also, I have intel drivers?

Sorry, must have been looking at someone elses log files. You have no detected GPUs.

<!-- gh-comment-id:2629174902 --> @rick-github commented on GitHub (Feb 2, 2025): `OLLAMA_HOST` is malformed. ```console $ export OLLAMA_HOST=:127.0.0.1 $ ollama --version 2025/02/02 01:11:12 config.go:45: WARN invalid port, using default port=127.0.0.1 default=11434 2025/02/02 01:11:12 config.go:45: WARN invalid port, using default port=127.0.0.1 default=11434 ollama version is 0.5.7 ``` ```console $ export OLLAMA_HOST=127.0.0.1 $ ollama --version ollama version is 0.5.7 ``` > Also, I have intel drivers? Sorry, must have been looking at someone elses log files. You have no detected GPUs.
Author
Owner

@ZaEvab55555 commented on GitHub (Feb 2, 2025):

since I can't use the export command on windows 11, I changed the system environment variable to OLLAMA_HOST and the value to 127.0.0.1

Image
it still does the same thing

<!-- gh-comment-id:2629414266 --> @ZaEvab55555 commented on GitHub (Feb 2, 2025): since I can't use the export command on windows 11, I changed the system environment variable to OLLAMA_HOST and the value to 127.0.0.1 ![Image](https://github.com/user-attachments/assets/95130169-a33a-4569-8288-582947ec1da7) it still does the same thing
Author
Owner

@rick-github commented on GitHub (Feb 2, 2025):

Did you start a new terminal session after updating the environment variable?

<!-- gh-comment-id:2629593333 --> @rick-github commented on GitHub (Feb 2, 2025): Did you start a new terminal session after updating the environment variable?
Author
Owner

@ZaEvab55555 commented on GitHub (Feb 3, 2025):

After restarting ollama and the terminal, it still says the same thing. Maybe it is because I forgot to restart Ollama and terminal right after I set the variable.

<!-- gh-comment-id:2631092320 --> @ZaEvab55555 commented on GitHub (Feb 3, 2025): After restarting ollama and the terminal, it still says the same thing. Maybe it is because I forgot to restart Ollama and terminal right after I set the variable.
Author
Owner

@rick-github commented on GitHub (Feb 3, 2025):

Somewhere, somehow, you have a mis-configured OLLAMA_HOST. What happens if you remove OLLAMA_HOST from the environment configuration, restart ollama, close the command terminal window, open a new command terminal window, run echo %OLLAMA_HOST%, then run ollama -v.

<!-- gh-comment-id:2631137752 --> @rick-github commented on GitHub (Feb 3, 2025): Somewhere, somehow, you have a mis-configured `OLLAMA_HOST`. What happens if you remove `OLLAMA_HOST` from the environment configuration, restart ollama, close the command terminal window, open a new command terminal window, run `echo %OLLAMA_HOST%`, then run `ollama -v`.
Author
Owner

@ZaEvab55555 commented on GitHub (Feb 3, 2025):

Image

<!-- gh-comment-id:2631898600 --> @ZaEvab55555 commented on GitHub (Feb 3, 2025): ![Image](https://github.com/user-attachments/assets/9efc4af8-4549-40e9-ba8e-0757adfd501a)
Author
Owner

@ZaEvab55555 commented on GitHub (Feb 3, 2025):

That image is command prompt, but when I run echo Ollama host in Powershell 7, it just gives me %ollamahost%

Image

<!-- gh-comment-id:2631901237 --> @ZaEvab55555 commented on GitHub (Feb 3, 2025): That image is command prompt, but when I run echo Ollama host in Powershell 7, it just gives me %ollamahost% ![Image](https://github.com/user-attachments/assets/72505b69-3358-4135-a39e-f782f4d20184)
Author
Owner

@rick-github commented on GitHub (Feb 3, 2025):

In PowerShell, you need to run echo $env:OLLAMA_HOST.

So we see that OLLAMA_HOST is malformed. You need to fix that.

<!-- gh-comment-id:2631904539 --> @rick-github commented on GitHub (Feb 3, 2025): In PowerShell, you need to run `echo $env:OLLAMA_HOST`. So we see that `OLLAMA_HOST` is malformed. You need to fix that.
Author
Owner

@mxyng commented on GitHub (Feb 3, 2025):

Where exactly did you set OLLAMA_HOST? In Windows' System Properties?

<!-- gh-comment-id:2631909678 --> @mxyng commented on GitHub (Feb 3, 2025): Where exactly did you set `OLLAMA_HOST`? In Windows' System Properties?
Author
Owner

@ZaEvab55555 commented on GitHub (Feb 3, 2025):

Image

<!-- gh-comment-id:2631948896 --> @ZaEvab55555 commented on GitHub (Feb 3, 2025): ![Image](https://github.com/user-attachments/assets/0a6e12fa-d2e6-4e8b-9a0f-d9303a1fa986)
Author
Owner

@ZaEvab55555 commented on GitHub (Feb 3, 2025):

and in powershell it now says

Image

<!-- gh-comment-id:2631949891 --> @ZaEvab55555 commented on GitHub (Feb 3, 2025): and in powershell it now says ![Image](https://github.com/user-attachments/assets/7f2b24ee-e013-4a0d-bbab-d1b9b13316d6)
Author
Owner

@rick-github commented on GitHub (Feb 3, 2025):

Yes. Malformed.

<!-- gh-comment-id:2631950715 --> @rick-github commented on GitHub (Feb 3, 2025): Yes. Malformed.
Author
Owner

@mxyng commented on GitHub (Feb 3, 2025):

Make sure to confirm and exit any subwindows of Edit the system environment variables before opening a new terminal to ensure changes take affect.

<!-- gh-comment-id:2631953368 --> @mxyng commented on GitHub (Feb 3, 2025): Make sure to confirm and exit any subwindows of `Edit the system environment variables` before opening a new terminal to ensure changes take affect.
Author
Owner

@ZaEvab55555 commented on GitHub (Feb 4, 2025):

Thank you so much for the help! I just realized that I had an erroneous OLLAMA_HOST variable in my own environment variables. When I changed it, now it is fixed.

<!-- gh-comment-id:2632645321 --> @ZaEvab55555 commented on GitHub (Feb 4, 2025): Thank you so much for the help! I just realized that I had an erroneous OLLAMA_HOST variable in my own environment variables. When I changed it, now it is fixed.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/ollama#5653