kubernetes/kops · error
error finding launch template or configuration for autoscali
Error message
error finding launch template or configuration for autoscaling group: %s
What it means
findAutoscalingGroupLaunchConfiguration found neither a LaunchConfigurationName nor a usable LaunchTemplateSpecification (direct or via MixedInstancesPolicy) on the ASG. This is a guard error: the ASG named by %s has no launch configuration or launch template attached, which is an invalid/foreign ASG state.
Source
Thrown at upup/pkg/fi/cloudup/awsup/aws_cloud.go:935
}
return true
}
// findAutoscalingGroupLaunchConfiguration is responsible for finding the launch - which could be a launchconfiguration, a template or a mixed instance policy template
func findAutoscalingGroupLaunchConfiguration(ctx context.Context, c AWSCloud, g *autoscalingtypes.AutoScalingGroup) (string, error) {
name := aws.ToString(g.LaunchConfigurationName)
if name != "" {
return name, nil
}
// @check the launch template then
var launchTemplate *autoscalingtypes.LaunchTemplateSpecification
if g.LaunchTemplate != nil {
launchTemplate = g.LaunchTemplate
} else if g.MixedInstancesPolicy != nil && g.MixedInstancesPolicy.LaunchTemplate != nil && g.MixedInstancesPolicy.LaunchTemplate.LaunchTemplateSpecification != nil {
launchTemplate = g.MixedInstancesPolicy.LaunchTemplate.LaunchTemplateSpecification
} else {
return "", fmt.Errorf("error finding launch template or configuration for autoscaling group: %s", aws.ToString(g.AutoScalingGroupName))
}
id := aws.ToString(launchTemplate.LaunchTemplateId)
if id == "" {
return "", fmt.Errorf("error finding launch template ID for autoscaling group: %s", aws.ToString(g.AutoScalingGroupName))
}
version := aws.ToString(launchTemplate.Version)
// Correctly Handle Default and Latest Versions
klog.V(4).Infof("Launch Template Version Specified By ASG: %v", version)
if version == "" || version == "$Default" || version == "$Latest" {
input := &ec2.DescribeLaunchTemplatesInput{
LaunchTemplateIds: []string{id},
}
output, err := c.EC2().DescribeLaunchTemplates(ctx, input)
if err != nil {
return "", fmt.Errorf("error describing launch templates: %q", err)
}View on GitHub (pinned to 4c8573c808)
Solutions
- Inspect the named ASG in the AWS console and attach a valid launch template or launch configuration
- If the ASG was created outside kops or is leftover, delete it or tag it so kops no longer matches it to the cluster
- Recreate the ASG through kops (rolling-update) so it is provisioned with a proper launch template
Defensive patterns
Strategy: validation
When it happens
Trigger: Thrown at upup/pkg/fi/cloudup/awsup/aws_cloud.go:935 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of kubernetes/kops@4c8573c808 (2026-09-05).
Data as JSON: /api/errors/281d1305829683e2.
Report an issue: GitHub.