{"record":{"id":"ab995e8e5a446b44","repo":"kubernetes/kops","slug":"spotinst-failed-to-find-launch-spec-q","errorCode":null,"errorMessage":"spotinst: failed to find launch spec %q","messagePattern":"spotinst: failed to find launch spec %q","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"upup/pkg/fi/cloudup/spotinsttasks/launch_spec.go","lineNumber":123,"sourceCode":"\tklog.V(4).Infof(\"Attempting to find LaunchSpec: %q\", fi.ValueOf(o.Name))\n\n\tspecs, err := svc.List(context.Background(), oceanID)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"spotinst: failed to find launch spec %q: %v\", fi.ValueOf(o.Name), err)\n\t}\n\tif len(specs) == 0 {\n\t\treturn nil, fmt.Errorf(\"spotinst: no launch specs associated with ocean %q\", oceanID)\n\t}\n\n\tvar out *aws.LaunchSpec\n\tfor _, spec := range specs {\n\t\tif spec.Name() == fi.ValueOf(o.Name) {\n\t\t\tout = spec.Obj().(*aws.LaunchSpec)\n\t\t\tbreak\n\t\t}\n\t}\n\tif out == nil {\n\t\treturn nil, fmt.Errorf(\"spotinst: failed to find launch spec %q\", fi.ValueOf(o.Name))\n\t}\n\n\tklog.V(4).Infof(\"LaunchSpec/%s: %s\", fi.ValueOf(o.Name), stringutil.Stringify(out))\n\treturn out, nil\n}\n\nvar _ fi.CloudupHasCheckExisting = (*LaunchSpec)(nil)\n\nfunc (o *LaunchSpec) Find(c *fi.CloudupContext) (*LaunchSpec, error) {\n\tcloud := awsup.GetCloud(c)\n\n\tocean, err := o.Ocean.find(cloud.Spotinst().Ocean())\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tspec, err := o.find(cloud.Spotinst().LaunchSpec(), *ocean.ID)\n\tif err != nil {","sourceCodeStart":105,"sourceCodeEnd":141,"githubUrl":"https://github.com/kubernetes/kops/blob/4c8573c808a73d578c5eadc86d410646ea0b0d73/upup/pkg/fi/cloudup/spotinsttasks/launch_spec.go#L105-L141","documentation":"The Ocean has launch specs, but none matches this task's Name. find iterates all specs comparing spec.Name() to the kops LaunchSpec name and errors when no match is found. It signals drift between the Spotinst-side launch spec and the kops instance group.","triggerScenarios":"During Find/update, every listed spec's name differs from fi.ValueOf(o.Name) — e.g. the launch spec was renamed or deleted out-of-band.","commonSituations":"Launch spec deleted manually in Spotinst console; instance group renamed in the cluster spec; specs created by another tool with different naming.","solutions":["Re-run kops update cluster to recreate the missing launch spec","If the instance group was renamed intentionally, delete the old group: kops delete instancegroup <old-name>","Check the Spotinst console for a spec whose name diverges and align naming"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"specs, _ := svc.List(ctx, oceanID)\nnames := map[string]bool{}\nfor _, s := range specs {\n    names[s.Name()] = true\n}\nif !names[expectedName] {\n    return fmt.Errorf(\"launch spec %q missing from ocean; run kops update cluster\", expectedName)\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Do not rename instance groups without deleting the old one","Avoid editing launch spec names directly in the Spotinst console","Reconcile drift with kops update cluster regularly","Keep naming generated by kops rather than hand-edited"],"tags":["spotinst","launch-spec","name-mismatch"],"backgroundTag":"resource-not-found","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"}