{"record":{"id":"281d1305829683e2","repo":"kubernetes/kops","slug":"error-finding-launch-template-or-configuration-for","errorCode":null,"errorMessage":"error finding launch template or configuration for autoscaling group: %s","messagePattern":"error finding launch template or configuration for autoscaling group: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"upup/pkg/fi/cloudup/awsup/aws_cloud.go","lineNumber":935,"sourceCode":"\t}\n\treturn true\n}\n\n// findAutoscalingGroupLaunchConfiguration is responsible for finding the launch - which could be a launchconfiguration, a template or a mixed instance policy template\nfunc findAutoscalingGroupLaunchConfiguration(ctx context.Context, c AWSCloud, g *autoscalingtypes.AutoScalingGroup) (string, error) {\n\tname := aws.ToString(g.LaunchConfigurationName)\n\tif name != \"\" {\n\t\treturn name, nil\n\t}\n\n\t// @check the launch template then\n\tvar launchTemplate *autoscalingtypes.LaunchTemplateSpecification\n\tif g.LaunchTemplate != nil {\n\t\tlaunchTemplate = g.LaunchTemplate\n\t} else if g.MixedInstancesPolicy != nil && g.MixedInstancesPolicy.LaunchTemplate != nil && g.MixedInstancesPolicy.LaunchTemplate.LaunchTemplateSpecification != nil {\n\t\tlaunchTemplate = g.MixedInstancesPolicy.LaunchTemplate.LaunchTemplateSpecification\n\t} else {\n\t\treturn \"\", fmt.Errorf(\"error finding launch template or configuration for autoscaling group: %s\", aws.ToString(g.AutoScalingGroupName))\n\t}\n\n\tid := aws.ToString(launchTemplate.LaunchTemplateId)\n\tif id == \"\" {\n\t\treturn \"\", fmt.Errorf(\"error finding launch template ID for autoscaling group: %s\", aws.ToString(g.AutoScalingGroupName))\n\t}\n\n\tversion := aws.ToString(launchTemplate.Version)\n\t// Correctly Handle Default and Latest Versions\n\tklog.V(4).Infof(\"Launch Template Version Specified By ASG: %v\", version)\n\tif version == \"\" || version == \"$Default\" || version == \"$Latest\" {\n\t\tinput := &ec2.DescribeLaunchTemplatesInput{\n\t\t\tLaunchTemplateIds: []string{id},\n\t\t}\n\t\toutput, err := c.EC2().DescribeLaunchTemplates(ctx, input)\n\t\tif err != nil {\n\t\t\treturn \"\", fmt.Errorf(\"error describing launch templates: %q\", err)\n\t\t}","sourceCodeStart":917,"sourceCodeEnd":953,"githubUrl":"https://github.com/kubernetes/kops/blob/4c8573c808a73d578c5eadc86d410646ea0b0d73/upup/pkg/fi/cloudup/awsup/aws_cloud.go#L917-L953","documentation":"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.","triggerScenarios":"Thrown at upup/pkg/fi/cloudup/awsup/aws_cloud.go:935 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","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"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"4c8573c808a73d578c5eadc86d410646ea0b0d73","analyzedAt":"2026-09-05T04:13:19.212Z","contentChangedAt":"2026-09-05T04:13:19.212Z","schemaVersion":2},"datasetVersion":"2026-09-12T07:17:12.445Z"}