kubernetes/kops · error

error deleting warm pool: %w

Error message

error deleting warm pool: %w

What it means

Wraps failures from autoscaling DeleteWarmPool during warm-pool RenderAWS when the warm pool must be removed (actual exists but expected is empty). ForceDelete=true is used, so most state errors are avoided; remaining errors are permissions or the ASG being concurrently mutated/deleted.

Source

Thrown at upup/pkg/fi/cloudup/awstasks/warmpool.go:149

				MaxGroupPreparedCapacity: maxSize,
				MinSize:                  new(minSize),
			}

			_, err := svc.PutWarmPool(ctx, request)
			if err != nil {
				if awsup.AWSErrorCode(err) == "ValidationError" {
					return fi.NewTryAgainLaterError("waiting for ASG to become ready").WithError(err)
				}
				return fmt.Errorf("error modifying warm pool: %w", err)
			}
		} else if a != nil {
			_, err := svc.DeleteWarmPool(ctx, &autoscaling.DeleteWarmPoolInput{
				AutoScalingGroupName: e.AutoscalingGroup.Name,
				// We don't need to do any cleanup so, the faster the better
				ForceDelete: new(true),
			})
			if err != nil {
				return fmt.Errorf("error deleting warm pool: %w", err)
			}
		}
	}
	return nil
}

// For the terraform target, warmpool config is rendered inside the AutoscalingGroup resource
func (_ *WarmPool) RenderTerraform(t *terraform.TerraformTarget, a, e, changes *WarmPool) error {
	return nil
}

View on GitHub (pinned to 4c8573c808)

Solutions

  1. Grant autoscaling:DeleteWarmPool in the IAM policy
  2. Re-run kops update cluster — if the ASG/warm pool was already deleted, reconcile state (kops delete with --allow-deletes or re-create spec)
  3. Verify the AutoScalingGroup name/region matches the task before retrying
  4. Check the wrapped AWS error code; NotFound usually means state was already converged

Example fix

// before
if err != nil {
	return fmt.Errorf("error deleting warm pool: %w", err)
}
// after
if err != nil {
	if awsup.AWSErrorCode(err) == "ValidationError" { return fi.NewTryAgainLaterError("waiting for ASG").WithError(err) }
	return fmt.Errorf("error deleting warm pool: %w", err)
}
Defensive patterns

Strategy: retry

Validate before calling

if !iamAllows("autoscaling:DeleteWarmPool") { return errors.New("IAM policy missing autoscaling:DeleteWarmPool") }
out, _ := asg.DescribeWarmPool(&autoscaling.DescribeWarmPoolInput{AutoScalingGroupName: &asgName})
_ = out // confirm warm pool still exists before delete

Try / catch

_, err := svc.DeleteWarmPool(ctx, req)
if err != nil {
	if code := awsup.AWSErrorCode(err); code == "Throttling" || code == "ValidationError" {
		return fi.NewTryAgainLaterError("warm pool delete retried").WithError(err)
	}
	return err
}

Prevention

When it happens

Trigger: RenderAWS takes the a != nil branch (warm pool exists, not desired anymore) and svc.DeleteWarmPool returns any SDK error.

Common situations: IAM missing autoscaling:DeleteWarmPool; two applies racing — another process deleted the ASG/warm pool first; region mismatch causing 'ASG not found' after a config change.

Related errors


AI-assisted analysis of kubernetes/kops@4c8573c808 (2026-09-05). Data as JSON: /api/errors/8faa371f964d1d09. Report an issue: GitHub.