kubernetes/kops · error

droplet %d not found

Error message

droplet %d not found

What it means

The DigitalOcean API returned success but a nil droplet object, meaning no droplet with the given numeric ID exists in the account. IdentifyNode treats this as a hard error since a valid node must map to an existing droplet.

Source

Thrown at pkg/nodeidentity/do/identify.go:153

	if i.cacheEnabled {
		if obj, exists, err := i.cache.GetByKey(instanceID); err != nil {
			klog.Warningf("Nodeidentity info cache lookup failure: %v", err)
		} else if exists {
			return obj.(*nodeidentity.Info), nil
		}
	}

	dropletID, err := strconv.Atoi(instanceID)
	if err != nil {
		return nil, fmt.Errorf("failed to convert provider ID number %q: %s", instanceID, err)
	}

	droplet, _, err := i.doClient.Droplets.Get(ctx, dropletID)
	if err != nil {
		return nil, fmt.Errorf("failed to retrieve droplet %d: %w", dropletID, err)
	}
	if droplet == nil {
		return nil, fmt.Errorf("droplet %d not found", dropletID)
	}
	if droplet.Status != "active" && droplet.Status != "new" {
		return nil, fmt.Errorf("droplet %d has unexpected status %q", dropletID, droplet.Status)
	}

	info := &nodeidentity.Info{
		InstanceID: instanceID,
		Labels:     labelsFromTags(droplet.Tags),
	}

	if i.cacheEnabled {
		if err := i.cache.Add(info); err != nil {
			klog.Warningf("Failed to add node identity info to cache: %v", err)
		}
	}

	return info, nil
}

View on GitHub (pinned to 4c8573c808)

Solutions

  1. Confirm the droplet ID exists via `doctl compute droplet get <id>`
  2. Check the API token belongs to the team/account that owns the droplet
  3. If the droplet was deleted, delete the stale Node resource or reprovision the machine
  4. Re-verify the providerID on the Node matches the current droplet's numeric ID
Defensive patterns

Strategy: try-catch

Validate before calling

// pre-check the droplet exists
droplet, _, err := client.Droplets.Get(ctx, id)
if err != nil || droplet == nil {
    return fmt.Errorf("droplet %d does not exist in this team", id)
}

Try / catch

info, err := IdentifyNode(ctx, providerID)
if err != nil {
    if strings.Contains(err.Error(), "not found") {
        // droplet gone: delete the Node or reprovision
    }
}

Prevention

When it happens

Trigger: i.doClient.Droplets.Get succeeds but returns (nil, resp, nil) — the droplet ID in providerID does not correspond to any droplet in the token's team/context.

Common situations: Stale providerID after droplet deletion; API token scoped to a different team than the one owning the droplet; typo in the numeric ID; droplet recreated with a new ID after rebuild.

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