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.Name

View on GitHub (pinned to 4c8573c808)

Solutions

  1. Confirm the Ocean exists in the Spotinst console for the correct account
  2. Ensure the cluster spec's Spotinst ocean name matches the actual Ocean name
  3. Run kops update cluster to recreate the Ocean if it was deleted
  4. 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

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


AI-assisted analysis of kubernetes/kops@4c8573c808 (2026-09-05). Data as JSON: /api/errors/def183e40bb21768. Report an issue: GitHub.