runner install: --repo is ignored when a runner is already registered — silently restarts on the OLD repo and reports success
#13
Labels
No labels
attention
blocked
blocker:ci-red
blocker:conflict
blocker:drill-pending
blocker:unrequested
bug
claimed
documentation
enhancement
epic
merge-next
needs-ruling
needs-triage
offsite
post-merge
ready
release
scope:bootstrap
scope:coolify
scope:db
scope:docs
scope:drill
scope:installer
scope:labels
scope:platform
scope:runner
scope:users
stale
state:addressing
state:bots-reviewing
state:building
state:needs-human
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: heavy-duty/rig#13
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
rig runner install --repo <B>on a box already registered to repo A silently skips registration, starts the service still pointed at A, and reports success.What happens
commands/runner-install.shtreats the mere existence of.runneras "already registered", without checking which repo that file names:So
--repois accepted, validated, and then ignored. The box comes back up on the old repo and the last line says it worked.There is no signal to the operator that anything is wrong: because
REG_PENDING=0, it doesn't even ask for the registration token they just minted for the new repo. The command that looks like it did the least (no prompt, fast) is the one that did the wrong thing.Why it bites
This is the natural next command after a failed or partial
repoint. Concretely, ours:rig runner repoint --repo <new>aborted at deregistration (expired removal token — GitHub answers a bad token onPOST /actions/runner-registrationwith a bare 404, which reads as "runner not found" and sends you looking in the wrong place).repointhad already uninstalled the service — correctly, service-first — so the box was left with.runnerstill naming the old repo and no service.rig runner install --repo <new>. That would have silently restarted the runner on the old repo, printed "installed and running", and left the new repo with zero runners — so itsruns-on: [self-hosted, …]jobs queue forever against a runner that will never come.The failure is worse than a no-op. Moving a runner between repos is usually a trust-boundary act — you are taking a machine off a repo for a reason. A tool that quietly puts it back, and says success, defeats the whole point of the move.
Fix
commands/runner-status.shalready solves the hard part — it parses.runner(JSON) with a dependency-free helper, because a rig-bootstrapped box has nojq:Lift that into a shared helper (or duplicate the four lines) and gate
installon it:This preserves convergence, which is the property worth keeping. Re-running
installagainst the repo the box is already on stays a clean exit-0 no-op — that is real convergence. Skipping when the repo differs is not convergence, it is silently ignoring the argument.Suggested test
test/gains a case: a box with a.runnernaming repo A,install --repo B→ exits non-zero, does not start a service, and the message names both repos.Related
Same "convergent by skipping" root cause the runner-lifecycle work already fixed in
repoint;installwas left behind. Worth a skim of the other commands for the same shape — a guard that proves something is installed, but never that it is the thing the flags asked for.