Skip to content

TTL/idle 'stop' leaves the Elastic IP attached → silent indefinite billing on a stopped instance #262

Closed

Description

@scttfrdmn

Summary

When TTL or idle-timeout fires with the stop action (the default idle action, per --hibernate-on-idle docs noting "the default idle action is stop, not terminate"), the instance stops but its Elastic IP stays allocated and attached. AWS bills for an EIP associated with a stopped instance (~$3.60/mo each), so a TTL that "worked" silently leaks money for as long as the box stays stopped — which can be indefinitely.

This is the same class as #247 (ttl-reaper leaks Route53 DNS records when reaping): the lifecycle action cleans up the instance but leaves an attached, billable resource dangling.

How we hit it (fieldwork / BuckAI)

Found a pile of stopped Tutorial 02/04 boxes in us-east-2 (FEM cluster hpc6a/c5n.18xlarge, deforestation r7i), each still holding an EIP weeks after TTL stopped them:

16.58.5.183    → i-... (fem-cluster-0, STOPPED)     EIP still billing
16.59.228.132  → i-... (buckai-deforestation, STOPPED) EIP still billing
3.150.53.109   → (fully unattached orphan)           EIP still billing

TTL did fire — it stopped the instances as designed. But "stop" left the EIPs attached, so the cost the user expected TTL to bound kept accruing via EBS + EIP. The user's reaction was telling: "Wonder why they weren't terminated with TTL" — i.e. the mental model is "TTL bounds my cost," but stop-not-terminate breaks that for attached EIPs.

Expected

One of:

  1. On TTL/idle stop, release (or at least disassociate) the EIP — symmetric with the ttl-reaper leaks Route53 DNS records: must delete DNS when reaping an instance #247 DNS cleanup. An EIP on a stopped instance is pure waste; nothing can use the static address while the box is down, and a restarted box can get a fresh one.
  2. At minimum, warn: spawn status / spawn list should flag "stopped instance holding a billable EIP" so it's visible, not silent.
  3. Consider making --on-complete terminate the documented default for batch/headless workloads, with stop reserved for interactive/debugging — stop's hidden ongoing cost surprises users who think TTL caps spend.

Workaround

Manually release-address after the box stops (we released 3, terminated 12 stopped boxes). But that defeats the point of TTL being the safety net.

Environment

  • spawn (current), us-east-2 and us-west-2
  • Surfaced during the fieldwork SAM-pipeline engagement (Tutorials 02/04 leftovers)

Activity

  1. added
    bug
    on Jun 27, 2026
  2. scttfrdmn commented on Jul 7, 2026

    @scttfrdmn
    ContributorAuthor

    Still live on spawn v0.68.1 — fresh evidence from a handover audit

    Doing an end-to-end acceptance pass for a project handover, I swept a dev account in us-west-2 and this still reproduces exactly as filed — on spawn v0.68.1, well past the version this was reported on.

    Stopped-box-holding-billable-resources case: a g5.12xlarge launched with --on-complete stop was stopped by TTL/idle ~10 days ago and its 30 GiB gp3 root volume has been billing continuously ever since. The original mental model in this issue — "TTL bounds my cost" — is exactly what breaks.

    Orphan EIP case: one unassociated Elastic IP (AssociationId=None, no Name tag) sitting idle (~$3.60/mo). Other EIPs in the account are legitimately in use by unrelated stacks, so this one clearly stands out as the leak.

    For fix item #2 (make leaks visible): spawn orphans under-reports here — it listed EBS volumes that had already been deleted (stale; DescribeVolumes → InvalidVolume.NotFound) and did not surface either the stopped instance's still-attached volume or the orphan EIP as billable-leak concerns. So the "at minimum, warn" path isn't catching this class today.

    Reinforces the earlier point (+ lagotto#29/#48): in an end-user account with no hosted reaper, stop-not-terminate is an unbounded leak — nothing ever releases the EIP or deletes the EBS. --on-complete terminate is the only reliable defense, which argues for fix item #3 (make terminate the documented default for batch/headless).

    Workaround for the handover: all launchers now hard-code --on-complete terminate + --fsx-lifecycle ephemeral, with a documented manual leak-sweep since this account has no reaper. Happy to test a fix on the launcher.Provision + local-daemon path.

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

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions