kubernetes/kops · error

creating/updating nat gateway: %w

Error message

creating/updating nat gateway: %w

What it means

BeginCreateOrUpdate for the NAT gateway failed to start the LRO; fires on ARM validation errors (bad public IP prefix references), quota, or authorization failures.

Source

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

)

// NatGatewaysClient is a client for managing Nat Gateways.
type NatGatewaysClient interface {
	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 {

View on GitHub (pinned to 4c8573c808)

Solutions

  1. Inspect the wrapped ResponseError code and fix parameters
  2. Verify Network Contributor permissions and public IP quota
  3. Retry after transient ARM failures
Defensive patterns

Strategy: retry

When it happens

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