kubernetes/kops · error

error deleting Akamai (Linode) instance %q: %w

Error message

error deleting Akamai (Linode) instance %q: %w

What it means

After successfully parsing the instance ID, DeleteInstance calls the Linode API DeleteInstance. Any API error other than a 404 (which is treated as success) is wrapped as 'error deleting Akamai (Linode) instance %q: %w'.

Source

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

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)")
}

func (c *Cloud) DetachInstance(instance *cloudinstances.CloudInstance) error {
	return fmt.Errorf("instance detach is not yet implemented for Akamai (Linode)")
}

func (c *Cloud) GetCloudGroups(cluster *kops.Cluster, instancegroups []*kops.InstanceGroup, warnUnmatched bool, nodes []v1.Node) (map[string]*cloudinstances.CloudInstanceGroup, error) {

View on GitHub (pinned to 4c8573c808)

Solutions

  1. Inspect the wrapped cause (kops -v=10) to see the Linode API status code; fix auth if 401/403 by refreshing LINODE_TOKEN with linodes read/write scopes.
  2. Retry the operation if the error is transient (429/5xx) — kops rolling-update can be re-run safely.
  3. Verify the instance still exists in the Akamai Cloud Manager and is not already being deleted; stale entries can be cleared by re-running discovery.
Defensive patterns

Strategy: retry

Validate before calling

if os.Getenv("LINODE_TOKEN") == "" { return fmt.Errorf("set LINODE_TOKEN before deleting instances") }

Try / catch

err := cloud.DeleteInstance(inst)
if err != nil && !strings.Contains(err.Error(), "not found") {
	if isTransient(err) { // 429/5xx
		time.Sleep(backoff)
		retry(cloud.DeleteInstance, inst)
	}
}

Prevention

When it happens

Trigger: The linodego client's DeleteInstance call fails — invalid/expired token, insufficient token scopes, instance in a state that forbids deletion, or network/API outage.

Common situations: Expired or revoked LINODE_TOKEN during rolling updates; token lacking linodes:read_write scope; temporary Linode API 5xx outages during cluster upgrades.

Related errors


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