{"record":{"id":"d5f3e65a14350907","repo":"kubernetes/kops","slug":"error-modifying-warm-pool-w","errorCode":null,"errorMessage":"error modifying warm pool: %w","messagePattern":"error modifying warm pool: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"upup/pkg/fi/cloudup/awstasks/warmpool.go","lineNumber":140,"sourceCode":"\tif changes != nil {\n\t\tif fi.ValueOf(e.Enabled) {\n\t\t\tminSize := e.MinSize\n\t\t\tmaxSize := e.MaxSize\n\t\t\tif maxSize == nil {\n\t\t\t\tmaxSize = new(int32(-1))\n\t\t\t}\n\t\t\trequest := &autoscaling.PutWarmPoolInput{\n\t\t\t\tAutoScalingGroupName:     e.AutoscalingGroup.Name,\n\t\t\t\tMaxGroupPreparedCapacity: maxSize,\n\t\t\t\tMinSize:                  new(minSize),\n\t\t\t}\n\n\t\t\t_, err := svc.PutWarmPool(ctx, request)\n\t\t\tif err != nil {\n\t\t\t\tif awsup.AWSErrorCode(err) == \"ValidationError\" {\n\t\t\t\t\treturn fi.NewTryAgainLaterError(\"waiting for ASG to become ready\").WithError(err)\n\t\t\t\t}\n\t\t\t\treturn fmt.Errorf(\"error modifying warm pool: %w\", err)\n\t\t\t}\n\t\t} else if a != nil {\n\t\t\t_, err := svc.DeleteWarmPool(ctx, &autoscaling.DeleteWarmPoolInput{\n\t\t\t\tAutoScalingGroupName: e.AutoscalingGroup.Name,\n\t\t\t\t// We don't need to do any cleanup so, the faster the better\n\t\t\t\tForceDelete: new(true),\n\t\t\t})\n\t\t\tif err != nil {\n\t\t\t\treturn fmt.Errorf(\"error deleting warm pool: %w\", err)\n\t\t\t}\n\t\t}\n\t}\n\treturn nil\n}\n\n// For the terraform target, warmpool config is rendered inside the AutoscalingGroup resource\nfunc (_ *WarmPool) RenderTerraform(t *terraform.TerraformTarget, a, e, changes *WarmPool) error {\n\treturn nil","sourceCodeStart":122,"sourceCodeEnd":158,"githubUrl":"https://github.com/kubernetes/kops/blob/4c8573c808a73d578c5eadc86d410646ea0b0d73/upup/pkg/fi/cloudup/awstasks/warmpool.go#L122-L158","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","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"],"exampleFix":"// before\n_, err := svc.PutWarmPool(ctx, request)\nif err != nil {\n\tif awsup.AWSErrorCode(err) == \"ValidationError\" { return fi.NewTryAgainLaterError(...).WithError(err) }\n\treturn fmt.Errorf(\"error modifying warm pool: %w\", err)\n}\n// after: also retry on throttling\nif awsup.AWSErrorCode(err) == \"Throttling\" { return fi.NewTryAgainLaterError(\"warm pool throttled\").WithError(err) }","handlingStrategy":"retry","validationCode":"if !iamAllows(\"autoscaling:PutWarmPool\") { return errors.New(\"IAM policy missing autoscaling:PutWarmPool\") }\nout, _ := asg.DescribeAutoScalingGroups(&autoscaling.DescribeAutoScalingGroupsInput{AutoScalingGroupNames: []string{asgName}})\nif len(out.AutoScalingGroups) == 0 { return errors.New(\"ASG not found\") }","typeGuard":null,"tryCatchPattern":"_, err := svc.PutWarmPool(ctx, request)\nif err != nil {\n\tif code := awsup.AWSErrorCode(err); code == \"ValidationError\" || code == \"Throttling\" {\n\t\treturn fi.NewTryAgainLaterError(\"waiting for ASG to become ready\").WithError(err)\n\t}\n\treturn err\n}","preventionTips":["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"],"tags":["aws","autoscaling","warm-pool"],"backgroundTag":"aws-api-call-failed","analyzedSha":"4c8573c808a73d578c5eadc86d410646ea0b0d73","analyzedAt":"2026-09-05T04:13:19.212Z","contentChangedAt":"2026-09-05T04:13:19.212Z","schemaVersion":2},"datasetVersion":"2026-09-12T12:17:11.808Z"}