Add-host: a Re-enroll that fails after commit still leaves an install that blocks the next add (exit 71) #372

Open
opened 2026-11-05 22:34:11 +00:00 by kayg · 0 comments
Owner

Follow-up from #305 (J257 review, comment 80552, finding P3; J241 branch addhost-startfresh-j241).

What: F-B (3cf6bcf49) removes a committed fresh install when a later step of the same add fails (for example the login check after commit), so the next add isn't refused with exit 71. It deliberately skips any attempt that set an earlier install aside (crates/plugins/ssh/src/bootstrap.rs, installation.committed() && resources.set_aside.is_none()).

The gap: a Re-enroll sets the old install aside and joins under a new host id. Its commit runs retire_set_aside (install.rs commit paths), so after the commit nothing is set aside any more. If a step after the commit fails, the server revokes that new host id, while the install stays with .bootstrap-owner = the revoked id. The next add then exits 71: the same dead end F-B fixed for fresh installs.

Suggested fix (J257): gate on "committed and not a Replace" instead of "nothing set aside". A Replace keeps the same host id and must keep its install. uninstall_committed already refuses anything whose owner isn't this attempt's host id. Needs a failing test first: Re-enroll, failure after commit, then a retry that must finish.

Priority: low. F-A removed the common cause of a failure after commit.

Follow-up from #305 (J257 review, comment 80552, finding P3; J241 branch `addhost-startfresh-j241`). **What:** F-B (`3cf6bcf49`) removes a committed *fresh* install when a later step of the same add fails (for example the login check after commit), so the next add isn't refused with exit 71. It deliberately skips any attempt that set an earlier install aside (`crates/plugins/ssh/src/bootstrap.rs`, `installation.committed() && resources.set_aside.is_none()`). **The gap:** a **Re-enroll** sets the old install aside and joins under a **new** host id. Its commit runs `retire_set_aside` (`install.rs` commit paths), so after the commit nothing is set aside any more. If a step after the commit fails, the server revokes that new host id, while the install stays with `.bootstrap-owner` = the revoked id. The next add then exits 71: the same dead end F-B fixed for fresh installs. **Suggested fix (J257):** gate on "committed and not a Replace" instead of "nothing set aside". A Replace keeps the same host id and must keep its install. `uninstall_committed` already refuses anything whose owner isn't this attempt's host id. Needs a failing test first: Re-enroll, failure after commit, then a retry that must finish. **Priority:** low. F-A removed the common cause of a failure after commit.
Sign in to join this conversation.
No labels
launch-qa
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
kayg/infraternal#372
No description provided.