kubernetes/kops · error

error parsing Akamai (Linode) instance ID %q: %w

Error message

error parsing Akamai (Linode) instance ID %q: %w

What it means

DeleteInstance parses the CloudInstance ID as an integer Linode instance ID with strconv.Atoi before calling the API. A non-numeric or empty ID produces this wrapped parse error instead of an API call.

Source

Thrown at upup/pkg/fi/cloudup/linode/cloud.go:125

	return c.client
}

func (c *Cloud) ProviderID() kops.CloudProviderID {
	return kops.CloudProviderLinode
}

func (c *Cloud) DNS() (dnsprovider.Interface, error) {
	return nil, fmt.Errorf("DNS is not yet implemented for Akamai (Linode)")
}

func (c *Cloud) FindVPCInfo(id string) (*fi.VPCInfo, error) {
	return nil, nil
}

func (c *Cloud) DeleteInstance(instance *cloudinstances.CloudInstance) error {
	instanceID, err := strconv.Atoi(instance.ID)
	if err != nil {
		return fmt.Errorf("error parsing Akamai (Linode) instance ID %q: %w", instance.ID, err)
	}

	if err := c.client.DeleteInstance(context.Background(), instanceID); err != nil {
		if linodego.IsNotFound(err) {
			return nil
		}
		return fmt.Errorf("error deleting Akamai (Linode) instance %q: %w", instance.ID, err)
	}

	return nil
}

func (c *Cloud) DeregisterInstance(instance *cloudinstances.CloudInstance) error {
	return nil
}

func (c *Cloud) DeleteGroup(group *cloudinstances.CloudInstanceGroup) error {
	return fmt.Errorf("instance group deletion is not yet implemented for Akamai (Linode)")

View on GitHub (pinned to 4c8573c808)

Solutions

  1. Verify the CloudInstance was built from a real Linode instance (numeric ID) by re-running `kops get instances` / cloud discovery.
  2. Check that no custom code overrides instance IDs with labels; Linode IDs are numeric strings like '12345678'.
  3. Run `kops rolling-update cluster` again after refreshing cluster state so the instance list is rebuilt.
Defensive patterns

Strategy: validation

Validate before calling

func validInstanceID(id string) bool {
	_, err := strconv.Atoi(id)
	return err == nil
}
if !validInstanceID(inst.ID) {
	return fmt.Errorf("refusing to delete: instance ID %q is not a numeric Linode ID", inst.ID)
}

Type guard

func isNumericID(s string) bool { _, err := strconv.Atoi(s); return err == nil }

Try / catch

if err := cloud.DeleteInstance(inst); err != nil {
	if strings.Contains(err.Error(), "error parsing Akamai (Linode) instance ID") {
		// refresh discovery and retry with corrected instance list
	}
}

Prevention

When it happens

Trigger: Rolling-update or instance deletion flows pass a CloudInstance whose ID is empty or not a numeric Linode instance ID (e.g. a label or placeholder value) into Cloud.DeleteInstance.

Common situations: Corrupted/partial cloud group discovery results, custom tooling that populates CloudInstance with non-Linode identifiers, or instances deleted out-of-band leaving stale entries.

Related errors


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