Skip to content

[WSL2 x86_64][Sandbox] OpenShell supervisor fails to reconnect to GPU-patched sandbox container; sandbox enters Error phase #4664

Description

@wangericnv

Description

On WSL2 (Ubuntu 24.04 inside Win 11 + Docker Desktop, RTX 5090), NemoClaw onboard reaches [6/8] Creating sandbox successfully — 80/80 Dockerfile steps complete, the GPU-patched container starts with --gpus all OK and shows Status=running, ExitCode=0, Health=starting. But the OpenShell supervisor fails to reconnect to the new GPU-enabled container within the patch timeout, causing the sandbox to enter Error phase. Onboard exits 1 before first-prompt verification can run.

Environment

Device:        WSL2 x86_64 (Win 11 host) — 2u2g-gen-0689 (10.57.210.126)
OS:            Ubuntu 24.04 (WSL2) on Windows 11 Enterprise Build 26100
Architecture:  x86_64
Node.js:       v22.x
npm:           10.x
Docker:        Docker Desktop with WSL2 backend (29.x)
OpenShell CLI: 0.0.44
NemoClaw:      0.1.0 (main HEAD, NEMOCLAW_INSTALL_REF=main; release-tag-equivalent v0.0.57 unreleased)
OpenClaw:      N/A (sandbox never reached Ready)
GPU:           NVIDIA GeForce RTX 5090 (32 GB, sm_120/sm_121 Blackwell)
Provider:      Win-host Ollama (passwordless sudo + NEMOCLAW_PROVIDER=ollama)

Steps to Reproduce

  1. WSL2 prep on 10.57.210.126 (one-time) — sudo visudo -f /etc/sudoers.d/lab add lab ALL=(ALL) NOPASSWD: ALL
  2. Clean wipe in WSL:
    rm -rf ~/.nemoclaw ~/.config/openshell ~/.local/state/nemoclaw \
           ~/.local/bin/nemoclaw ~/.local/bin/openshell*
  3. Run non-interactive install:
    NEMOCLAW_ACCEPT_THIRD_PARTY_SOFTWARE=1 NEMOCLAW_NON_INTERACTIVE=1 \
    NEMOCLAW_PROVIDER=ollama NEMOCLAW_MODEL=qwen2.5:7b \
    NEMOCLAW_YES=1 NEMOCLAW_POLICY_MODE=suggested NEMOCLAW_INSTALL_REF=main \
      bash -c 'curl -fsSL https://www.nvidia.com/nemoclaw.sh | bash'
  4. Wait for full flow: installer download (~3s), node + nemoclaw CLI build (~30s), openshell install, onboard [1-4/8] inference setup, [6/8] sandbox build (80/80 steps, ~10 min)
  5. Right after "Built image openshell/sandbox-from:<tag>" and "Waiting for sandbox to become ready..." the GPU patch begins
  6. Within ~12s the onboard prints "Docker GPU patch failed" and exits RC=1

Expected Result

After GPU patch recreates the sandbox container with --gpus all, OpenShell supervisor should reconnect to the new container, the sandbox phase should transition to Ready, and onboard should proceed to [7/8] / [8/8].

Actual Result

From ~/.nemoclaw/onboard-failures/<ts>-my-assistant-docker-gpu-patch/summary.txt:

  • error = OpenShell supervisor did not reconnect to the GPU-enabled container.
  • failure_kind = sandbox_error_phase
  • failure_headline = OpenShell sandbox entered Error phase before the GPU proof could run.
  • sandbox_phase = Error
  • gpu_mode_attempts: --gpus all: ok — the patch itself succeeded
  • patched_container_status = running
  • patched_container_exit_code = 0
  • patched_container_health = starting

The new GPU-patched container IS running and healthy — but the supervisor reconnect step times out, so onboard treats it as fatal even though the underlying container is fine.

Looks like a reconnect-timing race specific to WSL2/Docker-Desktop (the new container takes a moment longer to fully initialize OCSF supervisor than on native Linux, but the reconnect deadline doesn't account for it).

Logs

docker-logs.txt (new GPU-patched container 88a80839d028…) — supervisor DID start:

2026-06-02T07:55:59.211Z INFO openshell_sandbox: Starting sandbox
2026-06-02T07:55:59.222Z INFO openshell_sandbox: Creating OPA engine from proto policy data
2026-06-02T07:55:59.336Z OCSF CONFIG:DEGRADED [MED] nft not found; bypass detection rules will not be installed
2026-06-02T07:55:59.349Z OCSF NET:LISTEN [INFO] 10.200.0.1:3128
2026-06-02T07:55:59.352Z OCSF SSH:LISTEN [INFO]
2026-06-02T07:55:59.352Z OCSF LIFECYCLE:INSTALL [INFO] OpenShell Sandbox Supervisor success
2026-06-02T07:55:59.352Z INFO openshell_sandbox: supervisor session task spawned

Then ~12 seconds later onboard says GPU patch failed and sandbox = Error.

Phase timings (from INSTALL-START at 0.00s)

Phase Wall time
preflight [1/8] 48.5s
gateway [2/8] 50.7s
inference config [3/8] 51.7s
route set ollama-local / qwen2.5:7b 64.8s
sandbox build start 89.4s
step 80/80 done 677.2s (~10 min — ~2× slower than Spark Path A's 310s, Docker Desktop overhead)
"Built image" emitted 683.8s
"Recreating OpenShell Docker sandbox container with NVIDIA GPU access..." 688s
"Docker GPU patch failed" 697.5s (≈ 14s after recreate started)

Sandbox built fine, gpu_mode_attempts: --gpus all: ok — only the supervisor reconnect failed.

SECURITY-degraded markers in OCSF log

Documented for completeness — these are NOT the cause; they just document the WSL2 environment:

  • [SECURITY WARNING] setpriv or CAP_SETPCAP unavailable — falling back to gosu
  • [SECURITY] CAP_SETPCAP not available — cannot drop bounding-set caps via capsh
  • [SECURITY] Residual CapBnd=00000004a82c35fb
  • Dangerous caps remain in bounding set: cap_sys_admin,cap_sys_ptrace,cap_net_raw,cap_dac_override,cap_net_bind_service

Diag bundle

~/.nemoclaw/onboard-failures/2026-06-02T07-55-59-515Z-my-assistant-docker-gpu-patch/ (8 files: summary.txt, docker-inspect.json, docker-logs.txt, docker-network-summary.txt, docker-ps.txt, openshell-sandbox-get.txt, openshell-sandbox-list.txt, patched-container-state.json).

Related context

NOT duplicate of:

  • NVBug 6175942 — Spark/Station GPU patch fails at /proc/comm write (different mechanism: patch itself fails on Spark; here the patch succeeds but the supervisor-reconnect step fails)
  • NVBug 6235316 (Ollama proxy port 11435 blocks 5 cases) — Win-host Ollama via NEMOCLAW_PROVIDER=ollama worked here, so unrelated

Suggested fixes

  1. Increase supervisor-reconnect timeout for WSL2/Docker-Desktop platform detection
  2. If the patched container is Status=running + Health=starting, retry reconnect rather than declaring fatal
  3. OR: don't tear down the old container until the new one's supervisor responds successfully (rollback path)

NVB#6256537

Activity

  1. added
    NV QA
    UAT
    on Jun 2, 2026
  2. wangericnv commented on Jun 2, 2026

    @wangericnv
    CollaboratorAuthor

    Update 2026-06-02: This issue is NOT WSL2-specific — it also reproduces on DGX Spark during cached re-onboard.

    Spark repro evidence

    Host: 10.173.104.102 (spark-8158, GB10 sm_121, driver 580.142, Ubuntu 24.04 aarch64).

    After a fresh Path A install completed successfully and a sandbox ran healthily, ran install.sh again with model + sandbox-base image + sandbox-from layer cache all warm:

    • Total cached install: 272.57s (3.5× faster than fresh 956s baseline)
    • Onboard reached the same Recreating OpenShell Docker sandbox container with NVIDIA GPU access step
    • Hit the exact same failure as WSL2:
      • patched_container_status=running
      • patched_container_exit_code=0
      • patched_container_health=healthy
      • But sandbox_phase=Error
      • gpu_mode_attempts: --gpus all: ok — patch itself succeeded; supervisor reconnect timed out
    • Diagnostics saved at /home/nvidia/.nemoclaw/onboard-failures/2026-06-02T09-13-23-956Z-my-assistant-docker-gpu-patch

    Implications

    This is a generic OpenShell supervisor reconnect timing race, not a WSL2/Docker-Desktop specific issue. Re-onboards across all platforms (cached or fresh) likely hit this when the new GPU-patched container is healthy+running but the supervisor's reconnect deadline is too tight.

    Cost impact: the 272s cached install would drop to ~50s if this reconnect step succeeded — meaning ~80% of the cached re-install wall-clock cost on Spark is wasted waiting for this failure.

    Suggested re-classification

  3. self-assigned this
    on Jun 2, 2026
  4. added a commit that references this issue on Jun 2, 2026
    a2c020d
  5. added
    needs: triage
    and removed on Jun 3, 2026
  6. wscurran commented on Jun 3, 2026

    @wscurran
    Contributor

    Regression, confirmed by QA.

  7. prekshivyas commented on Jun 3, 2026

    @prekshivyas
    Collaborator

    Repro attempt on Brev — bug did NOT reproduce on Linux x86_64 / T4

    I tried to reproduce on a Brev n1-standard-4:nvidia-tesla-t4:1 (Ubuntu 22.04, Docker 29.1.3, NVIDIA driver 580.126.09, T4 GPU). Ran the exact install command from the original repro (with NEMOCLAW_PROVIDER=install-ollama since the host had no Ollama running) on main HEAD 5fcfcd9 — confirmed post-#4668 (docker-gpu-supervisor-reconnect.ts module present on disk).

    Result: clean success in 294s total. The GPU patch step:

    Recreating OpenShell Docker sandbox container with NVIDIA GPU access...
    ✓ Docker GPU mode selected: --gpus all
    Waiting for sandbox to become ready...
    ✓ Dashboard is live
    ✓ GPU proof passed: nvidia-smi when available
    ✓ GPU proof passed: /proc/<pid>/task/<tid>/comm write
    ✓ GPU proof passed: cuInit(0) via libcuda.so.1
    ✓ Sandbox 'my-assistant' created
    

    No transient Error phase, no debounce activation, supervisor reconnected before any retry was needed.

    Implication: the bug is environment-specific. The platforms that reproduce (WSL2 + Docker Desktop at 697s; DGX Spark cached re-onboard at 272s) share characteristics that Brev T4 doesn't — VHDX disk overhead on WSL2, or aarch64 + cache-warm fast iteration on Spark — which compress or extend the recreate window into the cache-divergence danger zone. Linux x86_64 + native Docker + persistent SSD (this Brev configuration) doesn't expose it.

    What the original data already tells us about #4668's fix being insufficient:

    The original WSL2 OCSF logs in this issue show the supervisor started at T+0.211s after container start and logged LIFECYCLE:INSTALL OpenShell Sandbox Supervisor success at T+0.352s. Onboard reported "Docker GPU patch failed" approximately 12 seconds later — meaning the openshell host's sandbox list cache was still showing Error or the gateway couldn't reach the supervisor for 12+ seconds after the supervisor was actually up.

    #4668 set the debounce default to K=5 consecutive polls × 2s sleep = ~10 seconds of sustained Error tolerated before fast-fail. The same issue's own observed cache divergence outlasts that window. So on the same platform that prompted the fix, K=5 would still fast-fail just ~10s later than before instead of fixing it.

    Recommended next iteration (no new diag bundle strictly needed):

    1. Bump the default DOCKER_GPU_SUPERVISOR_RECONNECT_ERROR_PHASE_DEFAULT_DEBOUNCE_POLLS from 5 to at least 15 (~30s) — this is what the troubleshooting docs added in fix(onboard): debounce Docker GPU patch supervisor reconnect Error-phase short-circuit #4668 already suggest for slow hosts; making it the default removes the "user must know to set the env var" requirement.

    2. Consider implementing the original issue's suggestion Change small local model to qwen3.5:9b #3 — delay dockerRm(backupContainerName) at docker-gpu-patch.ts:964 until after the supervisor-reconnect succeeds. This makes the bug non-fatal regardless of how long the cache divergence lasts — if supervisor never reconnects, restore the backup. The gatewayName registry persistence fix(onboard): bind gateway name, state dir, and marker per gateway port (#4422) #4645 added is a useful adjacent for tracking which container is "live".

    Confirmation request for QA / @wscurran: could you paste the elapsed time between "Recreating OpenShell Docker sandbox container" and "Docker GPU patch failed" from the regression repro? If it's around 9.5s (matching pre-#4668) → debounce was bypassed entirely (different failure path). If it's ~10-20s → K=5 was hit and exhausted, bumping the default would fix that platform. Either answer narrows the next iteration.

  8. added and removed on Jun 4, 2026
  9. wangericnv commented on Jun 4, 2026

    @wangericnv
    CollaboratorAuthor

    QA re-test on main HEAD (post-#4668), 2026-06-03 — fix holds on both platforms that originally reproduced.

    Tested on NEMOCLAW_INSTALL_REF=main (v0.1.0 / OpenClaw 2026.5.22), Cloud-API provider (NVIDIA Endpoints):

    • DGX Spark, cached re-onboard (originally 272s repro): Recreating OpenShell Docker sandbox container with NVIDIA GPU access... → ✓ Sandbox 'my-assistant' created = 16.6s, then ✓ Deployment verified — gateway and dashboard are healthy. No Docker GPU patch failed line at all — the OpenShell supervisor reconnected successfully; no fast-fail, debounce window not exhausted.
    • WSL2 + Docker Desktop (RTX 5090) (originally 697s repro): full onboard reached ✓ Deployment verified and the sandbox came up with sandbox GPU Ready. This was Docker GPU patch failed pre-fix on 6/2; now passes.

    So on the two platforms called out as reproducing (Spark cached / WSL2), #4668 now lets the GPU-patch supervisor reconnect succeed — I did not observe the K=5 debounce window being exhausted in either run. On that basis NVBug 6256537 was marked QA-Closed-Verified.

    Re: the confirmation request — I could not produce a Docker GPU patch failed line on either platform post-fix, so there's no Recreating→failed elapsed to report from my runs. If there's a new regression repro that still prints Docker GPU patch failed, please share that run's log/diag bundle and I'll pull the exact elapsed (and we can decide whether bumping the debounce default 5→15 or deferring the backup-container removal is still warranted as hardening).

  10. added
    area: sandbox
    platform: wsl
    and removed
    needs: triage
    on Jun 5, 2026
  11. added theissue type on Jun 5, 2026
  12. added a commit that references this issue on Jun 5, 2026
    43efeba
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

NV QAUATarea: sandboxplatform: wsl

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions