An upgrade over a pre-0.7.0 flat /opt/box skips setup-host: box --version says 0.8.0 while box-firewall stays pre-#102 #115
Labels
No labels
blocked
blocker:ci-red
blocker:conflict
blocker:drill-pending
blocker:unrequested
bug
claimed
documentation
enhancement
epic
merge-next
needs-triage
ready
release
scope:cli
scope:drill
scope:host
scope:installer
scope:templates
scope:tiers
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/box#115
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?
Found during the 0.8.0 release drill on a real Incus host.
box --versionreports the new version while the host-side scripts stay at the old one, so a fix shipped in the new release is silently not deployed.What happened, exactly
The drill host had a pre-0.7.0 flat
/opt/boxtree (a bare 0.6.0 install, not theversions/<v>layout). Installing 0.8.0 over it:versions/0.6.0/.had_installis computed.had_installtherefore sees an existing install, andhost/setup-host.shis skipped./opt/box/current -> versions/0.8.0and/usr/local/bin/boxare updated correctly.Result: the CLI is 0.8.0, but every artifact
setup-host.shis responsible for installing stays whatever the old version left behind.The concrete damage: the #102 fix does not land
/usr/local/sbin/box-firewallis the scriptbox-firewall.serviceruns. On this host, post-upgrade, line 22 is still:That is exactly the shape #102 removed. 0.8.0 ships the fix —
host/box-firewall.shreadsufw statusonce into a variable — and 0.8.0's own comment states what the old form costs:So the operator most likely to upgrade — someone on a UFW host who read the #102 entry in the release notes — is precisely the one who does not receive it.
box --versiontells them they have it.Verified by diff on the drill host:
diff /usr/local/sbin/box-firewall /opt/box/versions/0.8.0/host/box-firewall.shshows the installed script is the pre-fix one.Why this is worth fixing rather than documenting
The failure is silent and self-concealing. There is no error, no warning, and the version string actively asserts the opposite. Nothing on the host reports that
setup-hostwas skipped, anddrill/doctor.shreportscleanthroughout — correctly, since it checks host state (networks, ACLs, nft tables), not whether the host scripts match the installed version.It also is not limited to
box-firewall. Anythingsetup-host.shinstalls or converges is exposed the same way;box-firewallis simply where it was caught, because 0.8.0 happens to change that file.Scope
Affects any host upgrading from a pre-0.7.0 flat
/opt/boxto 0.7.0+. Hosts already on theversions/<v>layout are unaffected — for themhad_installis true for the right reason and the same skip is correct.That makes this narrow but not hypothetical: it is the upgrade path for every host installed before the versioned layout shipped, and it was hit on the very first real host the drill touched.
Suggested fix
Compute
had_installbefore the migration block, so a flat tree is recognised as "pre-versioned layout" rather than as "already installed in the current layout". A tree needing migration has by definition never been converged by this version'ssetup-host.A cheaper alternative that does not reorder anything: record the version that last ran
setup-host(e.g. inINSTALLED_FROMor a sibling file) and re-run it whenever the installed version differs. That also closes the general case — any future release that changes a host-side script gets it deployed — rather than just this migration.Either way, worth adding an assertion that the installed
/usr/local/sbin/box-firewallmatches$CURRENT/host/box-firewall.sh, since that is the check that would have caught this without a drill.Not the same as #107
#107 is about
drill/wipe.shcarrying the #102 shape in a script that is safe because it lackspipefail. This is different: the real,pipefail-carryingbox-firewallon a live host, still unfixed after an upgrade that was supposed to fix it.Refs
Found during the
release: 0.8.0drill (#114). Related: #102 (the SIGPIPE race itself), #107 (the same shape in the drill), #71 (the global-install requirement that makes/opt/boxthe operative tree).