From c6adccc01d46620ff821e3dbdd15bb4df4d5dbde Mon Sep 17 00:00:00 2001 From: Gerrrt Date: Tue, 24 Nov 2026 13:06:44 -0800 Subject: [PATCH 1/2] docs(runbooks): the converge flaps ScheduledJobFailed when left off main MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit converge-the-host.md's "When it refuses" had no entry for the not-on-main refusal — the one that recurs, because the deployment checkout doubles as the tree branches are authored from and the hourly timer does not wait for that work to finish. Add a subsection quoting the real error, saying the flap is benign (the branch check runs before any fetch, so nothing deploys) and self-clears on the next converge that finds main, and pointing at a git worktree as the way to keep the checkout on main while authoring. The changelog records today's instance. Co-Authored-By: Claude Opus 4.8 --- docs/changelog.md | 14 ++++++++++++++ docs/runbooks/converge-the-host.md | 26 ++++++++++++++++++++++++++ 2 files changed, 40 insertions(+) diff --git a/docs/changelog.md b/docs/changelog.md index 84e12cad9..4bbfbc1bf 100644 --- a/docs/changelog.md +++ b/docs/changelog.md @@ -19,6 +19,20 @@ docstring gives: it is a record, not a claim about now. ## 2026-11-24 +- **The hourly converge flaps `ScheduledJobFailed` when the deployment + checkout is left on a branch, and `converge-the-host.md` now says so.** + `prometheus`'s `robo` tree is both the host's deployment checkout and the + tree branches are authored from, and `make converge` fast-forwards `main` + only — so a converge that fires mid-branch refuses at the branch check, + before any fetch, and its `ScheduledJobFailed` fires with it. Seen today: the + tree sat on `gerrrt/hicks-pool-leases`, then `gerrrt/close-morpheus-audit`, + across the 18:27 and 19:28 converges, which both exited 2; the 20:27 run + found `main` and cleared it. Nothing deployed from either branch — the gate + refuses rather than ship a half-finished tree. *When it refuses* gains a + subsection: the alert is benign, self-clears on the next converge that finds + `main`, and authoring from a `git worktree` keeps the checkout on `main` and + the timer quiet. + - **The audit of `morpheus` of 2026-11-13 is closed.** This completes the entry "`morpheus` audited, read-only, on 2026-11-13, and re-read on 2026-11-23". A re-check on 2026-11-24 found every finding fixed on the box, diff --git a/docs/runbooks/converge-the-host.md b/docs/runbooks/converge-the-host.md index 3cc340a43..ad027f72a 100644 --- a/docs/runbooks/converge-the-host.md +++ b/docs/runbooks/converge-the-host.md @@ -387,6 +387,32 @@ To keep it, get it into the repository the normal way — a branch, a pull request, CI. To discard it, `git checkout -- .` in that directory, and delete any untracked files the status listed. +### The tree is on another branch + +```text +error: the deployment checkout is on 'gerrrt/some-work', not main. +Convergence only ever fast-forwards main. Someone left this checkout +somewhere else; put it back deliberately rather than letting a timer do it: + git -C /home/robo/code/Gerrrt/HomeLab switch main +``` + +This one recurs, because the deployment checkout is also the tree people author +from — `prometheus`'s `robo` tree moves through dozens of branches in a working +day — and the hourly timer does not wait for that work to finish. Convergence +only ever fast-forwards `main`, so a converge that fires while a branch is +checked out refuses exactly as above, and its `ScheduledJobFailed` fires with +it. + +Nothing was deployed from the branch: the branch check runs before any fetch or +`make up`, so the refusal is the whole effect, and the gate is doing its job — +it would rather stop than deploy whatever a half-finished branch happens to +hold. The alert clears on the next converge that finds the checkout back on +`main`; put it there with the `git switch` the error prints. If the branch work +is still in flight it refuses again on the next run, so `ScheduledJobFailed` +flaps for as long as the tree is left off `main` across a converge — benign, +but noisy. Authoring from a `git worktree` keeps the deployment checkout on +`main` while the work goes on, and the timer stays quiet. + ### The tip did not verify ```text From 24e55b4a10aedd592d8230204f7b15df85a8aae5 Mon Sep 17 00:00:00 2001 From: Gerrrt Date: Tue, 24 Nov 2026 13:18:40 -0800 Subject: [PATCH 2/2] docs(converge): a refused run can still revive services; the alert needs a clean pass MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Address #1728 review. revive_stopped (converge.sh:1261) runs before the branch check (1289), so a converge that refuses on a branch may already have restarted a stopped stack service — on its last-applied config, not the branch's. Say that, keeping "no branch configuration is deployed" distinct from "no effect". And ScheduledJobFailed reads the last exit code, so it clears on the next successful converge (main and clean), not merely on return to main; point at the journal when it persists. Same qualification in the changelog entry. Co-Authored-By: Claude Opus 4.8 --- docs/changelog.md | 14 ++++++++------ docs/runbooks/converge-the-host.md | 30 +++++++++++++++++++++--------- 2 files changed, 29 insertions(+), 15 deletions(-) diff --git a/docs/changelog.md b/docs/changelog.md index 4bbfbc1bf..b876c0662 100644 --- a/docs/changelog.md +++ b/docs/changelog.md @@ -26,12 +26,14 @@ docstring gives: it is a record, not a claim about now. only — so a converge that fires mid-branch refuses at the branch check, before any fetch, and its `ScheduledJobFailed` fires with it. Seen today: the tree sat on `gerrrt/hicks-pool-leases`, then `gerrrt/close-morpheus-audit`, - across the 18:27 and 19:28 converges, which both exited 2; the 20:27 run - found `main` and cleared it. Nothing deployed from either branch — the gate - refuses rather than ship a half-finished tree. *When it refuses* gains a - subsection: the alert is benign, self-clears on the next converge that finds - `main`, and authoring from a `git worktree` keeps the checkout on `main` and - the timer quiet. + across the 18:27 and 19:28 converges, which both exited 2. + `ScheduledJobFailed` reads the last exit code, so it clears only on a + *successful* converge — the tree on `main` and clean; the 20:27 run was the + first to find it so, and cleared it. No branch configuration reached a + service (the branch check precedes the fetch), though `revive_stopped` runs + before that check, so a refused run can still restart a stopped stack + service. *When it refuses* gains a subsection with the detail, and the + `git worktree` that keeps the checkout on `main` and the timer quiet. - **The audit of `morpheus` of 2026-11-13 is closed.** This completes the entry "`morpheus` audited, read-only, on 2026-11-13, and re-read on diff --git a/docs/runbooks/converge-the-host.md b/docs/runbooks/converge-the-host.md index ad027f72a..7a9314ffd 100644 --- a/docs/runbooks/converge-the-host.md +++ b/docs/runbooks/converge-the-host.md @@ -403,15 +403,27 @@ only ever fast-forwards `main`, so a converge that fires while a branch is checked out refuses exactly as above, and its `ScheduledJobFailed` fires with it. -Nothing was deployed from the branch: the branch check runs before any fetch or -`make up`, so the refusal is the whole effect, and the gate is doing its job — -it would rather stop than deploy whatever a half-finished branch happens to -hold. The alert clears on the next converge that finds the checkout back on -`main`; put it there with the `git switch` the error prints. If the branch work -is still in flight it refuses again on the next run, so `ScheduledJobFailed` -flaps for as long as the tree is left off `main` across a converge — benign, -but noisy. Authoring from a `git worktree` keeps the deployment checkout on -`main` while the work goes on, and the timer stays quiet. +No branch configuration is deployed — the branch check runs before any fetch or +`make up`. That is not the same as no effect: `revive_stopped` runs earlier in +the same pass, so a converge that then refuses may already have restarted a +stopped stack service, brought back on its last-applied configuration rather +than the branch's (see *When a service is stopped*). What the gate prevents, +every time, is shipping a half-finished branch. + +`ScheduledJobFailed` reads the job's last exit code, so it clears on the next +*successful* converge — the checkout on `main` **and** clean, since uncommitted +edits carried across the switch are their own refusal. Put the tree back with +the `git switch` the error prints; if the alert outlives a run that should have +passed, the journal says what the last one refused on: + +```bash +journalctl -u 'homelab-converge*' -n 20 --no-pager | grep homelab-deploy +``` + +While branch work is in flight the converge refuses on every run it overlaps, +so `ScheduledJobFailed` flaps for as long as the tree is left off `main` — +benign, but noisy. Authoring from a `git worktree` keeps the deployment +checkout on `main` while the work goes on, and the timer stays quiet. ### The tip did not verify