[Ubuntu 24.04][Onboard] An interrupted onboard leaves a lock whose owner PID is dead, and onboard --resume gives up after 120 retries instead of reclaiming it
Description
Interrupting nemoclaw onboard mid-provisioning leaves the host lock directory
~/.nemoclaw-portable-host.lock behind, with an owner file naming the PID of the process that just died.
The documented recovery command for exactly this situation — nemoclaw onboard --resume — then cannot run: it
retries for the lock 120 times and exits non-zero with
Error: Failed to acquire lock on /home/<user>/.nemoclaw-portable-host.lock after 120 retries
Nothing checks whether the recorded owner is still alive. It is not — the PID in the lock's owner file is a
dead process. The message offers no remediation either; the user is told only that the retries ran out, not
what holds the lock or how to clear it.
A second, related shape shows up on the same scenario: when the interrupt leaves ~/.nemoclaw/onboard.lock
instead, resume refuses with "Another NemoClaw onboarding run is already in progress. Lock holder PID: NNNN",
and that PID is also dead. That message at least names the file and suggests removing it, so it is the milder
of the two — but it is the same missing liveness check.
Reproduced 2 out of 2 attempts.
Platform scope: Ubuntu 24.04 x86_64 with an NVIDIA A100-SXM4-40GB. Not attempted elsewhere. Regression: Unknown — earlier versions not tested.
Environment
Device: x86_64 server, NVIDIA A100-SXM4-40GB
OS: Ubuntu 24.04 LTS
Architecture: x86_64
Docker: 29.7.2
NemoClaw: v0.0.114
OpenShell CLI: 0.0.106
Provider: NVIDIA Endpoints (nvidia/nemotron-3-super-120b-a12b)
Steps to Reproduce
1. Start a first-run onboard and let it reach sandbox creation:
NEMOCLAW_YES=1 nemoclaw onboard --name onboard-resume-test --non-interactive --fresh \
--yes-i-accept-third-party-software &
Wait until the output shows "[6/8] Creating sandbox".
2. Interrupt it, as a user would:
pkill -INT -f "nemoclaw onboard --name onboard-resume-test"
(SIGTERM if it does not exit on SIGINT). A partial sandbox is left on the gateway in Error phase.
3. Run the documented recovery command:
nemoclaw onboard --resume --non-interactive --yes-i-accept-third-party-software
4. Inspect the lock and whether its owner still exists:
ls -la ~/.nemoclaw-portable-host.lock
cat ~/.nemoclaw-portable-host.lock/owner
kill -0 $(cat ~/.nemoclaw-portable-host.lock/owner) ; echo "alive=$?"
Expected Result
onboard --resume is the recovery path for an interrupted onboard, so it completes. A lock left by a process
that no longer exists is recognised as stale and reclaimed. If it genuinely cannot be reclaimed, the error names
the lock, the owner, and the command to clear it, rather than reporting only that the retry budget ran out.
Actual Result
Step 3:
RESUME_EXIT=1
Error: Failed to acquire lock on /home/<user>/.nemoclaw-portable-host.lock after 120 retries
Step 4 — the lock is a directory and its owner is dead:
ls -la ~/.nemoclaw-portable-host.lock
drwx------ 2 <user> <user> 4096 Aug 27 06:40 .
-rw------- 1 <user> <user> 7 Aug 27 06:40 owner
-rw------- 1 <user> <user> 55 Aug 27 06:40 process-start
cat ~/.nemoclaw-portable-host.lock/owner
<OWNER-PID>
kill -0 <OWNER-PID>
-> not running (dead)
The lock directory's ctime is 06:40:05, i.e. it was created by the onboard that was interrupted at 06:40:27.
On the first of the two runs the lock left behind was ~/.nemoclaw/onboard.lock instead, and resume reported:
Another NemoClaw onboarding run is already in progress.
Lock holder PID: <OWNER-PID-2>
Started: 2026-08-27T06:36:09.511Z
Wait for it to finish, or remove the stale lock if the previous run crashed:
rm -f "/home/<user>/.nemoclaw/onboard.lock"
kill -0 <OWNER-PID-2> also reported the process as dead. Clearing that file by hand let resume proceed to the
next stage, so the lock is the only thing standing between the user and recovery.
Everything else about the interrupted state is sound and worth recording: the partial sandbox is left on the
gateway in Error phase as expected, the lifecycle journal ~/.nemoclaw/onboard-session.json is written (4018
bytes) and contains no API keys or tokens, and the run never emitted the
"sandbox route reservation ... disappeared while onboarding was in progress" error.
Logs
# run 2 (portable-host lock)
[2] interrupt
interrupted; gateway state:
NAME CREATED PHASE
onboard-resume-test 2026-08-27 06:40:14 Error
[3] lifecycle journal
--- ~/.nemoclaw/onboard-session.json (4018 bytes) secret hits: 0
[4] resume
RESUME_EXIT=1
forbidden-error count (expect 0): 0
Error: Failed to acquire lock on /home/<user>/.nemoclaw-portable-host.lock after 120 retries
# run 1 (onboard.lock)
RESUME_EXIT=1
Another NemoClaw onboarding run is already in progress.
Lock holder PID: <OWNER-PID-2> -> DEAD
Took the remediation half of this in #10465. Reporting what I could and could not reproduce, because the two halves came out differently.
The message half is fixed. Exhausting the retry budget now names the holder and the way out, matching what the onboard.lock path already prints:
Failed to acquire lock on <dir> after 120 retries. Owner PID 4242 is no longer running, so the lock
is stale; remove it with: rm -rf "<dir>"
with distinct wording for an owner that is still running and for a lock directory with no owner file.
The reclaim half does not reproduce on current main, and that is worth resolving before anyone changes the liveness logic. I drove the real acquisition path against the exact shape recorded in Step 4 — lock directory containing owner with a dead PID plus a 55-byte process-start sidecar — and it reclaims:
owner only (dead pid) -> RECLAIMED
owner + stray tmp file -> RECLAIMED
owner + process-start -> RECLAIMED
empty lock dir -> FAILED (exhausts the budget)
That matches the code: classifyExistingLock returns break as soon as ownerAlive is false, with no staleness wait, and status() classifies a dead owner carrying a process-start record as recycled, which also breaks.
Two shapes do exhaust the budget, and either could be what you hit:
- An ownerless lock directory. If the interrupt lands between
mkdirand theownerwrite, the directory has no owner file. That path waits for the 10s staleness window, and 120 retries at 100ms is 12s — close enough to the threshold that timing decides it. - A PID that is not readable rather than not alive. If the owner PID was recycled onto another user's process,
readProcessIdentityreturns null, the owner is classifiedunverifiable, and the lock is waited on rather than broken — even thoughkill -0from your shell would say something different than what NemoClaw sees.
Could you check one thing from the failing run, if the state is still around or on a fresh repro: was ~/.nemoclaw-portable-host.lock/owner present and readable at the moment resume gave up, and did /proc/<OWNER-PID> exist? Distinguishing "no owner file" from "owner unverifiable" picks between those two fixes, and they are different changes.
I have left the reclaim behavior untouched and kept this issue open — #10465 is Refs, not Fixes.
You are right about the reclaim half, and my evidence for it does not hold up. Thanks for pushing back rather than taking the report at face value.
Reproduced your result, on aarch64 this time. DGX Station GB300, Ubuntu 24.04, NemoClaw v0.0.114 /
OpenShell 0.0.106. I built the exact shape from the report — lock directory containing a readable owner with a
genuinely dead PID plus the process-start sidecar — and sampled the lock every ~1.5s while resume ran:
[right-after-killing-the-owner] 08:39:31
lock dir: present, entries=['owner', 'process-start']
owner file: present, readable, content='<DEAD-PID>'
/proc/<DEAD-PID> exists: False
kill(pid,0): ESRCH -> genuinely DEAD
[during-resume-1] 08:39:32 owner='<DEAD-PID>' /proc absent ESRCH -> genuinely DEAD
[during-resume-2] 08:39:33 owner='<RESUME-PID>' /proc exists ALIVE <-- reclaimed, owner rewritten
[during-resume-3..14] owner='<RESUME-PID>' ALIVE
Reclaimed in about a second. Resume then ran for another 74s and exited 1 for an unrelated reason ("recorded OpenClaw runtime identity changed or is invalid"), not on the lock.
Where my original evidence was wrong. The lock contents I quoted in the report were read minutes after resume gave up, in a separate command, and steps 5-7 of the test case had run in between. The sampling above shows the owner turns over inside one second, so what I inspected was almost certainly a lock created by one of those later commands — not the state resume actually contended with. I presented it as the failure state, and it was not. That is the part to discount.
Two smaller corrections while I am here:
- My liveness check was
kill -0in shell, which reports failure for both ESRCH and EPERM, so it cannot distinguish "dead" from "alive but owned by another user" — exactly the distinction your hypothesis 2 turns on. The repro above usesos.killand separates them. - Signalling
nemoclaw onboard --name <sandbox>does not necessarily kill the process that holds the lock. On this host the wrapper took SIGINT and SIGTERM while thenodeprocess holding the lock stayed up (/proc/<pid>present,kill(pid,0)OK). In that state resume refuses with theonboard.lockmessage naming a live PID — correct behaviour, and worth knowing for anyone reproducing this: an "interrupt" done that way can leave a live holder.
What I cannot settle. Your hypothesis 1, the ownerless lock directory, is still the live candidate for what exhausted the budget on the original run, and I cannot confirm it: that host is no longer reachable, and I did not sample during the failure at the time. Both failing runs that day did exit 1 after an interrupted onboard — that symptom was real and reproduced 2/2 — but the attribution to the liveness check was mine and it was not supported.
Happy for this to be closed against #10465 if you would rather not carry an open issue on an unconfirmed cause. If I hit a budget exhaustion again I will capture the during-failure samples and reopen with them.
Resolved by #10465, merged on main as 718dcc19e3e5.
Thank you for the contribution and the careful follow-up reproduction. As the corrected report established, a genuinely dead owner was already reclaimed; an interrupted wrapper could leave the actual Node owner alive. The landed change keeps that ownership protection and completes the recovery guidance, including unknown or reused PIDs and incomplete lock records. Recovery uses NemoClaw's normal lock-acquisition path.
The regression test acquires both the portable host fence and onboarding file lock in a real child process, verifies that a competing run cannot take them, kills the actual owner with SIGKILL, and verifies that both abandoned locks are reclaimed and released. Fresh and aged empty/malformed claims and the existing identity/generation race tests also pass. Evidence: committed cross-process regression, passing PR CI, portable Linux, Podman, and review disposition.
Closing against the completed diagnostic fix and the verified recovery behavior. If retry exhaustion recurs, contemporaneous lock and process-identity samples will let us investigate that specific failure without assuming that a later lock snapshot belonged to the failed run.