"fetch failed" / ECONNREFUSED 127.0.0.1:11434
"Fetch failed" or ECONNREFUSED means OpenClaw cannot reach Ollama's HTTP API. Usually Ollama isn't running, the baseUrl is wrong or ends in /v1, or a WSL2/Docker network boundary is blocking localhost. Confirm Ollama is listening on 11434, point baseUrl at the native API, fix the network path on WSL2, then re-run your agent.
Likely cause
OpenClaw cannot reach the Ollama HTTP API. Usually Ollama is not running, the baseUrl is wrong (or ends in /v1), or a WSL2 / Docker network boundary that localhost does not cross.
The fix
- 1 Confirm Ollama is running and listening on 11434 (curl http://127.0.0.1:11434/api/tags).
- 2 Make sure baseUrl points to the native API with no /v1 suffix.
- 3 On WSL2, enable mirrored networking or use the WSL IP; for cross-host, start Ollama with OLLAMA_HOST=0.0.0.0:11434.
- 4 Re-run your agent.
ollama serveHit a different error?
Paste any agent error and get the cause and fix in seconds.
Frequently asked questions
Ollama works on its own but OpenClaw can't reach it. Why?
Most often this is a network path problem: a WSL2 or Docker boundary that localhost doesn't cross, or a baseUrl pointing at the wrong host. Confirm OpenClaw can curl the same URL it has configured.
How do I fix this on WSL2?
localhost doesn't resolve across the WSL2/Windows boundary. Enable mirrored networking in .wslconfig, or use the WSL IP in your baseUrl and start Ollama with OLLAMA_HOST=0.0.0.0:11434.
Could a firewall be causing this?
Yes. Windows Defender, corporate firewalls, and endpoint tools like CrowdStrike or SentinelOne often block port 11434. If curl works locally but a remote host can't connect, add an inbound rule for TCP 11434.
Stop firefighting agent errors
Decoding errors one at a time is the manual version of what BetterClaw automates. Run your OpenClaw agents hosted with managed models, retries and config validation built in.
$19/month per agent · BYOK · 7-day money-back guarantee
