{"record":{"id":"9408c4054406f516","repo":"kubernetes/kops","slug":"error-describing-launch-templates-q","errorCode":null,"errorMessage":"error describing launch templates: %q","messagePattern":"error describing launch templates: %q","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"upup/pkg/fi/cloudup/awsup/aws_cloud.go","lineNumber":952,"sourceCode":"\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}\n\t\tif len(output.LaunchTemplates) == 0 {\n\t\t\treturn \"\", fmt.Errorf(\"error finding launch template by ID: %q\", id)\n\t\t}\n\t\tlaunchTemplate := output.LaunchTemplates[0]\n\t\tif version == \"$Latest\" {\n\t\t\tversion = strconv.FormatInt(*launchTemplate.LatestVersionNumber, 10)\n\t\t} else {\n\t\t\tversion = strconv.FormatInt(*launchTemplate.DefaultVersionNumber, 10)\n\t\t}\n\t}\n\tklog.V(4).Infof(\"Launch Template Version used for compare: %q\", version)\n\n\treturn fmt.Sprintf(\"%s:%s\", id, version), nil\n}\n\n// findInstanceLaunchConfiguration is responsible for discoverying the launch configuration for an instance\nfunc findInstanceLaunchConfiguration(i autoscalingtypes.Instance) string {","sourceCodeStart":934,"sourceCodeEnd":970,"githubUrl":"https://github.com/kubernetes/kops/blob/4c8573c808a73d578c5eadc86d410646ea0b0d73/upup/pkg/fi/cloudup/awsup/aws_cloud.go#L934-L970","documentation":"The EC2 DescribeLaunchTemplates call failed while resolving the default/latest version of the ASG's launch template (when the ASG specifies $Default/$Latest or no version). Fires on API errors, throttling, or missing ec2:DescribeLaunchTemplates permission.","triggerScenarios":"Thrown at upup/pkg/fi/cloudup/awsup/aws_cloud.go:952 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Verify IAM permission ec2:DescribeLaunchTemplates","Retry after a backoff if the wrapped error shows throttling","Confirm the launch template ID still exists in the account and region"],"exampleFix":null,"handlingStrategy":"retry","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"}