kubernetes/kops · error

error modifying warm pool: %w

Error message

error modifying warm pool: %w

What it means

Wraps non-ValidationError failures from the autoscaling PutWarmPool API in warm-pool RenderAWS. ValidationError is retried with TryAgainLaterError; any other SDK error (permissions, invalid config, ASG gone) is wrapped with this message. Thrown from a private RenderAWS method.

Source

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

	if changes != nil {
		if fi.ValueOf(e.Enabled) {
			minSize := e.MinSize
			maxSize := e.MaxSize
			if maxSize == nil {
				maxSize = new(int32(-1))
			}
			request := &autoscaling.PutWarmPoolInput{
				AutoScalingGroupName:     e.AutoscalingGroup.Name,
				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. Add autoscaling:PutWarmPool and autoscaling:DeleteWarmPool to the IAM policy
  2. Check the ASG still exists and its name matches the task (AutoScalingGroup ref)
  3. Remove or fix the warmPool spec (maxSize, minSize, instanceReusePolicy) in the instance group
  4. Inspect the wrapped AWS error code for the precise cause

Example fix

// before
_, err := svc.PutWarmPool(ctx, request)
if err != nil {
	if awsup.AWSErrorCode(err) == "ValidationError" { return fi.NewTryAgainLaterError(...).WithError(err) }
	return fmt.Errorf("error modifying warm pool: %w", err)
}
// after: also retry on throttling
if awsup.AWSErrorCode(err) == "Throttling" { return fi.NewTryAgainLaterError("warm pool throttled").WithError(err) }
Defensive patterns

Strategy: retry

Validate before calling

if !iamAllows("autoscaling:PutWarmPool") { return errors.New("IAM policy missing autoscaling:PutWarmPool") }
out, _ := asg.DescribeAutoScalingGroups(&autoscaling.DescribeAutoScalingGroupsInput{AutoScalingGroupNames: []string{asgName}})
if len(out.AutoScalingGroups) == 0 { return errors.New("ASG not found") }

Try / catch

_, err := svc.PutWarmPool(ctx, request)
if err != nil {
	if code := awsup.AWSErrorCode(err); code == "ValidationError" || code == "Throttling" {
		return fi.NewTryAgainLaterError("waiting for ASG to become ready").WithError(err)
	}
	return err
}

Prevention

When it happens

Trigger: PutWarmPool returns e.g. AccessDenied, LimitExceeded, or a malformed request (invalid InstanceReusePolicy) during cluster apply; the ASG exists but warm pool settings cannot be written.

Common situations: IAM policy missing autoscaling:PutWarmPool; ASG deleted concurrently; warm pool not supported for the launch template's configuration (e.g. spot instances without warm-pool support in region/SDK); cluster spec sets warmPool improperly.

Related errors


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