kubernetes/kops · error

waiting for subnet deletion completion: %w

Error message

waiting for subnet deletion completion: %w

What it means

PollUntilDone failed while waiting for the subnet deletion LRO; the delete was accepted but the operation failed (commonly because interfaces or resources still reside in the subnet).

Source

Thrown at upup/pkg/fi/cloudup/azure/subnet.go:71

	var l []*network.Subnet
	pager := c.c.NewListPager(resourceGroupName, virtualNetworkName, nil)
	for pager.More() {
		resp, err := pager.NextPage(ctx)
		if err != nil {
			return nil, fmt.Errorf("listing subnets: %w", err)
		}
		l = append(l, resp.Value...)
	}
	return l, nil
}

func (c *subnetsClientImpl) Delete(ctx context.Context, resourceGroupName, vnetName, subnetName string) error {
	future, err := c.c.BeginDelete(ctx, resourceGroupName, vnetName, subnetName, nil)
	if err != nil {
		return fmt.Errorf("deleting subnet: %w", err)
	}
	if _, err := future.PollUntilDone(ctx, nil); err != nil {
		return fmt.Errorf("waiting for subnet deletion completion: %w", err)
	}
	return nil
}

func newSubnetsClientImpl(subscriptionID string, cred *azidentity.DefaultAzureCredential) (*subnetsClientImpl, error) {
	c, err := network.NewSubnetsClient(subscriptionID, cred, nil)
	if err != nil {
		return nil, fmt.Errorf("creating subnets client: %w", err)
	}
	return &subnetsClientImpl{
		c: c,
	}, nil
}

View on GitHub (pinned to 4c8573c808)

Solutions

  1. Remove remaining NICs/resources from the subnet and retry
  2. Inspect the wrapped error for the failure reason
Defensive patterns

Strategy: retry

When it happens

Trigger: Thrown at upup/pkg/fi/cloudup/azure/subnet.go:71 when the library encounters an invalid state.

Common situations: See trigger scenarios.


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