Repository navigation
Description
User Story
I use OpenShell on a rootless Podman gateway (RHEL 9.8, Podman 5.8.5, overlay storage) to run NemoClaw sandboxes for an internal agent. I directly encountered this while onboarding a sandbox from the openclaw-sandbox image. The sandbox's state volume takes about 98 seconds to populate on first start, and I need creates to succeed on this host.
Problem Statement
On the Podman driver, when the container start request takes longer than the driver's API timeout, the create is treated as failed while Podman keeps starting the container.
The sequence we captured on a live create, from the gateway journal (UTC):
CreateSandboxaccepted and the container is created.- The start request times out:
Failed to start container; cleaning up error=timeout after 30s. Onv0.0.116the timeout is 30 seconds (crates/openshell-driver-podman/src/client.rs:24). On currentmainandv0.1.9it is 60 seconds. - The driver removes the container, removes the volume and the secrets (
cleanup_all), and returns an error. - The server treats the driver error as a failed create and deletes the sandbox record.
- Podman is still performing the start. Its state-volume copy-up (
About to copy up into volume ...) runs after the driver has given up. The start then completes (HTTP 204). - The container runs without its sandbox record. Its supervisor logs
sandbox not foundon every log push, and the container exits with status 1.
Measured without OpenShell involved, the first start of ghcr.io/nvidia/nemoclaw/openclaw-sandbox into an empty named volume at /sandbox/.openclaw takes about 98 seconds on this host (two runs: 98.25 s and 98.50 s). The same image with a bind mount starts in 2.1 s.
On main and v0.1.9, the 60-second API timeout is still shorter than this start, so the same sequence applies to a 98-second start.
Impact / Why This Matters
When this happens, the create reports failure. Users must delete the half-created sandbox, and the next create with the same name is blocked until the orphaned records are cleared. On this host the orphan records cannot be cleared with nemoclaw <name> destroy, because that command requires a Docker daemon (a separate NemoClaw report, NVIDIA/NemoClaw#14814).
This results in:
- A sandbox that onboarding reports as failed, while the container is actually running and healthy after the start completes.
- Retained recovery records and containers left behind for each failed attempt.
- A create that succeeds in the container but is never usable through OpenShell, since its supervisor cannot find its record.
This matters because any image whose first start populates a large state volume will hit it. Slow storage, a large image, or a loaded host are enough to push the start past the timeout.
Workaround we used on our host: a local patch that re-checks the container state after a start error and keeps the create when the container reports running. It has not been submitted.
Acceptance Criteria
- A Podman start request that exceeds the API timeout, followed by a container that reaches
running, returns success for the create. The sandbox record and state volume are kept. - A start error where the container reaches
exited,stopped, orremoving, or is not found, still cleans up the container, volume, secrets, and sandbox record. - A start error where the container stays
createdis cleaned up after a bounded deadline, not left running indefinitely. - A create whose first start populates a 300 MB state volume (about 100 seconds) on a rootless Podman gateway succeeds, and the supervisor's first log push finds its record.
- The server does not delete the sandbox record while the driver still reports the start as in progress.
Reproduction Steps
Environment for the live result: OpenShell 0.0.116 (tag d1155aa), Podman 5.8.5 rootless, RHEL 9.8.
Steps (live, on one host):
- Use an image whose first start takes more than 30 seconds to populate its state volume. The reporting host used the
openclaw-sandboximage, with about 35,000 entries at/sandbox/.openclaw. - Run
openshell sandbox create --name <name> --from <image>. - Watch the gateway journal and
podman events. The start times out at 30 seconds, the create reports failure, and the container starts about 100 seconds later. - Run
openshell logs <name>. Expectlog push RPC failed: ... sandbox not found.
Driver-level reproduction on main (unit test, stubbed Podman), at 152c59d31:
Test: repro_start_timeout_rolls_back_without_reading_container_state, added to crates/openshell-driver-podman/src/driver.rs in a clone of main. It reuses the existing start-failure test's stub sequence and changes only the failing supervisor start to timeout after 60s.
Result on unpatched main:
REPRO create_result_is_ok=false deletes=9 container_reads_after_last_start=0 requests=45
- The create fails after a start timeout.
- The driver reads no container state after the start error (
container_reads_after_last_start=0). It goes straight to cleanup. - Nine
DELETEcalls follow: the setup and supervisor containers, the volumes, and the secrets.
Limits of the unit result:
- A stubbed Podman, not a live gateway. It shows the driver's decision on
maingiven a start timeout. It does not show the real 98-second copy or the real 60-second timeout. - The stub does not model the container reaching
running. The test shows thatmainnever checks, not what Podman would have reported. - The cleanup also removes
identity-reader, a setup-phase container. That is part of the same cleanup and does not change the finding.
Timing data from the same host:
| Step | Time |
|---|---|
podman create + start of a fresh sandbox container with named state volume |
98.25 s, 98.50 s |
| Same image, bind mount | 2.08 s |
Raw tar -x of the same 35,584 entries onto /home and /tmp |
about 5 s each |
podman pull --policy missing, image cached |
0.24 s |
Suggested UX (if applicable)
No user-facing change is proposed. The fix is in the driver and server: a start error is confirmed against the container's state before any cleanup. A user-visible change, such as a configurable start timeout, is for the maintainers to decide.
Environment
- OpenShell:
0.0.116(openshell 0.0.116, gateway0.0.116). Checked againstmainat152c59d31andv0.1.9. - OS: RHEL 9.8 (kernel 5.14.0-687.60.1.el9_8), x86_64
- OpenShell deployment mode and runtime: rootless Podman 5.8.5, cgroups v2, overlay storage, subuid
165536:65536, gateway run as a user systemd service
Logs
Not attached. The raw journal lines include internal identifiers, so the key lines are quoted in Problem Statement instead.
Activity
abhinavankur-vz commentedon Nov 24, 2026
These are not duplicates of this issue, but they touch the same area:
compute/mod.rs. The maintainers named this gap as still open.driver.rs. Serializes lifecycle calls. Does not change the start-error cleanup. Expect a textual conflict indriver.rsif both land.abhinavankur-vz commentedon Nov 24, 2026
Clarifying one step in the description before a maintainer relies on it.
The description says the server "deletes the sandbox record" after a driver create error. That step comes
from reading the source, not from the captured journal:
v0.0.116:crates/openshell-server/src/compute/mod.rs:1029-1045deletes the store record and removesthe sandbox from the index in the
Errbranch of the driver call.main(152c59d31): the same deletion runs throughcompensate_failed_create_inner(mod.rs:1948),which begins a sandbox delete and then deletes the backend.
The captured journal for the failed create (Nov 23, 19:44 to 19:52 UTC) shows the store reconciliation
sweep timing out and the container being removed. It has no store-level delete line, so the record removal
itself was not observed in logs. The
sandbox not foundlines from the supervisor show the record wasgone by the time it pushed logs.
If a maintainer wants this observed rather than read from source, we can capture a store-level trace on a
repro.