kubernetes/kops · error

spotinst: no launch specs associated with ocean %q

Error message

spotinst: no launch specs associated with ocean %q

What it means

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.

Source

Thrown at upup/pkg/fi/cloudup/spotinsttasks/launch_spec.go:112

		deps = append(deps, o.Ocean)
	}

	if o.UserData != nil {
		deps = append(deps, fi.FindDependencies(tasks, o.UserData)...)
	}

	return deps
}

func (o *LaunchSpec) find(svc spotinst.LaunchSpecService, oceanID string) (*aws.LaunchSpec, error) {
	klog.V(4).Infof("Attempting to find LaunchSpec: %q", fi.ValueOf(o.Name))

	specs, err := svc.List(context.Background(), oceanID)
	if err != nil {
		return nil, fmt.Errorf("spotinst: failed to find launch spec %q: %v", fi.ValueOf(o.Name), err)
	}
	if len(specs) == 0 {
		return nil, fmt.Errorf("spotinst: no launch specs associated with ocean %q", oceanID)
	}

	var out *aws.LaunchSpec
	for _, spec := range specs {
		if spec.Name() == fi.ValueOf(o.Name) {
			out = spec.Obj().(*aws.LaunchSpec)
			break
		}
	}
	if out == nil {
		return nil, fmt.Errorf("spotinst: failed to find launch spec %q", fi.ValueOf(o.Name))
	}

	klog.V(4).Infof("LaunchSpec/%s: %s", fi.ValueOf(o.Name), stringutil.Stringify(out))
	return out, nil
}

var _ fi.CloudupHasCheckExisting = (*LaunchSpec)(nil)

View on GitHub (pinned to 4c8573c808)

Solutions

  1. Create the missing instance groups via kops rolling-update cluster / kops update cluster so launch specs are created
  2. Verify the Ocean in the Spotinst console actually has launch specs
  3. Confirm the cluster spec points to the correct Ocean/cluster
  4. If specs were intentionally deleted, delete the stale kops instance group instead
Defensive patterns

Strategy: validation

Validate before calling

specs, _ := svc.List(ctx, oceanID)
if len(specs) == 0 {
    return errors.New("ocean has no launch specs; create instance groups first via kops update cluster")
}

Prevention

When it happens

Trigger: During Find/update, svc.List returns an empty slice for the given oceanID.

Common situations: 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).

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/79de3700e7661448. Report an issue: GitHub.