NemoClaw icon indicating copy to clipboard operation
NemoClaw copied to clipboard

Sandbox cannot reach local Ollama at host.openshell.internal or 172.18.0.1 on DGX Spark

Open convexchaos opened this issue 7 months ago • 6 comments

Description

Environment

  • Hardware: NVIDIA DGX Spark (Founders Edition, 4TB)
  • OS: DGX OS (Ubuntu 24.04)
  • NemoClaw version: 0.0.11
  • OpenClaw version: 2026.3.11
  • Docker: 28.x

Problem

The OpenClaw sandbox cannot reach a locally running Ollama instance on the host.

Ollama is running on the host and confirmed reachable:

  • curl http://172.18.0.1:11434/api/tags works from the Spark host
  • curl http://127.0.0.1:11434/api/tags works from the Spark host
  • ollama ps shows models loaded correctly

However from inside the sandbox, all inference requests time out with:

  • "rawErrorPreview":"Connection error."
  • "error":"LLM request timed out."

Tried the following baseUrl values in openclaw.json - all fail:

  • http://host.openshell.internal:11434/v1
  • http://172.18.0.1:11434/v1
  • http://172.17.0.1:11434/v1
  • http://127.0.0.1:11434/v1

Question

What is the correct way to configure local Ollama inference so the sandbox can reach the host? Is there a network policy that needs to be added to allow the sandbox to connect to the host IP on port 11434?

Reproduction Steps

  1. Install NemoClaw on DGX Spark following spark-install.md
  2. Run nemoclaw onboard, select Local Ollama as inference provider
  3. Start Ollama with OLLAMA_HOST=0.0.0.0:11434 ollama serve
  4. Confirm Ollama is reachable from host: curl http://172.18.0.1:11434/api/tags returns model list
  5. Connect to sandbox: nemoclaw spark-nemo connect
  6. Send any message via OpenClaw dashboard or Telegram
  7. Observe "LLM request timed out" / "Connection error" in logs

Expected: Agent responds using local Ollama inference Actual: All inference requests fail with connection error regardless of which host IP is used in baseUrl

Environment

  • NemoClaw version: 0.0.11
  • OpenClaw version: 2026.3.11
  • OS: DGX OS Ubuntu 24.04
  • Hardware: NVIDIA DGX Spark Founders Edition 4TB
  • Docker: 28.x
  • Ollama version: 0.20.5

Debug Output


Logs


Checklist

  • [x] I confirmed this bug is reproducible
  • [x] I searched existing issues and this is not a duplicate

convexchaos avatar Apr 11 '26 16:04 convexchaos

I am having the same problem the model keeps showing/reverting to llama3.1:8b even when you set mistral:7b. It's hardcoded in the plugin banner

FinesseJones avatar Apr 12 '26 23:04 FinesseJones

Related: #709 — same root issue (sandbox can't reach host-local Ollama). PR #1140 has a partial fix for macOS but Linux/Spark still needs 0.0.0.0 binding. See #709 for full discussion.

prekshivyas avatar Apr 13 '26 18:04 prekshivyas

Reproduction findings (v0.0.16 / OpenShell 0.0.26 on DGX Spark)

Root cause confirmed

All sandbox HTTP traffic is routed through the OpenShell L7 proxy (http_proxy=http://10.200.0.1:3128). When openclaw.json uses a direct host URL like http://host.openshell.internal:11434/v1, the request goes through this proxy and gets 403 Forbidden because no network_policies entry allows host.openshell.internal:11434.

> POST http://host.openshell.internal:11434/v1/chat/completions HTTP/1.1
> Host: host.openshell.internal:11434
< HTTP/1.1 403 Forbidden

All four URLs the reporter tried (host.openshell.internal, 172.18.0.1, 172.17.0.1, 127.0.0.1) fail from inside the sandbox — the first three are blocked by the proxy policy, and 127.0.0.1 gets connection refused since nothing listens inside the sandbox.

The working path

The intended inference path uses the OpenShell inference route: sandbox → https://inference.local/v1 → OpenShell gateway L7 proxy → ollama-local provider → host.openshell.internal:11434. This works correctly on v0.0.16 because onboard sets baseUrl: "https://inference.local/v1" in openclaw.json.

Verified end-to-end from inside the sandbox:

$ curl https://inference.local/v1/chat/completions -d '{"model":"nemotron-3-super:120b","messages":[{"role":"user","content":"hi"}],"max_tokens":5}'
{"choices":[{"message":{"role":"assistant","content":"","reasoning":"Okay, the user said"}}],...}

Likely v0.0.11 regression

The reporter is on NemoClaw v0.0.11 / OpenShell v0.0.11. The current v0.0.16 onboard correctly configures https://inference.local/v1 as the baseUrl, routing through the gateway. The issue is likely that v0.0.11 either:

  1. Set the direct Ollama host URL in openclaw.json instead of the inference.local proxy route, or
  2. The inference route setup failed silently during onboard

Related: #709 (closed), PR #1140 (closed, not merged).

Recommendation

  • Confirm whether this is already fixed on main (v0.0.16) — it appears to be
  • If so, this can be closed as fixed-in-later-version with a note to upgrade
  • Consider adding a diagnostic check in nemoclaw status that detects when openclaw.json baseUrl bypasses the inference route

jyaunches avatar Apr 16 '26 18:04 jyaunches

Correction: NOT confirmed fixed in latest version

After deeper investigation, the v0.0.11 and v0.0.16 (current main) onboard code for ollama-local is identical — same getSandboxInferenceConfig (defaults to https://inference.local/v1), same getLocalProviderBaseUrl (gateway-side http://host.openshell.internal:11434/v1), same upsertProvider call. No code change between versions addresses this bug.

The reason the DGX Spark test environment works is:

  1. Ollama is explicitly configured with OLLAMA_HOST=0.0.0.0:11434 (systemd override in /etc/systemd/system/ollama.service.d/host.conf)
  2. OpenShell 0.0.26 gateway container has host.openshell.internal:host-gateway → resolves to 172.17.0.1 (docker0)
  3. Since Ollama listens on all interfaces, 172.17.0.1:11434 succeeds

The bug is still reproducible if:

  • Ollama is bound to 127.0.0.1 (default) instead of 0.0.0.0 — then host-gateway (172.17.0.1/docker0) cannot reach it
  • The user manually sets baseUrl in openclaw.json to a direct host URL (as the reporter tried) — the L7 proxy returns 403 Forbidden since no network policy allows those endpoints

The reporter's exact symptom (timeout/connection error after standard onboard) could happen if:

  1. Ollama was running with default bind (127.0.0.1) when onboard ran — the validateLocalProvider container reachability check would have failed and blocked onboard, so this scenario should be caught
  2. Ollama was on 0.0.0.0 during onboard (check passed) but later restarted/reconfigured to 127.0.0.1
  3. The OpenShell gateway container lost the host.openshell.internal host mapping after a restart

We need the reporter's nemoclaw <sandbox> logs output to determine which failure mode they hit. The missing debug output and logs sections in the issue are critical for diagnosis.

Retracting the "likely fixed in later version" assessment from my previous comment.

jyaunches avatar Apr 16 '26 18:04 jyaunches

We attempted to reproduce this on a DGX Spark (Founders Edition) with NemoClaw v0.0.16 / OpenShell 0.0.26 following the same steps and were unable to — local Ollama inference works end-to-end through the sandbox.

Could you provide:

  1. nemoclaw <sandbox-name> logs --tail 50 — especially any lines around the time of a failed inference request
  2. openshell inference get output
  3. openshell provider get ollama-local output
  4. Your OpenShell version (openshell --version)

That will help us narrow down where the routing breaks in your environment.

jyaunches avatar Apr 16 '26 19:04 jyaunches

Closing as won't fix — we were unable to reproduce this on DGX Spark (Founders Edition) with v0.0.16 / OpenShell 0.0.26. Local Ollama inference worked end-to-end through the sandbox in our testing. No response from reporter after requesting additional logs and diagnostics on April 16th. If this resurfaces, please reopen with the requested diagnostic output (sandbox logs, docker inspect, proxy env vars).

jyaunches avatar Apr 21 '26 17:04 jyaunches