Skip to content

spawn launch picks spored verification by the LOCAL OS, not the instance's #882

Closed

Description

@scttfrdmn

Found during the real Windows validation of #879 (2026-10-13).

cmd/launch_single.go Step 10b gates spored verification on:

if waitForSSH && plat.OS != "windows" {
    ... verifySporedReady(...)   // SSM AWS-RunShellScript: /usr/local/bin/spored status

plat is platform.Detect(), and Platform.OS is runtime.GOOS (pkg/platform/platform.go:34) — the OS of the machine running spawn, not of the instance being launched. The instance's OS is already resolved as config.TargetOS.

Consequences, both observed or directly implied

macOS/Linux workstation launching Windows — observed. Launching Windows Server 2025 from macOS ran the Linux check against the Windows instance:

❌ Verifying spored agent (up to 5 min)
Error: spored did not become ready within 5m0s: ssm send-command: ... StatusCode: 400,
  UnsupportedPlatformType: Cannot perform operation for instance id with unsupported platform type.
instance i-061da267b7a9442de launched but spored never came up — it has NO TTL/idle safety net

That was false: spored was installed, verified and running (confirmed over SSM with AWS-RunPowerShellScript). And the launch exited 1. With --terminate-on-error this path would terminate a healthy Windows instance.

Windows workstation launching Linux — implied by the same line. plat.OS == "windows", so Step 10b is skipped entirely: a Linux spore whose spored failed to install would be reported as a successful launch, with no lifecycle enforcement.

Fix

  • Gate on config.TargetOS, not plat.OS.
  • For a Windows target, either verify with AWS-RunPowerShellScript (Get-Service spored) or skip with an explicit message — not run a Linux document.
  • Audit other plat.OS uses in the launch path for the same confusion; plat is legitimately the local OS for SSH key paths and client tooling, which is how the two got conflated.
  • Gate: a test that drives the verification decision with plat.OS="darwin" and TargetOS="windows" (and the reverse) and asserts the decision follows the target.

Activity

  1. added
    bug
    area:windows
    on Oct 13, 2026
  2. added a commit that references this issue on Oct 13, 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

    area:windowsbug

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions