kubernetes/kops · error

waiting for resource group deletion completion: %w

Error message

waiting for resource group deletion completion: %w

What it means

Wraps the failure of future.PollUntilDone while waiting for the asynchronous resource-group deletion LRO to finish. Resource group deletion can take many minutes with many contained resources; the poll fails if the server-side operation errors, the context is cancelled, or retries are exhausted.

Source

Thrown at upup/pkg/fi/cloudup/azure/resourcegroup.go:64

	var l []*resources.ResourceGroup
	pager := c.c.NewListPager(nil)
	for pager.More() {
		resp, err := pager.NextPage(ctx)
		if err != nil {
			return nil, fmt.Errorf("listing resource groups: %w", err)
		}
		l = append(l, resp.Value...)
	}
	return l, nil
}

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

func newResourceGroupsClientImpl(subscriptionID string, cred *azidentity.DefaultAzureCredential) (*resourceGroupsClientImpl, error) {
	c, err := resources.NewResourceGroupsClient(subscriptionID, cred, nil)
	if err != nil {
		return nil, fmt.Errorf("creating resource group client: %w", err)
	}
	return &resourceGroupsClientImpl{
		c: c,
	}, nil
}

View on GitHub (pinned to 4c8573c808)

Solutions

  1. Inspect the wrapped error for the LRO failure detail; check the group's Activity Log in the Azure portal
  2. Retry Delete — it is safe to re-issue; the group may still be deleting
  3. Ensure all contained resources are deletable (no locks, no leftover disks/NICs) then re-run
  4. Use a longer-lived context for resource group deletion, which can take 15+ minutes
Defensive patterns

Strategy: retry

Validate before calling

ctx, cancel := context.WithTimeout(context.Background(), 30*time.Minute) // RG deletion can exceed 15 min
defer cancel()

Type guard

func isContextErr(err error) bool {
  return errors.Is(err, context.Canceled) || errors.Is(err, context.DeadlineExceeded)
}

Try / catch

err := rgClient.Delete(ctx, name)
if err != nil {
  if isContextErr(err) || true { /* LRO continues server-side */ }
  // safe to re-call Delete; it resumes/waits again
  return fmt.Errorf("rg %s deletion incomplete: %w", name, err)
}

Prevention

When it happens

Trigger: BeginDelete succeeded, then PollUntilDone(ctx, nil) returns: the LRO reports a failure (e.g. a contained resource failed to delete), ctx deadline exceeded / cancelled, or repeated transient ARM errors exhaust the poller retry policy.

Common situations: kOps teardown killed by context timeout before all contained resources finished deleting; orphaned resources (disks, NICs, public IPs) causing the group deletion to stall/fail; long-lived groups where default poll interval misses completion within ctx budget.

Related errors


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