{"record":{"id":"79de3700e7661448","repo":"kubernetes/kops","slug":"spotinst-no-launch-specs-associated-with-ocean-q","errorCode":null,"errorMessage":"spotinst: no launch specs associated with ocean %q","messagePattern":"spotinst: no launch specs associated with ocean %q","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"upup/pkg/fi/cloudup/spotinsttasks/launch_spec.go","lineNumber":112,"sourceCode":"\t\tdeps = append(deps, o.Ocean)\n\t}\n\n\tif o.UserData != nil {\n\t\tdeps = append(deps, fi.FindDependencies(tasks, o.UserData)...)\n\t}\n\n\treturn deps\n}\n\nfunc (o *LaunchSpec) find(svc spotinst.LaunchSpecService, oceanID string) (*aws.LaunchSpec, error) {\n\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)","sourceCodeStart":94,"sourceCodeEnd":130,"githubUrl":"https://github.com/kubernetes/kops/blob/4c8573c808a73d578c5eadc86d410646ea0b0d73/upup/pkg/fi/cloudup/spotinsttasks/launch_spec.go#L94-L130","documentation":"Thrown by LaunchSpec.find when the Spotinst API List call for the ocean succeeded but returned zero launch specs. It means the referenced Ocean exists (or at least the query succeeded) yet has no launch specs attached, so the task cannot reconcile the expected spec against an actual one. Encountered during Find (dry-run/plan diffing) and update paths.","triggerScenarios":"During Find/update, svc.List returns an empty slice for the given oceanID.","commonSituations":"Newly created Ocean with no instance groups registered yet; all launch specs were deleted manually in the Spotinst console; wrong Ocean selected (points at another cluster's ocean).","solutions":["Create the missing instance groups via kops rolling-update cluster / kops update cluster so launch specs are created","Verify the Ocean in the Spotinst console actually has launch specs","Confirm the cluster spec points to the correct Ocean/cluster","If specs were intentionally deleted, delete the stale kops instance group instead"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"specs, _ := svc.List(ctx, oceanID)\nif len(specs) == 0 {\n    return errors.New(\"ocean has no launch specs; create instance groups first via kops update cluster\")\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Never delete all launch specs from an Ocean manually in the Spotinst console","Create kops instance groups before referencing launch specs","Keep a 1:1 mapping of kops instance groups to launch specs","Verify the Ocean belongs to the cluster you are operating on"],"tags":["spotinst","launch-spec","ocean"],"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-12T07:17:12.445Z"}