{"record":{"id":"0a6dc00a6c74be36","repo":"kubernetes/kops","slug":"spotinst-failed-to-find-ocean-q-v","errorCode":null,"errorMessage":"spotinst: failed to find ocean %q: %v","messagePattern":"spotinst: failed to find ocean %q: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"upup/pkg/fi/cloudup/spotinsttasks/ocean.go","lineNumber":118,"sourceCode":"\tif o.SecurityGroups != nil {\n\t\tfor _, sg := range o.SecurityGroups {\n\t\t\tdeps = append(deps, sg)\n\t\t}\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 *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)","sourceCodeStart":100,"sourceCodeEnd":136,"githubUrl":"https://github.com/kubernetes/kops/blob/4c8573c808a73d578c5eadc86d410646ea0b0d73/upup/pkg/fi/cloudup/spotinsttasks/ocean.go#L100-L136","documentation":"Ocean.find lists all Oceans in the Spotinst account to locate the cluster's Ocean. If the Spotinst List API call fails, the error is wrapped with this message. This is an API-level failure before any name matching occurs.","triggerScenarios":"During find (called by Find, create, update, CheckExisting), svc.List(ctx) returns an error from the Spotinst API.","commonSituations":"Invalid/expired Spotinst token; Spotinst API outage or rate limit; network restrictions from the machine running kops.","solutions":["Validate SPOTINST_TOKEN and SPOTINST_ACCOUNT environment variables","Check connectivity to api.spotinst.com","Retry if the API was rate-limiting or temporarily down","Confirm the Spotinst account is active and not suspended"],"exampleFix":null,"handlingStrategy":"retry","validationCode":"if os.Getenv(\"SPOTINST_TOKEN\") == \"\" {\n    return errors.New(\"SPOTINST_TOKEN must be set before listing oceans\")\n}","typeGuard":null,"tryCatchPattern":"oceans, err := svc.List(ctx)\nif err != nil {\n    if attempt < maxRetries {\n        time.Sleep(backoff)\n        continue\n    }\n    return fmt.Errorf(\"spotinst ocean list failed after retries: %w\", err)\n}","preventionTips":["Check api.spotinst.com reachability from CI runners","Handle Spotinst rate limits with exponential backoff","Validate tokens periodically in automation","Set up alerts on Spotinst API error rates"],"tags":["spotinst","ocean","api-error"],"backgroundTag":"spotinst-api-error","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"}