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 nilView on GitHub (pinned to 4c8573c808)
Solutions
- Add autoscaling:PutWarmPool and autoscaling:DeleteWarmPool to the IAM policy
- Check the ASG still exists and its name matches the task (AutoScalingGroup ref)
- Remove or fix the warmPool spec (maxSize, minSize, instanceReusePolicy) in the instance group
- 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
- Grant autoscaling:PutWarmPool/DeleteWarmPool to the kOps role
- Don't set warmPool on instance groups that don't support it (e.g. spot) unless the region supports warm pools
- Avoid deleting ASGs out-of-band while kOps applies
- Keep maxSize/minSize of warmPool within ASG capacity
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
- error deleting warm pool: %w
- DIGITALOCEAN_ACCESS_TOKEN is required
- the image for the hook exec action not set
- IP version is incorrect
- ErrAlreadyExists
AI-assisted analysis of kubernetes/kops@4c8573c808 (2026-09-05).
Data as JSON: /api/errors/d5f3e65a14350907.
Report an issue: GitHub.