Repository navigation
[Bug] inference.local returns HTTP 403 inside sandbox when using Ollama local inference on DGX Spark #314
Description
Title
[Bug] inference.local returns HTTP 403 inside sandbox when using Ollama local inference on DGX Spark
Description
After completing nemoclaw onboard on DGX Spark with Ollama as the local inference provider, all requests to http://inference.local from inside the sandbox return HTTP 403 Forbidden with an empty body. OpenClaw still functions (responds in ~21s), but the inference routing appears to be failing or falling back through a slower path.
Environment
- Device: NVIDIA DGX Spark (GB10, 128GB unified memory)
- OS: DGX OS (Ubuntu-based)
- OpenShell CLI: v0.0.7
- NemoClaw: installed from source (main branch, cloned 2026-03-17)
- OpenClaw: 2026.3.11
- Ollama: running on localhost:11434, listening on 0.0.0.0
- Model: qwen2.5:32b-instruct-32k (also tested with other models)
Steps to Reproduce
- Run
nemoclaw onboardon DGX Spark - Select option 3 (Local Ollama) for inference
- Complete all onboarding steps (sandbox created successfully)
- Switch inference to local model:
openshell inference set --provider ollama-local --model qwen2.5:32b-instruct-32k - Connect to sandbox:
nemoclaw my-assistant connect - Inside sandbox, test inference endpoint:
curl -v http://inference.local/v1/chat/completions \ -H "Content-Type: application/json" \ -d '{"model":"qwen2.5:32b-instruct-32k","messages":[{"role":"user","content":"hello"}],"stream":false}'
Expected Behavior
inference.local should proxy the request to the configured Ollama endpoint and return a valid chat completion response.
Actual Behavior
> POST http://inference.local/v1/chat/completions HTTP/1.1
> Host: inference.local
< HTTP/1.1 403 Forbidden
Empty response body. The request goes through the sandbox proxy at 10.200.0.1:3128 but is denied.
Additional Context
- Ollama responds correctly from host:
curl http://127.0.0.1:11434/api/generatereturns a response in ~3 seconds. - Ollama responds correctly from inside sandbox via direct host address:
curl http://host.openshell.internal:11434/api/generatewithstream:truereturns the first chunk in ~60ms. - However, with
stream:false,curl http://host.openshell.internal:11434/v1/chat/completionsalso returns an empty response. openshell inference getconfirms correct configuration:Gateway inference: Provider: ollama-local Model: qwen2.5:32b-instruct-32k Version: 2- OpenClaw TUI does eventually respond (~21 seconds), suggesting it may be falling back to a different inference path or retrying. Direct Ollama latency from host is ~3 seconds.
- Setting
NVIDIA_API_KEY=local-ollamaandANTHROPIC_API_KEY=local-ollamainside the sandbox (per troubleshooting docs) did not resolve the 403 or improve latency. - Ollama is configured to listen on all interfaces (
OLLAMA_HOST=0.0.0.0). - The
nemoclaw setup-sparkcgroup fix was applied before onboarding.
Possibly Related
- macOS/Apple Silicon Support Tracking — Known Gaps & Fixes #260 (macOS) mentions
inference.local -> host gateway mappingas a suggested fix - openshell sandbox list shows transport error (os error 111) upon brev stop/start #159 reports
logssubcommand not recognized (also encountered in this setup)
Activity
dgrewe-hse commentedon Mar 18, 2026
I can agree the issue. Do want to connect the agent to a local Ollama instance and the nemotron-3-super-default model (despite being slow with ~21 token/s). Able to configture the gateway inference:
openshell inference set \ --provider ollama-local \ --model nemotron-3-super \ --no-verify Gateway inference configured: Route: inference.local Provider: ollama-local Model: nemotron-3-super Version: 2 ... openshell inference get Gateway inference: Provider: ollama-local Model: nemotron-3-super Version: 2 System inference: Not configuredHowever, it seems that nemoclaw plugin inside the sandbox running
nemoclaw agent connectseems to ignore the settings and still run againstbuild.nvidia.comassuming an OpenAI API key.Would appriciate any hints on configurations.
Bathoryw commentedon Mar 19, 2026
same bug
KIAPN commentedon Mar 19, 2026
Root cause identified — three layers of network blocking
I hit the same issue on a DGX Spark (GB10, Ubuntu 24.04, Ollama 0.18.1) with
nemotron-3-super:latest. After extensive debugging, the 403 is not a single issue — it's three independent layers of network isolation that all need to be addressed. Here's the full chain:Layer 1: Sandbox network policy has no Ollama entry
The default sandbox policy (
openclaw-sandbox.yaml) has nonetwork_policiesentry for local Ollama endpoints. The OpenShell proxy at10.200.0.1:3128enforces the policy and returns HTTP 403 for any endpoint not explicitly listed.The
nemoclaw onboardwizard is supposed to write this policy, but on DGX Spark it hard-exits at step 5 with:It detects the problem but cannot self-remediate, and the sandbox gets created with cloud-only policy.
Fix: Add an
ollama_localnetwork policy to the sandbox policy YAML and apply withopenshell policy set.Layer 2: Policy endpoint format matters
When adding the
ollama_localpolicy entry, usingprotocol: restwithrules:does not work for plain HTTP endpoints. The sandbox logs show:Fix: Use
access: fullinstead ofprotocol: reston the Ollama endpoint — the proxy needs to tunnel rather than L7-inspect plain HTTP.Layer 3: Private IPs require
allowed_ipsEven with
access: full, the proxy blocks connections to RFC1918 addresses by default:Fix: Add
allowed_ipsat the endpoint level in the policy YAML.Layer 4 (host-side): UFW blocks Docker bridge traffic
After fixing all three policy layers, connections still timed out. The Ubuntu 24.04 UFW firewall on DGX Spark blocks inbound connections from Docker bridge subnets to host ports.
Fix:
sudo ufw allow from 172.18.0.0/16 to any port 11434 comment "Allow Ollama from OpenShell containers"The specific subnet depends on your Docker bridge — check with
docker network inspect openshell-cluster-nemoclaw | grep Gateway.Complete working policy YAML
Since
openshell policy setrejects partial YAML on live sandboxes, here is the complete working policy file. This is the defaultopenclaw-sandbox.yamlwith theollama_localentry added. Save it and apply withopenshell policy set <sandbox-name> --policy <path-to-file>.Click to expand full policy YAML
Important notes
binarieslist must include/usr/local/bin/nodein addition to/usr/local/bin/openclaw, since openclaw is a Node.js scriptopenshell logs <sandbox> --source sandbox --level debug) are essential for diagnosing which layer is blocking — each layer produces a distinct error messageNEMOCLAW_EXPERIMENTAL=1is required fornemoclaw onboardto show the local Ollama option at allResult
After all four fixes, local inference works end-to-end:
Suggestions for NVIDIA
nemoclaw onboardshould apply theollama_localnetwork policy automatically when the user selects local Ollamanemoclaw setup-sparkshould add the UFW rule for Docker bridge subnets (or at minimum warn about it)allowed_ipsandaccess: fullrequirements for internal endpoints should be documentedKIAPN commentedon Mar 20, 2026
Update: Two additional layers identified (Layers 5 & 6)
Following up on my earlier comment documenting layers 1–4. After resolving all four network policy and firewall issues, two more blockers remain before local Ollama inference works end-to-end in OpenClaw.
Layer 5:
inference.localproxy interception bugEven with
inference.localadded to the sandbox network policy (withaccess: fullandallowed_ips), the OpenShell proxy runs DNS resolution oninference.localbefore intercepting it as a virtual hostname. Sinceinference.localis not a real DNS name, resolution fails:```
FORWARD blocked: allowed_ips check failed
dst_host=inference.local dst_port=80
reason=DNS resolution failed for inference.local:80
```
This is consistent with #385's finding that "no path exists in OpenShell 0.0.10 to route inference.local to a local Ollama instance."
The progression of proxy denials as we added policy entries confirms the bug is in the interception order:
inference.localentryWorkaround: Bypass
inference.localentirely. Configure OpenClaw'sopenclaw.jsonto use the direct Docker bridge IP:```json
{
"models": {
"providers": {
"ollama": {
"baseUrl": "http://172.18.0.1:11434/v1",
"apiKey": "local-ollama",
"api": "openai-completions"
}
}
}
}
```
The Docker bridge IP can be found with:
```bash
docker network inspect openshell-cluster-nemoclaw | grep Gateway
```
Layer 6: OpenClaw model ID and timeout
Two smaller issues after bypassing
inference.local:6a. Model ID requires provider prefix. Using
nemotron-3-nano:latestcauses OpenClaw to default toanthropic/nemotron-3-nano:latest→FailoverError: Unknown model. Must useollama/nemotron-3-nano:latestinopenclaw.json.6b. OpenClaw's default request timeout is shorter than Ollama's cold-start time (50–74s for large models on GB10). Fix: set
timeoutSeconds: 120inopenclaw.jsonor pass--timeout 120.Additional note: sandbox base image
The default base sandbox image (
--from baseoropenshell sandbox createwithout--from) does not includeopenclaw. It only hasclaude,python3,uv,node. The sandbox must be built from NemoClaw's ownDockerfile(which the onboard wizard normally does automatically via a temp build context).Working end-to-end result
After all six layers:
```
$ openclaw agent --agent main --local -m "how many rs in strawberry?" --session-id test --timeout 120
The word "strawberry" contains three r's.
```
Model:
nemotron-3-nano:latestvia Ollama on DGX Spark (GB10, 128 GB unified memory).Summary of all six layers
ollama_localto policy YAMLprotocol: restfails for plain HTTPaccess: fullallowed_ipsallowed_ipsper endpointsudo ufw allowfor Docker subnetsinference.localDNS check before interceptopenclaw.jsonollama/prefix, set timeout ≥ 120sSuggestions for NVIDIA (updated)
nemoclaw onboardshould applyollama_localnetwork policy when Ollama is selectednemoclaw setup-sparkshould add UFW rules for Docker bridge subnetsallowed_ipsandaccess: fullrequirements for internal endpoints should be documentedinference.localbefore running DNS-basedallowed_ipschecksfix: route Ollama inference via host-gateway instead of inference.local
ParkerFairfield commentedon Mar 22, 2026
Additional data points from a DGX Spark (GB10, 128GB, aarch64, Ubuntu 24.04, OpenShell v0.0.10, OpenClaw 2026.3.11).
The 403 on inference.local is confirmed on our setup as well. But the problem is broader than Ollama inference — the sandbox network namespace proxy blocks ALL non-HTTPS traffic, not just Ollama.
What we tested inside the sandbox:
DNS resolution: BROKEN. The nameserver at 10.43.0.10 refuses all connections. nslookup, getent hosts, and ping all fail. Only inference.local resolves (mapped by OpenShell).
IMAP (port 993): BLOCKED. curl CONNECT to gmail/yahoo/outlook/etc returns HTTP 403.
SMTP (port 587): BLOCKED. Same 403 on CONNECT.
npm registry (port 443): BLOCKED. Even though the network policy includes registry.npmjs.org:443, npx/npm install fails with E403 on the CONNECT tunnel.
Ollama (port 11434): BLOCKED. Same 403 pattern as reported in this issue.
The proxy at x.x.x.x:3128 appears to only allow HTTP/HTTPS CONNECT to a hardcoded set of endpoints, and only on port 443. Any non-443 port returns 403 regardless of what the network policy YAML specifies.
Our workaround:
The root issue appears to be that the OpenShell proxy only supports HTTP/HTTPS protocol tunneling. Raw TCP protocols (IMAP, SMTP, Ollama HTTP on non-standard ports) cannot traverse the network namespace boundary. The network_policies YAML allows the endpoints, but the proxy enforcement layer doesn't honor non-443 ports.
This effectively means any skill or tool that needs non-HTTPS network access must run outside the sandbox, which undermines the security model.
Environment:
feat: allow host.docker.internal for local inference
paritoshd-nv commentedon Mar 24, 2026
We have updated https://github.com/NVIDIA/NemoClaw/blob/main/spark-install.md for the local Ollama inference. Please try with instructions on that page.
docs: add local Ollama inference setup section (NVIDIA#822)
docs: add local Ollama inference setup section (NVIDIA#822)
test(e2e): run host alias checks from docker (NVIDIA#314)
docs: add local Ollama inference setup section (NVIDIA#822)
docs: add local Ollama inference setup section (NVIDIA#822)