{"record":{"id":"def183e40bb21768","repo":"kubernetes/kops","slug":"spotinst-failed-to-find-ocean-q","errorCode":null,"errorMessage":"spotinst: failed to find ocean %q","messagePattern":"spotinst: failed to find ocean %q","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"upup/pkg/fi/cloudup/spotinsttasks/ocean.go","lineNumber":129,"sourceCode":"}\n\nfunc (o *Ocean) find(svc spotinst.InstanceGroupService) (*aws.Cluster, error) {\n\tklog.V(4).Infof(\"Attempting to find Ocean: %q\", fi.ValueOf(o.Name))\n\n\toceans, err := svc.List(context.Background())\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"spotinst: failed to find ocean %q: %v\", fi.ValueOf(o.Name), err)\n\t}\n\n\tvar out *aws.Cluster\n\tfor _, ocean := range oceans {\n\t\tif ocean.Name() == fi.ValueOf(o.Name) {\n\t\t\tout = ocean.Obj().(*aws.Cluster)\n\t\t\tbreak\n\t\t}\n\t}\n\tif out == nil {\n\t\treturn nil, fmt.Errorf(\"spotinst: failed to find ocean %q\", fi.ValueOf(o.Name))\n\t}\n\n\tklog.V(4).Infof(\"Ocean/%s: %s\", fi.ValueOf(o.Name), stringutil.Stringify(out))\n\treturn out, nil\n}\n\nvar _ fi.CloudupHasCheckExisting = (*Ocean)(nil)\n\nfunc (o *Ocean) Find(c *fi.CloudupContext) (*Ocean, error) {\n\tcloud := awsup.GetCloud(c)\n\n\tocean, err := o.find(cloud.Spotinst().Ocean())\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tactual := &Ocean{}\n\tactual.Name = ocean.Name","sourceCodeStart":111,"sourceCodeEnd":147,"githubUrl":"https://github.com/kubernetes/kops/blob/4c8573c808a73d578c5eadc86d410646ea0b0d73/upup/pkg/fi/cloudup/spotinsttasks/ocean.go#L111-L147","documentation":"The List call succeeded but no Ocean in the account has this task's Name, so find reports the Ocean as missing. kops expects an Ocean matching the cluster name to already exist (or creates it) — this error surfaces when matching fails.","triggerScenarios":"During find (Find/create/update/CheckExisting), oceans list contains no entry whose Name() equals fi.ValueOf(o.Name).","commonSituations":"Ocean deleted in the Spotinst console; cluster renamed so the Ocean name no longer matches; running kops against the wrong Spotinst account; Ocean created with a custom name in the spec that doesn't match the cluster name.","solutions":["Confirm the Ocean exists in the Spotinst console for the correct account","Ensure the cluster spec's Spotinst ocean name matches the actual Ocean name","Run kops update cluster to recreate the Ocean if it was deleted","Verify SPOTINST_ACCOUNT points to the account that owns the Ocean"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"oceans, _ := svc.List(ctx)\nfound := false\nfor _, o := range oceans {\n    if o.Name() == clusterName {\n        found = true\n    }\n}\nif !found {\n    return fmt.Errorf(\"ocean %q not found in Spotinst account %s; run kops update cluster to create it\", clusterName, account)\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Do not delete Oceans from the Spotinst console while kops manages them","Keep cluster name and Ocean name in sync (kops derives it)","Confirm SPOTINST_ACCOUNT matches the account that owns the cluster","Run kops get clusters to verify the target before operations"],"tags":["spotinst","ocean","not-found"],"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"}