Skip to content

spored-availability preflight for regions without a bucket; spored verification is missing on Windows and possibly on non-single launch paths #878

Open

Description

@scttfrdmn

Raised by the maintainer: "spawn should have a check when it is used in a region that spored is not available." Investigated before filing; the gap is wider than a missing preflight, because when it bites, the user is told everything worked.

Six enabled regions have no spored bucket

Release publishes spored to 11 regional buckets (release.yaml). The dev account has 17 enabled regions. Enabled but no spawn-binaries-<region> bucket:

ap-northeast-2  ap-northeast-3  ap-south-1  eu-north-1  eu-west-3  sa-east-1

Nothing in spawn launch or spawn doctor checks this.

The fallback works only with public-internet egress

The bootstrap tries spawn-binaries-${REGION} then spawn-binaries-us-east-1 (pkg/launcher/bootstrap.go:372-373; Windows: cmd/launch_config.go:555). So in those six regions spored still installs — provided the instance can reach us-east-1's S3 over the public internet. An instance in a private subnet whose only S3 path is a gateway endpoint can reach its own region's S3 and never another region's, so in a bucket-less region it cannot get spored at all.

When both sources fail, the user is told it succeeded

The install is fail-closed (correctly), and the bootstrap aborts:

if ! spore_install_verified_spored "$BINARY" ...; then
    echo "spored install failed — aborting bootstrap rather than running an unverified agent"
    exit 1

That exit 1 comes before the login user is created and its SSH key installed. The instance keeps running and billing with no in-instance lifecycle at all — no TTL, no idle stop, no cost-limit — and the out-of-band reaper backstops only the accounts it covers.

Meanwhile spawn launch waits for SSH by default (--wait-for-ssh=true), and waitForSSHReady (cmd/launch_posthook.go) is a TCP dial to port 22. sshd listens whether or not the bootstrap aborted, so the launch reports success.

The same silent path is reached by any install failure, not only missing regions: a bucket outage, a missing .sig, or a .sha256 that disagrees with its binary — which is exactly what #876's script would have produced in every region at once.

What to build

Two parts, and the second matters more:

The second is what turns a silent, indefinitely-billing instance into a visible failure, which is why it should not wait on #20.

Related: #20 (manifest), #876 (the script that would have broken installs everywhere), and the "everything dies eventually" invariant.

Activity

  1. added
    bug
    on Oct 13, 2026
  2. changed the title [-]spawn launch should check spored is available in the region, and notice when its install failed[/-] [+]spored-availability preflight for regions without a bucket; spored verification is missing on Windows and possibly on non-single launch paths[/+] on Oct 13, 2026
  3. scttfrdmn commented on Oct 13, 2026

    @scttfrdmn
    ContributorAuthor

    Correction — the central claim of this issue is wrong for the default Linux path. I wrote that spawn launch reports success after only a TCP check on port 22. It doesn't. I stopped reading at the SSH wait and missed the step immediately after it:

    // cmd/launch_single.go — Step 10b (#50)
    if waitForSSH && plat.OS != "windows" {
        prog.Start("Verifying spored agent (up to 5 min)")
        if err := verifySporedReady(ctx, awsClient, config.Region, result.InstanceID, 5*time.Minute); err != nil {
            ...
            return fmt.Errorf("instance %s launched but spored never came up — it has NO TTL/idle safety net; ...")

    verifySporedReady waits for SSM, runs /usr/local/bin/spored status, and fails the launch if spored isn't running, honouring --terminate-on-error. So on the default Linux path a failed spored install is already loud. Retitled accordingly.

    What actually remains

    1. The preflight — the maintainer's original ask — still stands unchanged. Six enabled regions have no spored bucket, the fallback needs public-internet egress, and nothing tells the user before launch. Step 10b catches the consequence after a 5-minute wait; a preflight would say so before RunInstances, which is cheaper and clearer.
    2. Windows: confirmed gap. Step 10b is skipped by plat.OS != "windows", and the Windows bootstrap's install continues on failure (Verify spored on the Windows launch path, and fail closed #879 / GHSA-q59f-6gc3-qj2p). So a Windows spore without spored genuinely is silent.
    3. --wait-for-ssh=false skips Step 10b. Documented escape hatch; fine, but worth one line in the flag help saying it also skips spored verification.
    4. Other launch paths — to check, not claimed. Only launch_single calls verifySporedReady. A name-based grep finds no reference to it, spored status or WaitForSSMOnline in cmd/launch_jobarray.go, cmd/launch_sweep.go, cmd/task.go, cmd/app.go, cmd/service.go, pkg/launcher/provision.go or lambda/sweep-orchestrator. Some may verify indirectly; each needs reading before anything is built. If any genuinely don't, the right fix is probably verifying from spored's side — the heartbeat tag (No caller-facing way to wait for job completion without guessing a wall-clock deadline — OnComplete's sentinel is on-instance only, and task run --wait has the same guess-a-deadline flaw #497) — rather than an SSM round-trip per instance, since sweeps and the Lambda orchestrator launch in bulk and cannot hold an SSM session per spore.

    I've updated the checklist below to match.

  4. scttfrdmn commented on Oct 19, 2026

    @scttfrdmn
    ContributorAuthor

    Status from #1196 (open, not merged):

  5. modified the milestones: v0.136.0, Later on Oct 20, 2026
  6. scttfrdmn commented on Oct 20, 2026

    @scttfrdmn
    ContributorAuthor

    The Windows part shipped in #1196 (v0.136.0): heartbeat verification covers Windows, and --wait-for-ssh=false now says that spored wasn't verified. The bucket-less-region preflight needs the region manifest (#20), so this moves to Later.

  7. modified the milestones: Later, Hardening on Nov 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions