kubernetes/kops · error
spotinst: failed to find ocean %q
Error message
spotinst: failed to find ocean %q
What it means
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.
Source
Thrown at upup/pkg/fi/cloudup/spotinsttasks/ocean.go:129
}
func (o *Ocean) find(svc spotinst.InstanceGroupService) (*aws.Cluster, error) {
klog.V(4).Infof("Attempting to find Ocean: %q", fi.ValueOf(o.Name))
oceans, err := svc.List(context.Background())
if err != nil {
return nil, fmt.Errorf("spotinst: failed to find ocean %q: %v", fi.ValueOf(o.Name), err)
}
var out *aws.Cluster
for _, ocean := range oceans {
if ocean.Name() == fi.ValueOf(o.Name) {
out = ocean.Obj().(*aws.Cluster)
break
}
}
if out == nil {
return nil, fmt.Errorf("spotinst: failed to find ocean %q", fi.ValueOf(o.Name))
}
klog.V(4).Infof("Ocean/%s: %s", fi.ValueOf(o.Name), stringutil.Stringify(out))
return out, nil
}
var _ fi.CloudupHasCheckExisting = (*Ocean)(nil)
func (o *Ocean) Find(c *fi.CloudupContext) (*Ocean, error) {
cloud := awsup.GetCloud(c)
ocean, err := o.find(cloud.Spotinst().Ocean())
if err != nil {
return nil, err
}
actual := &Ocean{}
actual.Name = ocean.NameView on GitHub (pinned to 4c8573c808)
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
Defensive patterns
Strategy: validation
Validate before calling
oceans, _ := svc.List(ctx)
found := false
for _, o := range oceans {
if o.Name() == clusterName {
found = true
}
}
if !found {
return fmt.Errorf("ocean %q not found in Spotinst account %s; run kops update cluster to create it", clusterName, account)
} Prevention
- 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
When it happens
Trigger: During find (Find/create/update/CheckExisting), oceans list contains no entry whose Name() equals fi.ValueOf(o.Name).
Common situations: 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.
Understand the failure class
Background: 'Could not be found', 'does not exist', 'not found in database': the resource-not-found family when an ID, slug, key, or URI lookup comes back empty — this error's family across 20 libraries.
Related errors
- unable to detect default launch spec: multiple instance grou
- spotinst: failed to find elastigroup %q
- spotinst: no launch specs associated with ocean %q
- spotinst: failed to find ocean %q: %v
- cluster %q not found
AI-assisted analysis of kubernetes/kops@4c8573c808 (2026-09-05).
Data as JSON: /api/errors/def183e40bb21768.
Report an issue: GitHub.