{"record":{"id":"b5e2d6ec3ddc666f","repo":"kubernetes/kops","slug":"could-not-find-one-of-launch-template-or-mixed-ins","errorCode":null,"errorMessage":"could not find one of launch template or mixed instances policy","messagePattern":"could not find one of launch template or mixed instances policy","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"upup/pkg/fi/cloudup/awstasks/autoscalinggroup.go","lineNumber":420,"sourceCode":"\t\t\t\t},\n\t\t\t}\n\t\t\tp := request.MixedInstancesPolicy.LaunchTemplate\n\t\t\tfor _, x := range e.MixedInstanceOverrides {\n\t\t\t\tp.Overrides = append(p.Overrides, autoscalingtypes.LaunchTemplateOverrides{\n\t\t\t\t\tInstanceType: new(x),\n\t\t\t\t},\n\t\t\t\t)\n\t\t\t}\n\t\t\tif e.InstanceRequirements != nil {\n\t\t\t\tp.Overrides = append(p.Overrides, overridesFromInstanceRequirements(e.InstanceRequirements))\n\t\t\t}\n\t\t} else if e.LaunchTemplate != nil {\n\t\t\trequest.LaunchTemplate = &autoscalingtypes.LaunchTemplateSpecification{\n\t\t\t\tLaunchTemplateId: e.LaunchTemplate.ID,\n\t\t\t\tVersion:          aws.String(\"$Latest\"),\n\t\t\t}\n\t\t} else {\n\t\t\treturn fmt.Errorf(\"could not find one of launch template or mixed instances policy\")\n\t\t}\n\n\t\t// @step: attempt to create the autoscaling group for us\n\t\tif _, err := t.Cloud.Autoscaling().CreateAutoScalingGroup(ctx, request); err != nil {\n\t\t\tcode := awsup.AWSErrorCode(err)\n\t\t\tmessage := awsup.AWSErrorMessage(err)\n\t\t\tif code == \"ValidationError\" && strings.Contains(message, \"Invalid IAM Instance Profile name\") {\n\t\t\t\tklog.V(4).Infof(\"error creating AutoscalingGroup: %s\", message)\n\t\t\t\treturn fi.NewTryAgainLaterError(\"waiting for the IAM Instance Profile to be propagated\")\n\t\t\t}\n\t\t\treturn fmt.Errorf(\"error creating AutoScalingGroup: %s\", message)\n\t\t}\n\n\t\t// @step: attempt to enable the metrics for us\n\t\tif _, err := t.Cloud.Autoscaling().EnableMetricsCollection(ctx, &autoscaling.EnableMetricsCollectionInput{\n\t\t\tAutoScalingGroupName: e.Name,\n\t\t\tGranularity:          e.Granularity,\n\t\t\tMetrics:              e.Metrics,","sourceCodeStart":402,"sourceCodeEnd":438,"githubUrl":"https://github.com/kubernetes/kops/blob/4c8573c808a73d578c5eadc86d410646ea0b0d73/upup/pkg/fi/cloudup/awstasks/autoscalinggroup.go#L402-L438","documentation":"An AutoScalingGroup must be launched either from a Launch Template or a MixedInstancesPolicy. When neither is populated on the task, kOps cannot build a valid CreateAutoScalingGroupInput and fails before calling AWS.","triggerScenarios":"RenderAWS reaches ASG creation with e.MixedInstanceOverrides/launch-template wiring absent AND e.LaunchTemplate == nil — i.e. the instance group produced neither configuration (internal wiring failure or unsupported combination of spec fields).","commonSituations":"Custom/patched cluster specs that bypass launch-template generation, unsupported instance-type mixes, or kOps bugs on older versions when spot instances/mixed policies were configured.","solutions":["Upgrade kops to a version matching your cluster spec features (mixed instances/spot support)","Review the InstanceGroup spec: ensure instance types and launch-template settings are valid so kOps generates a launch template","Rebuild the cluster spec with `kops edit instancegroup` and re-run `kops update cluster`","If it persists, file/check kops issues — this indicates a code path that should never be hit"],"exampleFix":"null","handlingStrategy":"validation","validationCode":"# confirm kops generates a launch template for the instance group\nkops get instancegroups --name mycluster -o yaml | grep -A3 launchTemplate\n# and inspect the ASG create request in `kops update cluster --dry-run` output","typeGuard":"null","tryCatchPattern":"null","preventionTips":["Keep kops version in sync with cluster spec version in state store","Don't hand-patch rendered task graphs; edit the cluster spec instead","Validate mixed-instances/spot config is supported by your kops version before applying"],"tags":["aws","autoscaling","launch-template","missing-config"],"backgroundTag":"missing-launch-configuration","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"}