kubernetes/kops · error

waiting for network security group deletion completion: %w

Error message

waiting for network security group deletion completion: %w

What it means

PollUntilDone failed while waiting for the network security group deletion LRO; the delete was accepted but the operation failed (commonly because the NSG is still associated with a subnet or NIC).

Source

Thrown at upup/pkg/fi/cloudup/azure/networksecuritygroup.go:81

		if err != nil {
			var respErr *azcore.ResponseError
			if errors.As(err, &respErr) && respErr.ErrorCode == "ResourceGroupNotFound" {
				return nil, nil
			}
			return nil, fmt.Errorf("listing network security groups: %w", err)
		}
		l = append(l, resp.Value...)
	}
	return l, nil
}

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

func newNetworkSecurityGroupsClientImpl(subscriptionID string, cred *azidentity.DefaultAzureCredential) (*NetworkSecurityGroupsClientImpl, error) {
	c, err := network.NewSecurityGroupsClient(subscriptionID, cred, nil)
	if err != nil {
		return nil, fmt.Errorf("creating network security groups client: %w", err)
	}
	return &NetworkSecurityGroupsClientImpl{
		c: c,
	}, nil
}

View on GitHub (pinned to 4c8573c808)

Solutions

  1. Remove remaining subnet/NIC associations and retry deletion
  2. Inspect the wrapped error for the failure reason
Defensive patterns

Strategy: retry

When it happens

Trigger: Thrown at upup/pkg/fi/cloudup/azure/networksecuritygroup.go:81 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/2144a505d2415e7d. Report an issue: GitHub.