Skip to content

pool create: workers lost to the IAM instance-profile race (#572) on pool launch; failure reason empty, 1-of-4 pool reported ready #1448

Closed

Description

@scttfrdmn

spawn 0.148.0, us-west-2, spawn pool create --workers 4 --instance-type c8g.8xlarge (2026-10-30). Two pools in a row lost workers to the IAM→EC2 instance-profile race, and spawn reported the cause as empty.

Pool 1 (--run-id oeb-kissat-m1, default --min-viable 1): reported Pool "oeb-kissat-m1" ready: requested 4 workers (min viable 1), but only one worker existed (i-0cc35bd93d5b619d7, oeb-kissat-m1-worker-1). CloudTrail has RunInstances → Client.InvalidParameterValue: Value (spawn-instance-pool-b566ee05f2b9a8c1) for parameter iamInstanceProfile.name is invalid. Invalid IAM Instance Profile name at 19:11:38Z, and one success at 19:11:39Z. Nothing in the create output said 3 of 4 workers were missing, so a 4-way parallel run went through one worker.

Pool 2 (--run-id oeb-kissat-m2 --min-viable 4), output:

pool failed to reach min viable (4 of 4) workers:
  oeb-kissat-m2-worker-0: cohort-cancelled at phase=launch-acked — culprit=oeb-kissat-m2-worker-1 terminal/ at phase=launch-acked
  oeb-kissat-m2-worker-1: terminal/ at phase=launch-acked after 1 rung(s)
  ...

CloudTrail RunInstances for this pool:

  • 19:47:41Z: workers 0, 1, 2, 3 all rejected with the same Invalid IAM Instance Profile name (spawn-instance-pool-bcea2230f60c4c4b);
  • 19:47:43Z: worker-3 rejected again;
  • 19:47:48Z: workers 0, 2, 3 launched (later cancelled with the cohort).

No retry for worker-1 is visible, though CloudTrail lookup can lag.

Three problems:

  1. Pool launches still lose the race Task launch dies on a transient "Invalid IAM Instance Profile name" — the fixed 10s propagation sleep loses the IAM→EC2 race; RunInstances isn't retried #572 fixed for tasks. runInstancesWithRetry (pkg/aws/client.go, 2 s/4 s/8 s after CreateOrGetInstanceProfile's 10 s wait) either doesn't cover the pool worker path every time, or isn't long enough when 4 workers launch at once against a profile created moments earlier.
  2. The failure reason is empty: terminal/ at phase=launch-acked. The EC2 error (InvalidParameterValue … Invalid IAM Instance Profile name) should be in the cohort record, since it's what tells the user this is transient.
  3. With the default --min-viable 1, "ready" hides a 1-of-4 pool. Printing ready: 1 of 4 workers (and the missing workers' reasons) would make it visible. A transient-error retry that brings the pool to full size would remove most of the need.

Repro: spawn pool create --run-id X --workers 4 --min-viable 4 --instance-type c8g.8xlarge --region us-west-2 --s3-read B --s3-write B with a fresh run id, which creates a new spawn-instance-pool-<hash> profile. 2 of 2 attempts failed today. An earlier 2-worker pool (oeb-kissat-p1, 2026-10-29) came up fully.

Activity

  1. added
    bug
    on Oct 30, 2026
  2. scttfrdmn commented on Oct 30, 2026

    @scttfrdmn
    ContributorAuthor

    Retrying spawn pool create --run-id oeb-kissat-m2 … after the failed attempt (the run's instance profile spawn-instance-pool-bcea2230f60c4c4b still existed, with its role) fails differently: every worker reports terminal/IdempotentParameterMismatch at phase=launch-acked after 1 rung(s). The RunInstances client token looks derived from run id + worker index, so a retry of a failed create can't reuse the run id. Combined with the race above, the only recovery is a new run id, which creates a new profile and is exposed to the race again.

  3. added this to the v0.152.0 milestone on Oct 30, 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