Skip to content

Spot price is almost never recorded at launch: recordLaunchSpotPrice hits InvalidInstanceID.NotFound right after RunInstances and does not retry #1442

Closed

Description

@scttfrdmn

Summary

recordLaunchSpotPrice (#896) almost never records spawn:spot-price-per-hour. It calls DescribeInstances right after RunInstances, gets EC2's eventual-consistency InvalidInstanceID.NotFound, and gives up because it never retries. spored then costs every spot instance at the on-demand rate, and spawn status shows both rates in one screen.

Evidence

Live launch, v0.151.0 released CLI, account 942542972736, us-east-1d. The command was spawn launch nopub151 --instance-type c8gn.48xlarge --spot --efa --no-public-ip --ttl 1h --yes --az us-east-1d, and the instance was i-0faa599bdda83e113:

~/.spawn/spawn.log
2026/10/30 07:20:09 note: could not record the spot price for i-0faa599bdda83e113 (describe instance: operation error EC2: DescribeInstances, https response error StatusCode: 400, ... api error InvalidInstanceID.NotFound: The instance ID 'i-0faa599bdda83e113' does not exist); status will show the on-demand rate for it

The instance's tags had no spawn:spot-price-per-hour (spawn:price-per-hour 11.376000 was present).

spawn status then contradicted itself within a single output:

  Compute cost:     $0.12  (38s billed × $11.3760/hr on-demand (spot price unknown))
  Spot rate:        unknown — costs above use the on-demand rate, so they overstate
...
  Max compute cost:      ~$5.59 by deadline at the current spot price (~$11.38 at on-demand)
  instance  i-0faa599bdda83e113    ~$5.5889/hr              c8gn.48xlarge (spot) — current spot price

The CLI's billable section falls back to CurrentSpotPrice, a live lookup. spored's block (statusComputeRate) only has the tag, so it overstates by about 2x here.

How often: this workstation's ~/.spawn/spawn.log has 99 could not record the spot price lines since 2026-10-18, and every one of them is InvalidInstanceID.NotFound:

$ grep "could not record the spot price" ~/.spawn/spawn.log | grep -c InvalidInstanceID.NotFound
99
$ grep -c "could not record the spot price" ~/.spawn/spawn.log
99

Cause (v0.151.0)

  • pkg/aws/client.go:750 calls recordLaunchSpotPrice(ctx, ec2Client, result.Instances[0]) immediately after RunInstances.
  • In pkg/aws/spotprice.go, spotPriceForInstance re-describes the instance when the RunInstances result lacks PlatformDetails or the placement. That re-describe is the call that hits NotFound, and there is no retry. The 10s context leaves room for one.

Fix options

  • Retry the DescribeInstances on InvalidInstanceID.NotFound with a short backoff inside the existing 10s budget.
  • Or skip the re-describe: the AZ is known from the launch config and subnet, and the product description can come from the AMI's PlatformDetails (DescribeImages, which has no consistency lag).

Display-only: --cost-limit is enforced against the on-demand price by design, so this overstates and never understates.

Found during the v0.151.0 --no-public-ip multi-card EFA live test.

Activity

  1. added this to the v0.152.0 milestone on Oct 30, 2026
  2. added
    bug
    area:launch
    area:cost
    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

    area:costarea:launchbug

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions