[Ubuntu 24.04][Sandbox] Custom Dockerfile onboarding for langchain-deepagents-code fails with 'Docker GPU patch failed' even with --no-gpu
- Dominant language
- TypeScript
- Stars
- 22.5k
- Forks
- 3.1k
- Avg merge
- 1d 1h
- Merged PRs (30d)
- 715
Description
## Description
`nemoclaw onboard --agent langchain-deepagents-code --from {Dockerfile}` fails during sandbox creation with a "Docker GPU patch failed" error and leaves the sandbox stuck in Error phase, even on hosts with no GPU hardware and with `--no-gpu` / `NEMOCLAW_SANDBOX_GPU=0` explicitly set. The identical custom-Dockerfile recipe works cleanly for the `openclaw` agent on the same hosts, so this is specific to the `langchain-deepagents-code` runtime.
Related, not duplicate: #7996 (still open) reports a different symptom on the same general area (custom `--from` Dockerfile onboarding) — that report is about OpenClaw silently not starting (sandbox reaches Ready but OpenClaw process never runs) due to missing runtime scripts in the patched image. This report's failure happens earlier and harder: sandbox creation itself aborts into Error phase before OpenClaw/dcode ever starts, specific to the deepagents-code agent. Also related: #11415 (open) covers `--fresh` not reclaiming a route reservation after a custom-image build failure; this report's sandboxes end up similarly stuck/undeletable after the failure, though the trigger (a full onboard failure well after the image build step, not a build failure itself) differs.
Platform scope: Reproduced on 2 independent hosts (Ubuntu 26.04 and Ubuntu 24.04.4, both x86_64, both with no GPU hardware); other platforms not tested.
Regression: Unknown — earlier versions not tested for this exact combination.
OpenShell issue: No
## Environment
```text
Device: Ubuntu 24.04.4 LTS x86_64 server, no GPU
OS: Ubuntu 24.04.4 LTS
Architecture: x86_64
Node.js: v22.23.2
npm: 10.9.8
Docker: 29.5.2
OpenShell CLI: 0.0.116
NemoClaw: v0.0.126
OpenClaw: N/A (this agent runtime is langchain-deepagents-code, not OpenClaw; onboard did not complete)
```
## Steps to Reproduce
1. Create a custom Dockerfile based on the current `langchain-deepagents-code` sandbox image:
```dockerfile
FROM ghcr.io/nvidia/nemoclaw/langchain-deepagents-code-sandbox@{current-digest}
ARG NEMOCLAW_TOOL_DISCLOSURE=progressive
ENV NEMOCLAW_TOOL_DISCLOSURE=${NEMOCLAW_TOOL_DISCLOSURE}
LABEL custom.image=test-fixture
```
2. Place the Dockerfile in its own empty directory (so the Docker build context does not include unrelated host directories).
3. Run:
```bash
nemoclaw onboard --agent langchain-deepagents-code --from {path-to-Dockerfile} --name {sandbox} --yes --yes-i-accept-third-party-software --non-interactive --no-gpu --fresh
```
4. For contrast, run the identical command shape with `--agent openclaw` and the Dockerfile's `FROM` line swapped to the openclaw sandbox image instead.
## Expected Result
Step 3: onboarding completes and the sandbox reaches Ready, consistent with step 4's openclaw behavior using the same recipe.
## Actual Result
Step 3 fails during sandbox creation:
```text
Docker GPU patch failed.
OpenShell supervisor did not reconnect to the recreated container; pre-patch sandbox restored.
OpenShell sandbox entered Error phase before the GPU proof could run.
sandbox_phase=Error
patched_create_option=persistent sandbox startup command
Error: Sandbox post-create verification or finalization failed; automatic sandbox cleanup was not safe.
```
This happens despite `--no-gpu` being passed, and in later attempts with `NEMOCLAW_SANDBOX_GPU=0` also set explicitly (the error message's own suggested escape hatches) — neither prevents the failure. Both test hosts have no GPU hardware at all (`nvidia-smi` fails with "couldn't communicate with the NVIDIA driver" on both).
After the failure, `nemoclaw {sandbox} destroy --yes` also fails:
```text
Refusing to delete retained sandbox '{sandbox}': OpenShell reports a sandbox present under this name. NemoClaw cannot bind a mutable-name delete to the retained record ... without an atomic OpenShell delete-by-identity primitive.
```
The only workaround found is choosing a different sandbox name for the next attempt.
Step 4 (control): the identical recipe with `--agent openclaw` succeeds cleanly on both hosts, reaching Ready with a working sandbox — confirming this is specific to `langchain-deepagents-code`, not a general custom-Dockerfile or no-GPU-host issue.
Reproduced 3 times total across the 2 hosts (2 attempts on host 1 with two different sandbox names, 1 attempt on host 2, a completely independent, previously-untouched machine) — all 3 failed identically.
## Logs
```text
Full failure output from host 2 (Ubuntu 24.04.4):
Waiting for OpenShell supervisor to reconnect to the recreated container (up to 900s)...
Docker GPU patch failed.
OpenShell supervisor did not reconnect to the recreated container; pre-patch sandbox restored.
OpenShell sandbox entered Error phase before the GPU proof could run.
sandbox_phase=Error
sandbox_list_row={sandbox} {timestamp} Error
patched_create_option=persistent sandbox startup command
Escape hatches:
NEMOCLAW_DOCKER_GPU_PATCH=1 use only the Docker GPU compatibility path.
NEMOCLAW_DOCKER_GPU_PATCH=0 use native OpenShell GPU injection (ignored on Docker Desktop WSL; Jetson also defaults to the compatibility path).
NEMOCLAW_SANDBOX_GPU=0 skip GPU passthrough entirely (or rerun with --no-gpu).
The pre-patch sandbox container was restored and started.
Error: Sandbox post-create verification or finalization failed; automatic sandbox cleanup was not safe. NemoClaw left sandbox '{sandbox}' in place after post-create verification or finalization failed. Do not delete the sandbox by mutable sandbox name. Run 'nemoclaw {sandbox} destroy'. If OpenShell reports the sandbox present or cannot determine presence, destroy removes nothing and preserves the recovery record.
Attempting destroy afterward:
$ nemoclaw {sandbox} destroy --yes
Refusing to delete retained sandbox '{sandbox}': OpenShell reports a sandbox present under this name. NemoClaw cannot bind a mutable-name delete to the retained record (create-attempt label '{label}') without an atomic OpenShell delete-by-identity primitive. No sandbox resources were removed. Preserve the recovery record.
```
Contributor guide
Research direction
Start with the `nemoclaw onboard --agent langchain-deepagents-code --from` entry point and trace the Docker GPU patch, supervisor reconnect, and post-create verification path. Compare that flow with the successful `openclaw` path using the same custom Dockerfile and no-GPU settings; done means onboarding reaches Ready without the GPU patch failure and the retained sandbox can be handled safely.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- docker, node.js, typescript
- Domain
- backend, devops, infrastructure
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 52/100