kubernetes/kops · error

waiting for nat gateway create/update: %w

Error message

waiting for nat gateway create/update: %w

What it means

PollUntilDone failed while waiting for the NAT gateway CreateOrUpdate LRO; ARM accepted the request but provisioning ended in failure.

Source

Thrown at upup/pkg/fi/cloudup/azure/natgateway.go:49

	CreateOrUpdate(ctx context.Context, resourceGroupName, natGatewayName string, parameters network.NatGateway) (*network.NatGateway, error)
	List(ctx context.Context, resourceGroupName string) ([]*network.NatGateway, error)
	Delete(ctx context.Context, resourceGroupName, natGatewayName string) error
}

type NatGatewaysClientImpl struct {
	c *network.NatGatewaysClient
}

var _ NatGatewaysClient = (*NatGatewaysClientImpl)(nil)

func (c *NatGatewaysClientImpl) CreateOrUpdate(ctx context.Context, resourceGroupName, natGatewayName string, parameters network.NatGateway) (*network.NatGateway, error) {
	future, err := c.c.BeginCreateOrUpdate(ctx, resourceGroupName, natGatewayName, parameters, nil)
	if err != nil {
		return nil, fmt.Errorf("creating/updating nat gateway: %w", err)
	}
	resp, err := future.PollUntilDone(ctx, nil)
	if err != nil {
		return nil, fmt.Errorf("waiting for nat gateway create/update: %w", err)
	}
	return &resp.NatGateway, err
}

func (c *NatGatewaysClientImpl) List(ctx context.Context, resourceGroupName string) ([]*network.NatGateway, error) {
	if resourceGroupName == "" {
		return nil, nil
	}

	var l []*network.NatGateway
	pager := c.c.NewListPager(resourceGroupName, nil)
	for pager.More() {
		resp, err := pager.NextPage(ctx)
		if err != nil {
			var respErr *azcore.ResponseError
			if errors.As(err, &respErr) && respErr.ErrorCode == "ResourceGroupNotFound" {
				return nil, nil
			}

View on GitHub (pinned to 4c8573c808)

Solutions

  1. Inspect the wrapped error for the provisioning failure reason
  2. Fix referenced resources (public IPs, subnet) and retry
Defensive patterns

Strategy: retry

When it happens

Trigger: Thrown at upup/pkg/fi/cloudup/azure/natgateway.go:49 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/2f5014004d253df5. Report an issue: GitHub.