Skip to content

[Ubuntu 26.04][Sandbox] retained-recovery record cannot be cleared by any supported command; destroy and onboard refuse each other #12290

Closed as not planned

Description

@hulynn

Warning

Regression — broken in v0.0.128, and in v0.0.121 before it. The fix merged for #11418 does not cover the failure window this symptom occurs in, and the two commands involved now deadlock each other.

Note

Re-verified reopening of #11418 — closed via #12083 (merge commit b75e35669, confirmed an ancestor of v0.0.128). Re-verification on v0.0.128 reproduces the original failure state and finds no supported way out of it. See the QA verify comment on the linked NVBug for the full repro transcript.

Description

When sandbox creation fails after the image builds but before the pending-create identity is published to the registry, the sandbox is left with a retained-recovery record that no supported command can reconcile. destroy refuses to act, and onboard refuses to reuse or recreate the name until destroy completes — so the two commands point at each other and the user cannot proceed with that sandbox name at all.

The refusal message is more structured than in v0.0.121 and now cites a recovery record ID, but it states outright that this build has no supported automatic repair. Clearing the state required hand-editing product state files.

The fix merged for the earlier issue adds a reconstruction step that rebuilds the retained-recovery record from the registry's pending-create identity. That identity is precisely what this failure window never publishes, so the reconstruction is skipped and the deadlock is unchanged.

Platform scope: Reproduced on Ubuntu 26.04 x86_64 only; other platforms not tested in this pass.
Regression: Yes — reported and fixed against v0.0.121, still reproduces on v0.0.128.
OpenShell issue: No

Environment

Device:        Linux x86_64 server
OS:            Ubuntu 26.04 LTS
Architecture:  x86_64
OpenShell CLI: openshell 0.0.116
NemoClaw:      nemoclaw v0.0.128
OpenClaw:      N/A (sandbox creation did not complete)

Steps to Reproduce

  1. Build a sandbox image that builds cleanly but whose container fails immediately at start, so the failure lands after image build and before the pending-create identity is published:
FROM ghcr.io/nvidia/nemoclaw/sandbox-base:v0.0.128
ARG NEMOCLAW_TOOL_DISCLOSURE=progressive
ENV NEMOCLAW_TOOL_DISCLOSURE=$NEMOCLAW_TOOL_DISCLOSURE
RUN echo "BASELINE_BUILD_OK"
RUN printf %s 'case "$0" in */nemoclaw-start) echo "...libnvidia-ml.so.1: cannot open shared object file..." >&2; exit 127;; esac' > /opt/startfail.sh && chmod 0644 /opt/startfail.sh
ENV BASH_ENV=/opt/startfail.sh
  1. Onboard from that Dockerfile:
nemoclaw onboard --from <dir>/Dockerfile --name <sandbox> --non-interactive --fresh --yes
  1. Confirm which failure variant you are in — the registry row must have no pending-create identity:
cat ~/.nemoclaw/retained-sandbox-recovery.json
cat ~/.nemoclaw/sandboxes.json
  1. Try every supported way to clear it:
nemoclaw <sandbox> destroy --yes
nemoclaw <sandbox> destroy --force
nemoclaw <sandbox> doctor --fix
openshell --gateway <gateway> sandbox delete <sandbox>
nemoclaw onboard --name <sandbox> --non-interactive --fresh --yes

Expected Result

A user whose sandbox creation failed can clear the leftover state and reuse that sandbox name, using documented commands only.

If the product genuinely cannot reconcile the record automatically, the refusal names a concrete action the user can take to get unblocked — not an instruction to preserve the state indefinitely, and not an instruction that points at another command which refuses for the reverse reason.

Actual Result

Step 2 — onboarding fails after a successful image build, exit 1:

Step 4/6 ... BASELINE_BUILD_OK
Sandbox image build completed in 30.1s
...
Error: Sandbox post-create verification or finalization failed; automatic sandbox cleanup was not safe.
Create-attempt label: ai.nvidia.nemoclaw.create-attempt=<label>.

Step 3 — the buggy variant is confirmed. retained-sandbox-recovery.json holds one record for the sandbox with "reason": "retained_after_sandbox_creation_failure", "identityWasUnavailable": false, plus a sandboxIdentityFingerprint and lifecycleGeneration. The sandboxes.json row carries only name, gatewayName and pendingRouteReservation: true — no pending-create identity and no lifecycleGeneration.

Step 4 — every supported path refuses.

destroy --yes, exit 1:

Cause: Refusing to destroy retained sandbox '<sandbox>' because NemoClaw could not select exactly one
recovery record from the current registry, onboarding session, and immutable recovery evidence.
Retained state: No sandbox resources were removed. The registry, onboarding session, and recovery
records remain unchanged.
Next action: Preserve this state and do not delete by mutable sandbox name. This build has no
supported automatic repair for conflicting recovery authority.
Diagnostic reference: retained recovery record ID <id>.

destroy --force → the identical refusal, exit 1.

doctor --fix → exit 0 but does not reconcile; reports Lifecycle registration: registry entry incomplete ... (missing dashboardPort, fromDockerfile, gatewayPort, imageTag, nemoclawVersion, openshellDriver, openshellVersion), and its only hint is "re-register or re-onboard".

openshell sandbox delete <sandbox> → exit 0 (✓ Deleted sandbox), but destroy afterwards gives the identical refusal, exit 1. This is the remedy that clears the other variant of this failure; it does not help here.

onboard --fresh with the same name → exit 1:

Onboarding cannot use retained sandbox '<sandbox>' while its identity-bound recovery record is unresolved.
Run the destroy command for retained sandbox '<sandbox>' to remove the verified failed attempt; resume,
reuse, recreation, and same-name fresh onboarding remain disabled until destroy completes.

So onboard says to run destroy, and destroy says there is no repair and to preserve the state. There is no recovery or repair surface and no way to act on the cited record ID — destroy --help offers only --yes|-y|--force|--[no-]cleanup-gateway.

The state could only be cleared by hand-editing ~/.nemoclaw/sandboxes.json and ~/.nemoclaw/retained-sandbox-recovery.json.

Logs

Not captured beyond the terminal output quoted in Actual Result.

Activity

  1. added
    NV QA
    on Sep 23, 2026
  2. added theissue type on Sep 23, 2026
  3. ChunkyMonkey11 commented on Sep 24, 2026

    @ChunkyMonkey11
    Contributor

    @hulynn I read through #12083 and I think #12290 might be a similar problem, but in a slightly earlier failure case.

    It looks like #12083 works when NemoClaw can still match the failed sandbox to the onboarding session. But in this issue, the sandbox fails before pendingCreateIdentity is saved, and it seems like there is not enough matching session information left for destroy to know which recovery record is safe to remove.

    Would it make sense to save the sandbox creation identity earlier, when the name is first reserved? That could include the sandbox name, gateway, identity fingerprint, lifecycle generation, and create-attempt nonce.

    Then, if onboarding fails later, destroy could compare that saved information with the recovery record before clearing it. This would still avoid deleting a newer sandbox that happens to have the same name, but it would give users a supported way to recover from this failed creation state.

    It might also be useful to add a test for this exact case: image build succeeds, sandbox startup fails before pendingCreateIdentity is saved, and destroy can safely clear the failed attempt after confirming the sandbox is gone.

    Would an OpenShell delete-by-identity feature help here too, or is saving this information earlier the better fix?

  4. ChunkyMonkey11 commented on Sep 24, 2026

    @ChunkyMonkey11
    Contributor

    @cv @hulynn I would like to take on this problem.

  5. ChunkyMonkey11 commented on Sep 26, 2026

    @ChunkyMonkey11
    Contributor

    PR #12331 is ready for maintainer review at head 2b040ce. Focused recovery and identity tests pass locally. Required checks are still in progress; I’ll confirm once they finish.

  6. Mdlugopolski commented on Oct 16, 2026

    @Mdlugopolski

    Related existing-state recovery case: missing identity and conflicting generations

    I have a related retained-recovery blocker on NemoHermes 0.0.134. I am seeking a maintainer-supported way to retire the abandoned registration without deleting workloads, reconstructing missing authority, or affecting a separate environment. This is an existing-state diagnosis, not a clean-install reproduction of #12290.

    Confirmed evidence

    • nemohermes upgrade-sandboxes --check exits 1: one legacy registration is missing from its recorded gateway and receives generic destroy/onboard guidance.
    • Querying that exact recorded gateway with openshell sandbox list --gateway <legacy-gateway> --output json exits 0 and returns []. This is a responding gateway with an empty inventory, not a failed observation.
    • The published registry entry and the target retained recovery record have different lifecycle generations. The retained record lacks an immutable sandbox identity fingerprint. A preserved rebuild backup carries a third generation, matching neither. A failed onboarding session lacks the matching cancellation-recovery authority.
    • Installed lifecycle source refuses selection of unresolved conflicting recovery authority. I have not executed destroy/force/uninstall as a diagnostic or modified the records to bypass that guard.
    • There is another retained record and a separate gateway-scoped environment that must remain untouched. Backups and original metadata are preserved.

    Environment and limitations

    • Debian GNU/Linux 12 (bookworm), aarch64.
    • NemoHermes 0.0.134; maintained update check currently reports no update available.
    • OpenShell 0.0.116; Node.js v26.8.1; Docker 29.9.0.
    • Installed source baseline: 8a5718dd14a2c2e440011488b1f3a32e9414cf82, with pre-existing local modifications. This is not a claim that unmodified upstream reproduces every detail.
    • Evidence gathered October 15, 2026 (CDT). Sandbox/gateway names are placeholders; raw IDs, generation values, host paths, provider settings and credentials are intentionally omitted.

    Questions for maintainers

    1. Is there a supported administrative retirement procedure for an already-existing retained record whose original immutable identity is missing and whose generation conflicts with the published registry? If not, should this remain blocked pending a product fix?
    2. PR fix(onboard): retain exact create identity receipts #12331 appears to preserve create identity receipts earlier for subsequent failure handling. Does it also support this pre-existing missing-receipt/conflicting-generation case, or only prevent or reconcile failures for which an exact receipt exists? I have not applied the unmerged PR.
    3. The recovery guide documents rebuild --retire-recovery <transaction-id> for a bound rebuild-policy-handoff transaction. Does that command apply to this distinct retained-sandbox authority conflict? I have not assumed that it does or run it.
    4. What minimum redacted structural evidence is useful for review? I can supply an allowlisted summary, but will not upload complete local registries, sessions, backups, or provider configuration.

    Required safety properties: preserve sibling records, the separate gateway environment, providers and backups; never invent identity/generation/cancellation proof; and do not enable unsafe same-name reuse by deleting a blocker. Archiving a record alone does not establish reconciliation.

    Related upstream references checked

    No change to a live sandbox or lifecycle authority is requested without a separately reviewed procedure.

  7. wangericnv commented on Oct 19, 2026

    @wangericnv
    Collaborator

    QA re-verification on v0.0.135: still reproduces verbatim

    Re-ran this issue's own steps on v0.0.135 (Ubuntu 24.04 x86_64, Docker, OpenShell 0.0.116), using the Dockerfile from the report with only the base-image tag changed to sandbox-base:v0.0.135, a dedicated gateway port and a fresh sandbox name.

    State after the failed onboarding is the same variant. One retained record with reason: retained_after_sandbox_creation_failure, identityWasUnavailable: false, a sandboxIdentityFingerprint and a lifecycleGeneration. The sandboxes.json row has no pending-create identity (keys: credentialEnv, endpointSource, endpointUrl, gatewayName, hostLocalInferenceReceipt, model, name, pendingRouteReservation, preferredInferenceApi, provider, reservationSessionId).

    Step Result on v0.0.135
    destroy --yes exit 1, "could not select exactly one recovery record from the current registry, onboarding session, and immutable recovery evidence ... no supported automatic repair for conflicting recovery authority"
    destroy --force identical refusal, exit 1
    doctor --fix reports "Lifecycle registration: registry entry incomplete ... re-register or re-onboard"; does not reconcile
    openshell sandbox delete (then openshell sandbox list returns [], no container, no volume), then destroy --yes identical refusal, exit 1
    onboard --fresh with the same name "Onboarding cannot use retained sandbox ... while its identity-bound recovery record is unresolved"; exit 1

    I also reproduced the same dead end twice more with a simpler trigger (an image whose entrypoint binary does not exist), on separate gateway ports.

    Contrast with the identity-free variant. The case where OpenShell never returns a create identity (identityWasUnavailable: true, null fingerprint) is cleared on v0.0.135 once absence is confirmed: destroy exits 0 with "Cleared retained recovery", unresolved records drop to 0, and the same name onboards again. So #13170 covers that variant, but not this one, where a durable identity fingerprint exists and the registry row is incomplete.

    PR #12331 ("fix(onboard): retain exact create identity receipts") is the open change aimed at this case; I have not tested it. Happy to re-run these steps against a build that includes it.

  8. CoDev-BitByBit-Commit commented on Oct 22, 2026

    @CoDev-BitByBit-Commit

    Reproduced on v0.0.137 through rebuild, not onboard

    Same deadlock, reached through a different entry point. It still reproduces on v0.0.137 (f00fb1da), OpenShell 0.0.116.

    Environment: DGX Spark (GB10, aarch64), Ubuntu, Docker driver gateway on a non-default port (8085), OpenClaw agent, provider vllm (existing local server).

    Sequence:

    1. A healthy, published sandbox spark-agent exists.
    2. nemoclaw spark-agent rebuild --yes with NEMOCLAW_RAM=8g NEMOCLAW_CPU=4 set.
      • Backup succeeds, the old sandbox is destroyed, and the new create fails with:
        Sandbox 'spark-agent' was created, but OpenShell did not return one exact durable sandbox identity before post-create effects (selector-execution-uncoded-error).
      • Afterwards OpenShell lists no sandboxes, and Docker has no container for the name.
    3. nemoclaw spark-agent rebuild --yes --tool-disclosure progressive (the command printed in the failure message) refuses:
      Rebuild cannot use retained sandbox 'spark-agent' while recovery record '…' is unresolved … Run 'nemoclaw spark-agent destroy --yes'.
    4. nemoclaw spark-agent destroy --yes refuses:
      could not select exactly one recovery record from the current registry, onboarding session, and immutable recovery evidence … This build has no supported automatic repair for conflicting recovery authority.

    Why it deadlocks (from reading v0.0.137 source):

    • The retained record has identityWasUnavailable: true, a null sandboxIdentityFingerprint, and the new lifecycleGeneration.
    • The registry row is still the old, published row from before the rebuild. It has the destroyed sandbox's lifecycleGeneration and lifecycleLiveIdentityFingerprint, and no pendingCreateIdentity.
    • reconcileIdentityFreeRecovery (actions/sandbox/lifecycle/retained-recovery.ts) returns early: unpublished(observedEntry) is false because the row still carries the old generation.
    • selectRetainedSandboxRecoveryAuthority (actions/sandbox/destroy.ts) then compares the record's generation with the registry row's old generation. They differ and there is no pendingCreateIdentity, so nothing matches.
    • Moving retained-sandbox-recovery.json aside doesn't help: rebuild regenerates it from the session's cancellationRecovery.

    So for the rebuild path, the gap is that a recreate which has already destroyed the source never demotes or updates the registry row, and the identity-free reconciliation requires that row to be unpublished. Worth checking whether PR #12331 covers this path too.

    Workaround that worked (no hand-editing of JSON):

    1. Move ~/.nemoclaw/gateways/<port> aside as a whole.
    2. openshell provider delete the orphaned nemoclaw-local-v1-* provider. Onboard otherwise refuses with "already exists without a matching NemoClaw ownership receipt".
    3. Run a fresh nemoclaw onboard --non-interactive. It reused the healthy gateway.

    The workspace has to be restored separately from the rebuild backup tarball.

    The create failure itself appears to be triggered by NEMOCLAW_RAM=8g (2/2 creates failed with 8g; 4/4 succeeded with 8Gi). I've filed that separately as #13623.

  9. added
    area: sandbox
    area: security
    on Oct 30, 2026
  10. wscurran commented on Nov 16, 2026

    @wscurran
    Contributor

    Hi Lynn, thanks for the careful testing and detailed report. We’re focusing development on NemoClaw V1 and don’t plan further work on this Classic report, so we’re closing it as not planned. We appreciate your contribution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

NV QAarea: sandboxarea: security

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions