Skip to content

fix: spored installs in all regions + robust sig-aware fallback (#440) - #441

Merged
scttfrdmn merged 1 commit into
mainfrom
fix/440-spored-region-distribution
Jul 23, 2026
Merged

scttfrdmn merged 1 commit into
mainfrom
fix/440-spored-region-distribution

Conversation

@scttfrdmn

Copy link
Copy Markdown
Contributor

Fixes #440.

The bug (HIGH — found verifying the v0.93.0 release downstream)

spored install fails closed (exit 1) in the 7 non-US regions, so instances there run with no lifecycle daemon — no TTL/idle enforcement, no DNS.

Two facts interact:

  1. The release workflow published spored to 4 US buckets only (comment: "others fall back to us-east-1"). The 7 non-US buckets still held the June 13, unsigned binary.
  2. The bootstrap's us-east-1 fallback only fires when the regional fetch fails. The stale regional object exists, so the fetch succeeds and the fallback never runs → then, with SPORED_SIG_VERIFY=1 (the default since [HIGH] spored bootstrap fails closed in the 7 non-US regions — stale regional buckets have no .sig, and the us-east-1 fallback never triggers #440), the missing .sig at the regional bucket trips the fail-closed check → exit 1.

Fix (two parts)

  1. release.yaml — publish the signed binary to all 11 regions spawn operates in (matching defaultRegions in the ttl-reaper), so no regional bucket serves a stale binary. Backfills the 7 stale buckets on the next release.
  2. bootstrap.go — refactor the download to iterate candidate sources (regional prefixed/legacy → us-east-1 prefixed/legacy) and, when verifying, HEAD-probe the .sig before committing to a source. A stale/unsigned regional bucket now falls through to us-east-1 instead of downloading-then-hard-failing. Robust to a half-populated bucket, not just a missing one.

Scope note

pkg/launcher/bootstrap.go is the only download path that does signature verification (hence the hard-fail). The others (install-spored.sh/.ps1, cmd/app.go upgrade line, pipeline-orchestrator) would only serve a stale binary, not hard-fail — and part 1 (all-region publish) fixes staleness for all of them at the source, so no per-path shell refactor is needed.

Tests

  • TestBuildLinuxBootstrap_SigAwareFallback — asserts the candidate list + up-front .sig HEAD-probe + the old brittle logic is gone.
  • TestBuildLinuxBootstrap_ValidBash — bash -n syntax-checks the generated script so a shell error in the refactor can't ship.
  • Full pkg/launcher suite green.

Rollout

Merging fixes it for future releases. To repair the currently-stale buckets now, either cut a release (re-runs the all-region upload) or backfill v0.93.0's signed spored into the 7 non-US buckets (interim mitigation in the issue: delete the stale objects so the existing fallback kicks in until then). Both are infra-account actions.

The release workflow published spored to 4 US spawn-binaries-* buckets
only, relying on a bootstrap fallback to us-east-1 for the other 7
regions. But those regional buckets held a STALE, UNSIGNED binary from a
prior release — so the bootstrap's regional fetch succeeded (fallback
never fired) and, with SPORED_SIG_VERIFY=1 (the default), the missing
.sig made the install fail closed (exit 1) in ca-central-1/eu-*/ap-*.
Instances there came up with no spored: no TTL/idle enforcement, no DNS.

Two-part fix:
1. release.yaml: publish the signed binary to all 11 regions spawn
   operates in (matching the ttl-reaper's defaultRegions), so no
   regional bucket ever serves a stale binary.
2. bootstrap.go: probe a source's .sig BEFORE committing to it when
   verifying, so a stale/unsigned regional bucket falls through to the
   us-east-1 fallback instead of downloading-then-hard-failing. Iterate
   candidates (regional prefixed/legacy → us-east-1 prefixed/legacy).

Tests: sig-aware-fallback structure + `bash -n` syntax check of the
generated bootstrap.

Note: pkg/launcher/bootstrap.go is the only download path that does sig
verification (hence the hard-fail); the other paths (install-spored.sh/
.ps1, cmd/app.go upgrade, pipeline-orchestrator) would only serve a stale
binary, which part 1 (all-region publish) fixes for all of them.
@scttfrdmn
scttfrdmn merged commit f913691 into main Jul 23, 2026
7 checks passed
@scttfrdmn
scttfrdmn deleted the fix/440-spored-region-distribution branch July 23, 2026 21:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[HIGH] spored bootstrap fails closed in the 7 non-US regions — stale regional buckets have no .sig, and the us-east-1 fallback never triggers

1 participant