{"record":{"id":"0ac730527a5d4422","repo":"kubernetes/kops","slug":"waiting-for-virtual-network-create-update-completi","errorCode":null,"errorMessage":"waiting for virtual network create/update completion: %w","messagePattern":"waiting for virtual network create/update completion: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"upup/pkg/fi/cloudup/azure/virtualnetwork.go","lineNumber":49,"sourceCode":"\tCreateOrUpdate(ctx context.Context, resourceGroupName, virtualNetworkName string, parameters network.VirtualNetwork) (*network.VirtualNetwork, error)\n\tList(ctx context.Context, resourceGroupName string) ([]*network.VirtualNetwork, error)\n\tDelete(ctx context.Context, resourceGroupName, vnetName string) error\n}\n\ntype virtualNetworksClientImpl struct {\n\tc *network.VirtualNetworksClient\n}\n\nvar _ VirtualNetworksClient = (*virtualNetworksClientImpl)(nil)\n\nfunc (c *virtualNetworksClientImpl) CreateOrUpdate(ctx context.Context, resourceGroupName, virtualNetworkName string, parameters network.VirtualNetwork) (*network.VirtualNetwork, error) {\n\tfuture, err := c.c.BeginCreateOrUpdate(ctx, resourceGroupName, virtualNetworkName, parameters, nil)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"creating/updating virtual network: %w\", err)\n\t}\n\tvnet, err := future.PollUntilDone(ctx, nil)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"waiting for virtual network create/update completion: %w\", err)\n\t}\n\treturn &vnet.VirtualNetwork, err\n}\n\nfunc (c *virtualNetworksClientImpl) List(ctx context.Context, resourceGroupName string) ([]*network.VirtualNetwork, error) {\n\tif resourceGroupName == \"\" {\n\t\treturn nil, nil\n\t}\n\n\tvar l []*network.VirtualNetwork\n\tpager := c.c.NewListPager(resourceGroupName, nil)\n\tfor pager.More() {\n\t\tresp, err := pager.NextPage(ctx)\n\t\tif err != nil {\n\t\t\tvar respErr *azcore.ResponseError\n\t\t\tif errors.As(err, &respErr) && respErr.ErrorCode == \"ResourceGroupNotFound\" {\n\t\t\t\treturn nil, nil\n\t\t\t}","sourceCodeStart":31,"sourceCodeEnd":67,"githubUrl":"https://github.com/kubernetes/kops/blob/4c8573c808a73d578c5eadc86d410646ea0b0d73/upup/pkg/fi/cloudup/azure/virtualnetwork.go#L31-L67","documentation":"Wrapped when the long-running operation started by BeginCreateOrUpdate fails or is cancelled during future.PollUntilDone. The Begin call succeeded, but provisioning later returned an error (provisioning failed, context cancelled, timeout, ARM returned a failed operation). This is the polling-stage counterpart of the 'creating/updating virtual network' error.","triggerScenarios":"CreateOrUpdate's future.PollUntilDone(ctx, nil) returns an error because the vnet PUT operation reached a Failed/Cancelled terminal state, or ctx was cancelled/timed out mid-poll.","commonSituations":"Long vnet operations interrupted by kops context cancellation (Ctrl-C, timeout); Azure-side provisioning failure; quota/capacity errors surfacing during provisioning; ARM throttling exceeding the default retry window.","solutions":["Re-run kops; failed long-running operations can usually be retried once the transient cause is gone","Check the vnet's provisioning state in the Azure portal / az network vnet show","Increase the kops command timeout or keep the process alive during large topology changes","Review Activity Log for the failed PUT operation to find the Azure-side error code"],"exampleFix":null,"handlingStrategy":"retry","validationCode":"// Go: ensure a generous, cancellation-safe context before the long-running call\nctx, cancel := context.WithTimeout(context.Background(), 30*time.Minute)\ndefer cancel()","typeGuard":null,"tryCatchPattern":"vnet, err := vnetsClient.CreateOrUpdate(ctx, rg, name, parameters)\nif err != nil {\n    if ctx.Err() != nil {\n        return fmt.Errorf(\"cancelled/timed out while provisioning vnet %s; re-run kops to resume\", name)\n    }\n    return fmt.Errorf(\"vnet provisioning failed, check Activity Log: %w\", err)\n}","preventionTips":["Don't Ctrl-C kops during topology changes; let polling finish","Use a context timeout larger than Azure's typical vnet provisioning time","Inspect Azure Activity Log for the failed PUT to identify the provisioning error","Re-run the command; long-running operations are idempotent"],"tags":["azure","go","network","long-running-operation"],"backgroundTag":"azure-long-running-operation-failed","analyzedSha":"4c8573c808a73d578c5eadc86d410646ea0b0d73","analyzedAt":"2026-09-05T04:13:19.212Z","contentChangedAt":"2026-09-05T04:13:19.212Z","schemaVersion":2},"datasetVersion":"2026-09-12T12:17:11.808Z"}