NemoClaw icon indicating copy to clipboard operation
NemoClaw copied to clipboard

[NemoClaw][onboard][All Platforms] nemoclaw installer strict pre-upgrade backup fails when a registered sandbox is not running

Open zNeill opened this issue 4 months ago • 10 comments

Description

Description

Running the one-line installer to upgrade/install NemoClaw at tag v0.0.76 fails during the pre-upgrade backup phase. The installer enumerates registered sandboxes, finds one (my-assistant) that is not currently running, skips it rather than backing it up, and then treats that skip as a fatal condition because "strict pre-upgrade backup requires every registered sandbox to be backed up."

This is a logic problem in the strict-backup gate: a stopped sandbox is a legitimate, benign state (nothing to back up from a live process, and the on-disk state is already at rest), but the installer classifies it identically to a failure. The result is that any user with even one stopped-but-registered sandbox cannot upgrade via the installer without manual intervention, and the error message doesn't tell them what that intervention is.

The NemoClaw CLI itself installs successfully (clone, build, link all complete, nemoclaw is verified on PATH) before the backup step aborts the run. OpenShell CLI installation is deferred and never happens because the backup gate fails first, leaving the environment in a half-upgraded state.

Environment:

  • Host: macOS (Mac Studio), user hellonemoclaw
  • Node.js: v22.23.1, npm 10.9.8
  • Installer command: curl -fsSL https://www.nvidia.com/nemoclaw.sh | NEMOCLAW_INSTALL_TAG=v0.0.76 bash
  • Target install tag: v0.0.76
  • Registered sandboxes: 1 (my-assistant), not running

Steps to reproduce

  1. On a machine that has at least one previously registered NemoClaw sandbox that is currently stopped (e.g. my-assistant), confirm it exists but is not running:
   openshell sandbox list
  • Run the installer for a specific tag:
  •    curl -fsSL https://www.nvidia.com/nemoclaw.sh | NEMOCLAW_INSTALL_TAG=v0.0.76 bash
  • Let the installer proceed through the Node.js check and the NemoClaw CLI build/link phase.
  • Observe the pre-upgrade backup phase.
  • Expected output

    One of the following, in decreasing order of preference:

    • Preferred: stopped sandboxes are treated as successfully "handled" by the backup step (either backed up from their on-disk state, or explicitly recorded as "no live state to snapshot, on-disk state preserved") and the installer proceeds to install the OpenShell CLI and finish cleanly.
    • Acceptable: if a stopped sandbox truly cannot be backed up by design, the installer prints the exact remediation command (e.g. openshell sandbox start my-assistant or nemoclaw sandbox backup my-assistant --offline) and offers a --skip-backup / NEMOCLAW_SKIP_PREUPGRADE_BACKUP=1 escape hatch that is documented in the error output.

    In either case, the installer should not leave the environment in a partially upgraded state (new NemoClaw CLI linked, OpenShell CLI install deferred and never executed) after aborting.

    Actual output

    [INFO]  Backing up 1 sandbox(es) before upgrading OpenShell…
    [INFO]  Preparing current NemoClaw CLI for pre-upgrade backup…
    [INFO]  Installer payload is not a persistent source checkout — installing from GitHub…
    [INFO]  Installing NemoClaw from GitHub…
    [INFO]  Resolved install ref: v0.0.76
      ✓  Cloning NemoClaw source
      ✓  Preparing OpenClaw package
      ✓  Installing NemoClaw dependencies
      ✓  Building NemoClaw CLI modules
      ✓  Building NemoClaw plugin
      ✓  Linking NemoClaw CLI
    [INFO]  Deferring OpenShell CLI installation until after pre-upgrade backup.
    [INFO]  Verified: nemoclaw is available at /Users/hellonemoclaw/.local/bin/nemoclaw
      Skipping 'my-assistant' (not running)
      Pre-upgrade backup: 0 backed up, 0 failed, 1 skipped
      Strict pre-upgrade backup requires every registered sandbox to be backed up; 1 sandbox(es) were skipped.
      Resolve each skipped sandbox using its reason above and retry.
    [ERROR] Pre-upgrade backup failed. Resolve every reported sandbox backup failure and rerun the installer.

    Notable specifics:

    • 0 backed up, 0 failed, 1 skipped — no actual failure occurred; the skip is the failure.
    • The reason printed is (not running), which is a state, not an error.
    • The final [ERROR] line says "Resolve every reported sandbox backup failure" — but nothing failed to back up. The wording misleads the user into looking for a nonexistent failure.
    • No remediation command is offered.
    • OpenShell CLI installation was deferred and never ran, so the machine is left in a half-upgraded state.

    Additional notes / suspected cause

    The strict-backup gate appears to be counting skipped sandboxes as if they were failed, when the skip reason is a benign lifecycle state (not running). The fix likely belongs in whichever module tallies the pre-upgrade backup outcomes: skips with reason not running (and probably any reason that indicates "nothing live to back up") should be classified as "handled" rather than counted against the strict-all-backed-up invariant, or the strict gate should have a documented environment-variable override so users can proceed without hand-editing the installer.

    Bug Details

    Field Value
    Priority Unprioritized
    Action Dev - Open - To fix
    Disposition Open issue
    Module Machine Learning - NemoClaw
    Keyword NemoClaw, NEMOCLAW_GH_SYNC_APPROVAL, NemoClaw_Onboard

    [NVB#6432172]

    zNeill avatar Jul 08 '26 22:07 zNeill

    Investigated — the not-running strict-fail is deliberate (#6114); needs a maintainer decision, not a silent change

    I traced the strict pre-upgrade backup gate to confirm whether the not-running → fail behavior is a bug or intended.

    Where it lives: src/lib/actions/maintenance.ts backupAll():

    • A not-running sandbox is skipped and counted in skipped (maintenance.ts:51-54).
    • The strict gate fails on any skipped > 0, regardless of reason (maintenance.ts:146-153): if (failed > 0 || (requireAll && skipped > 0)) process.exit(1).

    This is deliberate, not accidental. There is an explicit regression test asserting exactly this:

    • src/lib/actions/maintenance.test.ts:140 — "fails installer-strict backup when a registered sandbox is not Ready (#6114)" — sets NEMOCLAW_REQUIRE_ALL_SANDBOX_BACKUPS=1 with one Ready + one not-Ready sandbox and asserts exit 1 with the exact "requires every registered sandbox to be backed up" message.

    So this issue asks to reverse the #6114 design decision. There's also a body of related deliberate work on how upgrades handle not-ready/legacy sandboxes (#6362 "recover legacy sandboxes safely", #6305 "recover gateway-orphaned sandboxes during in-place upgrade", #6130 "honour installer restore intent on non-interactive not-ready sandbox"), which suggests the intended flow for a stopped sandbox is recover/handle it, not silently skip it. I don't want to ram a reversal of that through the auto-fix loop.

    Two separable questions for a maintainer:

    1. Design (needs a decision): Should a (not running) skip count against the strict NEMOCLAW_REQUIRE_ALL_SANDBOX_BACKUPS invariant? The reporter argues a stopped sandbox has no live state and its on-disk state is preserved through a CLI/OpenShell upgrade, so requiring its backup is a false positive. #6114 deliberately decided the opposite. If the reporter's argument wins, the fix is to split the skipped tally so not-running skips are "handled" and excluded from the strict gate — and #6114's test must be updated in the same change to document the new contract.

    2. Safe UX fix (no design change needed): Independent of (1), the failure output is misleading today: with 0 backed up, 0 failed, 1 skipped, the final line reads "Resolve every reported sandbox backup failure" even though nothing failed (maintenance.ts:151 + the installer wrapper), and no remediation command or documented escape hatch is offered. Clarifying that skips aren't failures and printing an actionable next step (e.g. start the sandbox, or a documented NEMOCLAW_SKIP_PREUPGRADE_BACKUP-style override) can land without touching the #6114 gate.

    Unassigning so a maintainer can own the design call in (1); (2) is a safe follow-up either way.

    jason-ma-nv avatar Jul 08 '26 22:07 jason-ma-nv

    Reproduced on a different platform via a real in-place UPGRADE, and confirmed the installer's only advertised override does NOT cover this case.

    Platform: DGX Spark (GB10), Ubuntu 24.04.4 LTS, aarch64 Node v22.23.1 | npm 10.9.8 | Docker 29.2.1 | NemoClaw upgrade v0.0.76 -> v0.0.78 | OpenShell 0.0.72

    Scenario: a real in-place upgrade (curl|bash, NEMOCLAW_INSTALL_TAG=v0.0.78) on a host with 14 registered sandboxes -- 8 in Error phase, the rest Provisioning or registered against a non-active gateway. The strict pre-upgrade backup skipped all 14 as "(not running)" and aborted: Pre-upgrade backup: 0 backed up, 0 failed, 14 skipped Strict pre-upgrade backup requires every registered sandbox to be backed up; 14 sandbox(es) were skipped. [ERROR] Pre-upgrade backup failed. Same half-upgraded end state as the original report: the NemoClaw CLI upgraded to v0.0.78, but OpenShell stayed at 0.0.72 (the OpenShell upgrade + sandbox recovery never ran).

    Impact is therefore worse than the single stopped-sandbox macOS repro: on a machine whose sandboxes have drifted to Error (common after prior test runs or gateway churn), the upgrade is hard-blocked with no path forward from inside the installer. Confirmed cross-platform (macOS in the original report + DGX Spark / Linux aarch64 here).

    hulynn avatar Jul 09 '26 07:07 hulynn

    [!NOTE] Edited: my first version re-traced the gate mechanism without crediting that @jason-ma-nv had already traced it above (including the finding that the behavior is deliberate, pinned by the #6114 regression test) — my apologies. Trimmed the duplicate trace; what remains below is the empirical part that was missing from the thread.

    Reproduced on main @ 9dec1fb89 (Ubuntu 24.04/WSL2, x86_64, Docker 29.2.1, OpenShell CLI 0.0.72 — different platform from your Mac Studio, but the mechanism is platform-independent). Run with the #6631 diagnostic patch applied; it does not touch the skip/strict logic. Mechanism as @jason-ma-nv traced it; one addition: requireAll comes from NEMOCLAW_REQUIRE_ALL_SANDBOX_BACKUPS=1, which the installer exports around its backup-all calls (scripts/install.sh:1811, :1930) — so installer runs are always strict.

    Reproduction

    One registered openclaw sandbox with its container stopped (docker stop), then:

    $ nemoclaw backup-all                                  # plain
      [...]
      Skipping 'clone-test' (not running)
      Pre-upgrade backup: 1 backed up, 0 failed, 9 skipped
    EXIT=0
    
    $ NEMOCLAW_REQUIRE_ALL_SANDBOX_BACKUPS=1 nemoclaw backup-all   # what the installer runs
      [...]
      Skipping 'clone-test' (not running)
    
      Pre-upgrade backup: 1 backed up, 0 failed, 9 skipped
      Backups stored in: ~/.nemoclaw/rebuild-backups/
    
      Strict pre-upgrade backup requires every registered sandbox to be backed up; 9 sandbox(es) were skipped.
      Resolve each skipped sandbox using its reason above and retry.
    EXIT=1
    

    (Exit codes measured with no pipe. My registry also carries 8 stale entries hitting the same gate — noise from an old test-pollution bug, #6553 — but one stopped sandbox is enough to reproduce yours.)

    The measured part that was missing from the thread

    A stopped sandbox becomes backupable the moment its container is started — even when the OpenClaw gateway inside it is not running:

    $ docker start <clone-test container>          # gateway inside stays down (see #6635)
    $ NEMOCLAW_REQUIRE_ALL_SANDBOX_BACKUPS=1 nemoclaw backup-all
      [...]
      Backing up 'clone-test'...
      ✓ clone-test: 14 dirs, 1 files → /home/<user>/.nemoclaw/rebuild-backups/clone-test/2026-07-10T09-20-43-921Z
    

    Backup rides SSH+tar through the sandbox's PID 1, not the agent gateway. So for the "stopped but intact" case in the original report, the remediation is one docker start away — but nothing tells the user that: the strict failure says "Resolve each skipped sandbox using its reason above", and the reason line, (not running), names no resolution. There is also no nemoclaw <name> start (the bare nemoclaw start a user would reach for is a deprecated alias for tunnel start).

    Caveat on scope: this covers sandboxes with a startable container. @hulynn's DGX Spark case (14 sandboxes in Error/Provisioning phase) likely includes sandboxes with no startable container at all — for those, a start-the-container hint doesn't help and an explicit waiver is the only inside-the-installer path.

    On the design question

    This slots into the maintainer decision @jason-ma-nv framed, as a middle option that does not reverse #6114: keep the loud strict gate, make it actionable. I'd argue against silently skipping stopped sandboxes ("state already at rest"): backup reads state from inside the container, and the upgrade the gate protects can rebuild or destroy exactly that container — a stopped sandbox's state is the state most exposed to loss.

    1. Make the skip line for a registered-but-stopped sandbox name the remediation (start the container — via a supported command or the docker start invocation) and repeat it in the strict-failure epilogue.
    2. An explicit waiver for users who consciously accept the risk, mirroring the existing NEMOCLAW_SKIP_UNREACHABLE_SANDBOX_BACKUP precedent for running-but-unreachable sandboxes — this is also the piece that covers the Error-phase fleet case above.

    Happy to send that as a PR with regression tests if maintainers agree with the direction.

    Hokonoken avatar Jul 10 '26 09:07 Hokonoken

    VDR 5 DGX Station retest on July 13, 2026 reproduced this issue on current main deed1aaa3 (v0.0.81-4-gdeed1aaa3; Node.js v25.9.0, npm 11.12.1) using the source-checkout installer bash ./install.sh.

    The first run was aborted at the legacy managed-image confirmation and exited before backup or OpenShell changes. On the immediate rerun, after confirming registered sandbox tm, the installer prepared, built, and linked the current NemoClaw CLI. Strict backup-all then skipped tm because it was stopped, reported 0 backed up, 0 failed, 1 skipped, and stopped the installer with OpenShell installation still deferred.

    This confirms that #6673 improved the remediation wording but did not remove the #6500 blocker. The failure occurs before onboarding, so onboard --resume / --fresh cannot recover it (--refresh is not a supported flag). PR #6723 is the current proposed fix and remains unmerged. This issue is now linked as a native sub-issue of VDR checklist #6743.

    sandl99 avatar Jul 13 '26 07:07 sandl99

    v0.0.81 Reproduction — All Platforms (Mac, DGX Spark, WSL2)

    Confirmed on v0.0.81 across three platforms during SWQA test execution (2026-07-13).

    Environment

    • macOS (Apple M4 Pro, docker-desktop, openshell 0.0.72, nemoclaw v0.0.81)
    • DGX Spark (Linux arm64, nemoclaw v0.0.81)
    • WSL2 (NVIDIA RTX PRO 6000 Blackwell Server Edition, nemoclaw v0.0.81)

    Part A — stopped sandbox blocks upgrade (all platforms)

    When a registered sandbox has its container stopped, the installer skips it but then exits with error instead of continuing:

    Skipping 'sandbox-b' (not running; start the sandbox/container and rerun 'nemoclaw backup-all'...)
    Pre-upgrade backup: 1 backed up, 0 failed, 1 skipped
    Strict pre-upgrade backup requires every registered sandbox to be backed up; 1 sandbox(es) were skipped.
    [ERROR] Pre-upgrade backup stopped the installer.
    

    Expected: stopped sandboxes should be skipped gracefully and the upgrade should continue to [3/3].

    Part B — unreachable running sandbox shows 'not running' instead of SSH error (all platforms)

    A running sandbox with a broken network/SSH is classified as 'not running' by the installer (same path as Part A), rather than triggering a distinct 'unreachable' error with actionable SSH guidance. The backup mechanism uses the gateway HTTP API, so SSH failure mode is not separately surfaced.

    Part C — NEMOCLAW_SKIP_UNREACHABLE_SANDBOX_BACKUP=1 does not bypass the block for stopped sandboxes (all platforms)

    Setting NEMOCLAW_SKIP_UNREACHABLE_SANDBOX_BACKUP=1 has no effect when the sandbox is classified as 'not running'. The installer still exits with the strict backup error.

    lyral-commits avatar Jul 13 '26 09:07 lyral-commits

    Thanks for the three-part breakdown — it maps cleanly onto what is fixed and what remains:

    Part A is fixed on main as of this morning — PR #6723 (merged 2026-07-13, commit 3de1de6b1, after the v0.0.81 tag was cut — consistent with the v0.0.82 label). The behavior on main is stronger than a graceful skip: a registered docker-driver sandbox whose container is exited/created is started for the duration of the backup and returned to its stopped state afterwards, so the strict gate passes with a real backup taken rather than a waived one (2 backed up, 0 failed, 0 skipped, exit 0 — live run in the PR). A retest of Part A on main ≥ 3de1de6b1 would be very welcome.

    Part B is a distinct residual — #6723 does not cover it, deliberately. A container that is running but not Ready (broken SSH/network, crash loop) is left alone: starting or stopping a live container could destroy diagnostic state. It therefore still takes the same skip path — and you are right that the (not running; ...) message misclassifies it: the container IS running. That message could distinguish "container running but sandbox not reachable" and point at SSH/gateway remediation instead. Worth tracking as its own item.

    Part C is by design, and largely mooted by #6723. NEMOCLAW_SKIP_UNREACHABLE_SANDBOX_BACKUP=1 only waives running sandboxes whose backup fails as SSH-unreachable; it never applied to not-running skips. After #6723 the common stopped case no longer needs a waiver — it simply gets backed up. The population that still hits the strict gate is: your Part B (running but not Ready, deliberately left untouched) plus containers that cannot be started at all (missing container, docker start failure) — both keep the existing skip-and-fail behavior, and no waiver env covers them today.

    Hokonoken avatar Jul 13 '26 11:07 Hokonoken

    [QA — v0.0.82 retest] Part A fixed; Part B still reproduces on v0.0.82

    Part A (a stopped / exited-container sandbox blocking the strict pre-upgrade backup) is fixed in v0.0.82 via #6723 — the stopped-container sandbox is started for the backup and returned to its stopped state, so the strict gate passes with a real backup.

    Part B (a container that is running but whose in-sandbox gateway is unreachable, so backup misclassifies it as (not running) and skips it) is not fixed in v0.0.82 — #6723 deliberately does not cover it, and it still hard-blocks the upgrade.

    Reproduced on v0.0.82 (install/onboard smoke)

    • Platform: WSL2 Ubuntu 24.04 x86_64, NemoClaw v0.0.82 (curl | bash upgrade from v0.0.81).
    • 6 registered sandboxes (cloud-sb, dcode-managed, dcode-connect, dcode-preupgrade, recover-test, openrouter-test). Their containers are running — docker ps -a shows each Up 24-25 hours, several (healthy).
    • Pre-upgrade backup output:
    Skipping 'cloud-sb' (not running; start the sandbox/container and rerun 'nemoclaw backup-all'...)   [x6]
    Pre-upgrade backup: 0 backed up, 0 failed, 6 skipped
    Strict pre-upgrade backup requires every registered sandbox to be backed up; 6 sandbox(es) were skipped.
    [ERROR] Pre-upgrade backup stopped the installer.
    
    • Result: the NemoClaw CLI upgraded to v0.0.82 but the OpenShell CLI install was deferred and never ran (half-upgraded state). Onboard could not be tested on this host.

    The (not running) reason misclassifies these containers — they are running (Up 24-25h). The backup reachability check goes through the in-sandbox gateway, which is down on these older sandboxes, so backup cannot reach them and skips them; the strict gate then aborts.

    Same misclassification also observed on x86-native Ubuntu 26.04 v0.0.82: a sandbox the backup step reported as (not running) was actually running + healthy per nemoclaw <name> start / status.

    Recommendation: track Part B as its own item — the strict gate should not count a running-but-unreachable container as a skip failure, OR distinguish "container running but gateway unreachable" with SSH/gateway remediation, OR provide a working waiver (NEMOCLAW_SKIP_UNREACHABLE_SANDBOX_BACKUP=1 does not help this case).

    wangericnv avatar Jul 14 '26 11:07 wangericnv

    @wangericnv Did you try to nemoclaw uninstall first to clean up OpenShell and other registered sandboxes ? In the latest 0.0.82, it shouldn't have these deprecated sandbox. I cannot repro your issue on latest clean 0.0.82 NemoClaw. If you're still able to repro, I highly recommend to create new issue with a clear repro steps.

    sandl99 avatar Jul 14 '26 14:07 sandl99

    Part B — repro steps + diagnosis (for @sandl99)

    Environment: WSL2 (Ubuntu 24.04) x86, NemoClaw v0.0.82, OpenShell 0.0.72, OpenClaw 2026.6.10.

    Symptom: backup-all (and therefore the strict pre-upgrade backup gate) reports sandboxes whose containers are Up as Skipping (not running), backs up 0, and aborts the upgrade — silent data-loss / install-blocking.

    Repro

    1. On WSL2, onboard one or more sandboxes (containers get a Docker restart policy). Confirm they are healthy and that nemoclaw backup-all backs them up (N backed up, 0 failed, 0 skipped).
    2. Fully restart the environment — wsl --shutdown from Windows and reopen the distro, or restart Docker Desktop. (Do not use docker restart <container> — see the note below; that path self-heals and does not reproduce.)
    3. After the restart, confirm the container(s) came back up:
      • docker ps → Up ...
      • docker inspect -f '{{.State.Running}}' <container> → true
    4. Run nemoclaw backup-all (or kick off an upgrade curl … | NEMOCLAW_INSTALL_TAG=<new> … bash, which runs the same pre-upgrade backup gate).

    Observed: the running container(s) are reported Skipping (not running) → 0 backed up → strict gate aborts the upgrade. Seen with 6 sandboxes (containers Up 24–25h, several healthy in docker ps -a) all reported (not running). The same misclassification also reproduces on Ubuntu 26.04.

    Diagnosis / where to look

    • The "running" determination is not honoring Docker state — docker inspect .State.Running == true while the backup gate says (not running). It appears to decide liveness by probing the sandbox through the host OpenShell gateway (127.0.0.1:8080) reverse tunnel rather than by container state.
    • Important negative result: a single docker restart <container> does not reproduce it. I verified on v0.0.82 that immediately after docker restart (container Up, Health: starting), backup-all still backs the sandbox up correctly at t≈1/5/12/20s — the container reconnects to the still-running host gateway within a second or two. So the misclassification requires the gateway/reverse-tunnel reconnection to be broken, which is the state right after a full WSL/Docker Desktop restart (containers auto-restart, but host-side gateway plumbing and the containers' uplinks come back out of sync).
    • Suggested fix direction: in the pre-upgrade backup "running" check, treat docker inspect .State.Running == true as running (or (re)establish the gateway uplink / start the container before deciding), instead of classifying a reachable-but-not-currently-connected running container as (not running) and skipping it. As written, a running sandbox that hasn't re-registered with the gateway is silently skipped, which is the data-loss path.

    Part A (stopped/exited container blocking upgrade) is fixed by #6723; Part B (running container misclassified via the gateway-reachability check) is not. Happy to pair on a live repro if the steps above don't trigger it in your env — the aged / multi-sandbox + full-env-restart combination is what reliably surfaced it.

    wangericnv avatar Jul 15 '26 03:07 wangericnv

    Hi @wangericnv Thank you for your valid repro. The main issue about backup is addressed. The root cause of your repro is openshell gateway cannot restart by itself after a reboot. I am opening a new issue for this https://github.com/NVIDIA/NemoClaw/issues/6903

    sandl99 avatar Jul 15 '26 05:07 sandl99