Skip to content

[MacOS] No clear error message when Ollama backend is stopped #995

Description

@zNeill

Description

When the inference backend (Ollama) is stopped and a request is made to inference.local from inside the sandbox, the OpenShell gateway silently drops the connection with no HTTP response body. The user sees no error message — just a curl exit code 6 after ~5 seconds. The gateway should return a clear HTTP error response indicating the backend is unreachable.

Working State
With Ollama running, inference through the gateway works correctly:

# Inside sandbox — returns valid completion
curl -s https://inference.local/v1/chat/completions \
-H  Content-Type: application/json  \
-d '{ model : llama3.2:1b , messages :[{ role : user , content : say hello }]}'

Response:

{ id : chatcmpl-100 , object : chat.completion , created :1773620673, model : llama3.2:1b , choices :[{ index :0, message :{ role : assistant , content : Hello. How can I assist you today? }, finish_reason : stop }], usage :{ prompt_tokens :27, completion_tokens :10, total_tokens :37}}

Steps to reproduce

  1. Complete nemoclaw setup successfully
  2. Set inference route to ollama-local: openshell inference set --provider ollama-local --model llama3.2:1b
  3. Verify inference works inside sandbox (pre-condition above)
  4. Stop Ollama on the host: pkill ollama
  5. Verify Ollama is down: curl -s http://localhost:11434/api/tags returns connection refused
  6. Inside sandbox, re-run inference: curl -s https://inference.local/v1/chat/completions \ -H Content-Type: application/json \ -d '{ model : llama3.2:1b , messages :[{ role : user , content : say hello }]}'
Actual Result

Steps to reproduce

No steps provided.


[NVB# 5982629]

[NVB#5982629]

Activity

  1. added
    NV QA
    on Mar 26, 2026
  2. AddyM commented on Mar 29, 2026

    @AddyM

    Root Cause Analysis

    This is a two-layer problem:

    Layer 1 (OpenShell gateway): The gateway proxies inference.local requests to the configured backend. When the backend is unreachable, the gateway drops the TCP connection silently instead of returning an HTTP 502/503 with a diagnostic body. This is the upstream bug — the gateway should catch ECONNREFUSED / ETIMEDOUT from the backend and synthesize a proper HTTP error response. That fix belongs in NVIDIA/OpenShell.

    Layer 2 (NemoClaw): NemoClaw has no inference health visibility at the CLI level. The nemoclaw <n> status command reports sandbox state and blueprint health, but never probes whether the inference route is actually functional. So the user gets zero warning before hitting the silent failure inside the sandbox.

    Layer 1 is the root fix. But Layer 2 is something NemoClaw should own regardless — operators need to know inference is down without having to exec into the sandbox and run curl manually.

    Reproducer (confirmed from the issue)

    # 1. Working state — Ollama running, inference route configured
    sandbox@my-assistant:~$ curl -s https://inference.local/v1/chat/completions \
      -H "Content-Type: application/json" \
      -d '{"model":"llama3.2:1b","messages":[{"role":"user","content":"say hello"}]}'
    # Returns: valid chat.completion JSON
    

    2. Kill Ollama on host

    host$ pkill ollama

    3. Retry from sandbox

    sandbox@my-assistant:~$ curl -s https://inference.local/v1/chat/completions
    -H "Content-Type: application/json"
    -d '{"model":"llama3.2:1b","messages":[{"role":"user","content":"say hello"}]}'

    Returns: empty response, curl exit code 6, ~5s hang

    No HTTP status code. No response body. No gateway error header. The user's only signal is a nonzero exit code after a timeout.

    Proposed Fix (NemoClaw-scoped)

    Add an inference health probe to nemoclaw <n> status in nemoclaw/src/commands/status.ts.

    What it does: Before reporting status, probe the configured inference provider's health endpoint from the host side (outside the sandbox). Report the result alongside existing sandbox/blueprint state.

    Detection logic by provider type:

    Provider Health endpoint Healthy signal
    ollama-local GET http://localhost:11434/api/tags HTTP 200
    nvidia GET https://integrate.api.nvidia.com/v1/models HTTP 200 with valid JSON
    openai GET https://api.openai.com/v1/models HTTP 200
    vllm GET http://localhost:8000/v1/models HTTP 200

    Output change:

    $ nemoclaw my-assistant status
    

    Sandbox my-assistant running
    Blueprint v0.1.0 applied
    Inference ollama-local ✘ UNREACHABLE (localhost:11434 — is Ollama running?)

    vs healthy state:

    Inference    ollama-local    ✓ healthy (llama3.2:1b)
    

    Implementation sketch:

    // In status.ts — after existing sandbox/blueprint checks
    

    async function probeInference(provider: string, endpoint: string): Promise<{ok: boolean, detail: string}> {
    try {
    const controller = new AbortController();
    const timeout = setTimeout(() => controller.abort(), 3000);
    const res = await fetch(endpoint, { signal: controller.signal });
    clearTimeout(timeout);
    if (res.ok) return { ok: true, detail: healthy };
    return { ok: false, detail: HTTP ${res.status} };
    } catch (err: any) {
    if (err.name === 'AbortError') return { ok: false, detail: 'timeout (3s)' };
    if (err.code === 'ECONNREFUSED') return { ok: false, detail: connection refused — is ${provider} running? };
    return { ok: false, detail: err.message };
    }
    }

    Key design decisions:

    • 3-second timeout — fast enough to not slow down status, long enough for a warm Ollama to respond
    • Host-side probe, not sandbox-side — doesn't require exec into the sandbox, works even when the sandbox is degraded
    • The provider type and endpoint are already available from the blueprint config / OpenShell provider state (openshell inference list)
    • Zero new dependencies — uses Node.js built-in fetch (available in Node 20+, which is already a NemoClaw prerequisite)

    What this doesn't fix

    This doesn't fix the silent gateway drop. When the user is already inside the sandbox and the backend goes down mid-session, they'll still get a silent curl failure until the OpenShell gateway is patched to return proper HTTP 502/503 responses. That's an upstream issue for NVIDIA/OpenShell.

    But this gives operators a way to detect the problem before it manifests, and gives the status command the inference visibility it currently lacks.

    Happy to submit a PR for this if maintainers agree with the approach.

  3. added
    UAT
    on Apr 10, 2026
  4. self-assigned this
    on Apr 10, 2026
  5. PrachiShevate-nv commented on Apr 13, 2026

    @PrachiShevate-nv

    This issue is still reproducible with NemoClaw version v0.0.14. Nvbug updated. Re-opening this Github issue.

    Observations:

    min_openshell_version in blueprint.yaml is 0.0.24.
    npm view openshell versions --json shows only "0.1.0", which is greater than 0.0.24.

    openshell --version returns openshell 0.1.0 (or 0.0.26 earlier), which is at or above the minimum.

    Because no below-min OpenShell version exists on npm, you cannot simulate the failure mode; the preflight will always pass with the versions available.

    So:

    Steps to reproduce # 2, 4, 8–10 (reading min version, confirming at/above minimum, onboard passes) are verified.

    Steps to reproduce # 3, 5–7 (install below-min version, see preflight error, then upgrade) are blocked by environment because npm does not provide any openshell version lower than 0.0.24 to install.

  6. added a commit that references this issue on Apr 14, 2026
    d7523c1
  7. added 3 commits that reference this issue on Apr 17, 2026
    b658fe7
    035b514
    efd5a8f
  8. added a commit that references this issue on Apr 21, 2026
    470d0b4
  9. changed the title [-][nemoclaw] [MacOS] No clear error message when Ollama backend is stopped[/-] [+][MacOS] No clear error message when Ollama backend is stopped[/+] on Apr 22, 2026
  10. PrachiShevate-nv commented on Apr 29, 2026

    @PrachiShevate-nv

    Able to reproduce this issue on Nemoclaw v0.0.30. New nvbug opened

  11. PrachiShevate-nv commented on May 8, 2026

    @PrachiShevate-nv

    Verified in NemoClaw v0.0.37, issue does not exist. Closing the bug.

  12. added theissue type on Jun 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

NV QAUAT

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions