kubernetes/kops · error

error describing launch templates: %q

Error message

error describing launch templates: %q

What it means

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.

Source

Thrown at upup/pkg/fi/cloudup/awsup/aws_cloud.go:952

	} 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)
		}
		if len(output.LaunchTemplates) == 0 {
			return "", fmt.Errorf("error finding launch template by ID: %q", id)
		}
		launchTemplate := output.LaunchTemplates[0]
		if version == "$Latest" {
			version = strconv.FormatInt(*launchTemplate.LatestVersionNumber, 10)
		} else {
			version = strconv.FormatInt(*launchTemplate.DefaultVersionNumber, 10)
		}
	}
	klog.V(4).Infof("Launch Template Version used for compare: %q", version)

	return fmt.Sprintf("%s:%s", id, version), nil
}

// findInstanceLaunchConfiguration is responsible for discoverying the launch configuration for an instance
func findInstanceLaunchConfiguration(i autoscalingtypes.Instance) string {

View on GitHub (pinned to 4c8573c808)

Solutions

  1. Verify IAM permission ec2:DescribeLaunchTemplates
  2. Retry after a backoff if the wrapped error shows throttling
  3. Confirm the launch template ID still exists in the account and region
Defensive patterns

Strategy: retry

When it happens

Trigger: Thrown at upup/pkg/fi/cloudup/awsup/aws_cloud.go:952 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/9408c4054406f516. Report an issue: GitHub.