NemoClaw icon indicating copy to clipboard operation
NemoClaw copied to clipboard

[hermes] sandbox stop/start wipes data

Open oparoz opened this issue 4 months ago • 4 comments

Investigation Summary

No response

Description

From the documentation:

Stop a sandbox’s container to free CPU, memory, and GPU resources without losing anything: nemohermes <sandbox-name> stop

Unfortunately, if you do this, then the files in the sandbox are reset to a default state. Custom skills are gone, memory is gone, achievements db is gone, session DB is gone, etc. At least. the config, env and policies are not modified.

Reproduction Steps

  1. nemohermes <sandbox-name> stop
  2. nemohermes <sandbox-name> start

Environment

  • Hardware: GB10 platform
  • OS: Ubuntu 24.04 LTS
  • OpenShell 0.0.72
  • NemoClaw 0.0.88
  • Hermes Agent 2026.7.1

Debug Output

N/A

Logs

$ nemoclaw hermesbox stop
  Hermes Agent gateway is managed by the sandbox; leaving it running while host forwards stop.
  Stopping container 'openshell-hermesbox-1234'…
openshell-hermesbox-1234
  Sandbox 'hermesbox' stopped. Workspace state is preserved.
  Start it again with 'nemoclaw hermesbox start'.

$ nemoclaw hermesbox start
openshell-hermesbox-1234
  Container 'openshell-hermesbox-1234' started.
  Checking gateway health and host forwards…
✓ Active gateway set to 'nemoclaw'
  Probe complete: recovered Hermes Agent gateway in 'hermesbox'.

Checklist

  • [x] I confirmed this bug is reproducible
  • [x] I searched existing issues and this is not a duplicate

oparoz avatar Jul 19 '26 11:07 oparoz

Could be related to https://github.com/NVIDIA/NemoClaw/issues/7173

oparoz avatar Jul 19 '26 12:07 oparoz

Automated triage of this data-loss report. This is a real and serious bug, but the fix is primarily upstream (OpenShell PVC lifecycle) and can't be verified without a real GB10/DGX sandbox with populated workspace data — so I'm unassigning after a full source trace, with a precise handoff. Flagging it as data-loss worth prioritizing + escalating to OpenShell.

Correction to the likely-cause hypothesis

start does not recreate the container from the image. nemoclaw <sandbox> start does a plain docker start of the same stopped container (src/lib/actions/sandbox/start.ts:99 → src/lib/onboard/docker-driver-sandbox-recovery.ts:241-252, via: "started-stopped-original" = dockerStart(stoppedOriginal.name)); the paused/backup branches docker unpause/docker rename+docker start. No docker run/image-recreate exists in the start path. That the container name (openshell-hermesbox-1234) is identical across stop/start is consistent with docker start of the same container.

Where the data actually lives — an OpenShell-owned PVC, not a NemoClaw volume

The workspace /sandbox (agent skills/, memories/, sessions/, achievements/session state.db) is seeded empty at image build time (agents/hermes/Dockerfile:478-567; no VOLUME declaration). The durable copy lives on a k3s local-path PVC keyed by sandbox name, inside the shared openshell-cluster-nemoclaw Docker volume — documented in src/lib/actions/sandbox/wipe-state.ts:35-52: "the durable PVC retention is owned upstream by OpenShell." NemoClaw never mounts /sandbox (sandbox create passes no workspace -v/--mount; volume topology is entirely OpenShell's).

Why config/env/policies survive but workspace data doesn't

Only config/env/policy have an active restore path on start:

  • Config/env are baked into the image and re-seeded/verified on every startup (scripts/nemoclaw-start.sh empty-config baseline; Hermes start.sh config-integrity restore).
  • Network policy / inference route / forwards are re-applied host-side by NemoClaw on start (connect.ts reapply-route/forwards; initial-policy.ts).
  • Workspace user-data has NO equivalent restore — nothing in start.ts/connect.ts/start.sh re-materializes user skills/memories/DBs. So after a direct docker start that comes up without the PVC content, config/policy get rebuilt and look preserved while /sandbox reverts to the empty image default and looks wiped.

Root-cause boundary (NemoClaw vs OpenShell)

  • Upstream OpenShell (the actual data-loss mechanism): whether the per-sandbox PVC is correctly re-attached when an OpenShell-managed pod container is stopped/started directly via Docker (out from under OpenShell). NemoClaw's stop/start deliberately bypass the OpenShell sandbox lifecycle — a repo-wide search finds only openshell sandbox create/delete/list/exec and forward stop; there is no openshell sandbox stop/start invocation. stop is a direct dockerStop (stop.ts:168); start is a direct dockerStart. If a raw docker start of a k3s pod container doesn't remount the PVC (or k3s reconciles the pod to a fresh spec), /sandbox reverts to the image default — that behavior is OpenShell/k3s, not NemoClaw TS.
  • NemoClaw's fixable parts (TS):
    1. The design decision to drive the container directly (gateDirectDriverLifecycle, stop.ts:56-80) instead of the OpenShell sandbox lifecycle — changing this is a lifecycle-architecture decision and its data-preservation effect is unverified.
    2. The misleading, unconditional "Workspace state is preserved" print at stop.ts:184 — it fires whenever every docker stop returns 0, with no workspace verification, and stop.test.ts:88-97 only asserts the string is printed. At minimum this message should not promise preservation it cannot guarantee.

Why I'm not landing it unattended

  • The real fix (PVC-on-direct-docker start) is upstream OpenShell, not this repo.
  • Any NemoClaw-side change (switch stop/start to openshell sandbox stop/start, or restore workspace on start, or gate the message) is a data-loss-critical design decision whose correctness can only be confirmed by reproducing on a real GB10/DGX sandbox with populated workspace data and the k3s+PVC topology — not unit-testable on a plain host. A message-only change would make the print honest but would not fix the data loss.

Recommended: escalate the PVC re-attachment-on-restart behavior to the OpenShell/container-driver owners with this repro; and separately, in NemoClaw, either move stop/start onto the OpenShell sandbox lifecycle or gate the "Workspace state is preserved" message on a verified condition. No existing test covers start-preserves-workspace-data.

jason-ma-nv avatar Jul 19 '26 12:07 jason-ma-nv

Stale-issue verification — inconclusive

Reported on: v0.0.88 Verified on: n/a Verification mode: static reproducer review; no execution target leased.

The run could not establish the complete reported-release baseline and newest-release comparison required for a fixed verdict. The reported-release baseline did not produce a validated symptom match.

No Project field or label change is proposed. @oparoz — please reply with the missing environment detail or a revised reproducer.

prekshivyas avatar Aug 17 '26 08:08 prekshivyas

Hi @oparoz, thanks for reporting the loss of Hermes workspace data after stop/start. We’re planning an updated architecture for NemoClaw, so we’re retiring this earlier lifecycle follow-up as not planned. Direct container control was replaced with OpenShell-owned stop/start in #11909.

If this is still an issue that needs prioritization, please re-open and tag @wscurran.

wscurran avatar Nov 18 '26 03:11 wscurran