Error: parse "http://[127.0.0.1:15960:15960]:11434/": invalid host: ParseAddr("127.0.0.1:15960:15960"): unexpected character
means the value of OLLAMA_HOST is not a valid host and port: here the port was
written twice. Set it to one host and one port, such as 127.0.0.1:15960, and
the command runs.
The message quotes the bad value back to you inside ParseAddr("..."), so
compare that text with what you meant to type.
The error
PS> $env:OLLAMA_HOST = "127.0.0.1:15960:15960"
PS> ollama ps
Error: parse "http://[127.0.0.1:15960:15960]:11434/": invalid host: ParseAddr("127.0.0.1:15960:15960"): unexpected character (at ":15960:15960")
exit=1
ollama list printed the same line. ollama --version did not:
with the same value it printed Warning: could not connect to a running Ollama
instance and the client version, and exited with 0.
Why it happens
The error shows the URL the client built from 127.0.0.1:15960:15960: it put the whole value in square brackets, the
form used for IPv6 addresses, and appended the default port 11434. The bracketed text is
not a valid address, and the message points at the first character it could not use,
:15960:15960.
Other mistakes tried in the same session gave other results, all with ollama list:
PS> $env:OLLAMA_HOST = "http://127.0.0.1:15960/api"
PS> ollama list
Error: something went wrong, please see the ollama server logs for details
exit=1
PS> $env:OLLAMA_HOST = "ollama-box.invalid:15960"
PS> ollama list
Error: Head "http://ollama-box.invalid:15960/": dial tcp: lookup ollama-box.invalid: no such host
exit=1
PS> $env:OLLAMA_HOST = "127.0.0.1:159600"
PS> ollama list
2026/11/10 08:55:21 config.go:51: WARN invalid port, using default port=159600 default=11434
...
The last one is the quiet trap: a port above 65535 produced a warning and the client went
to port 11434, where it listed the models of the Ollama app on that port. A full URL with a
trailing slash and no path, http://127.0.0.1:15960/, worked.
The fix
PS> $env:OLLAMA_HOST = "127.0.0.1:15960"
PS> ollama list
NAME ID SIZE MODIFIED
exit=0
PS> ollama --version
ollama version is 0.40.8
Warning: client version is 0.40.14
exit=0
One host, one colon, one port. The list is empty because the test server had no models,
and the version line shows that the client reached it. Print the current value with
$env:OLLAMA_HOST in PowerShell and correct it wherever it was set.
How it was reproduced
Windows client ollama version is 0.40.14 in Windows PowerShell 5.1, with
OLLAMA_HOST set in the script's own process only. The server for the fix was
docker run -d --name fix9-olc-srv -p 127.0.0.1:15960:11434 ollama/ollama
(server 0.40.8), the test's own container, removed afterwards. Five values were tried with
ollama list; the doubled port was then rerun with ollama ps and
ollama --version.
Frequently asked
- What does invalid host ParseAddr unexpected character mean in Ollama?
- The OLLAMA_HOST value could not be read as a host and port. In the test the port had been typed twice, 127.0.0.1:15960:15960; setting it to 127.0.0.1:15960 fixed it.
- What is the correct format for OLLAMA_HOST?
- In the test, host:port such as 127.0.0.1:15960 worked, and so did http://127.0.0.1:15960/. A value with a path, http://127.0.0.1:15960/api, failed with something went wrong.
- Why does ollama connect to port 11434 when I set another port?
- In the test a port above 65535, 127.0.0.1:159600, printed WARN invalid port, using default and the client went to 11434. Check the value for a typo in the port.
More decoded errors in the Fixes category. What
OLLAMA_HOST controls and which ports Ollama uses is explained in
Ollama ports and OLLAMA_HOST.