{"record":{"id":"0bd295e4c9eeb638","repo":"kubernetes/kops","slug":"deleting-subnet-w","errorCode":null,"errorMessage":"deleting subnet: %w","messagePattern":"deleting subnet: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"upup/pkg/fi/cloudup/azure/subnet.go","lineNumber":68,"sourceCode":"}\n\nfunc (c *subnetsClientImpl) List(ctx context.Context, resourceGroupName, virtualNetworkName string) ([]*network.Subnet, error) {\n\tvar l []*network.Subnet\n\tpager := c.c.NewListPager(resourceGroupName, virtualNetworkName, nil)\n\tfor pager.More() {\n\t\tresp, err := pager.NextPage(ctx)\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"listing subnets: %w\", err)\n\t\t}\n\t\tl = append(l, resp.Value...)\n\t}\n\treturn l, nil\n}\n\nfunc (c *subnetsClientImpl) Delete(ctx context.Context, resourceGroupName, vnetName, subnetName string) error {\n\tfuture, err := c.c.BeginDelete(ctx, resourceGroupName, vnetName, subnetName, nil)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"deleting subnet: %w\", err)\n\t}\n\tif _, err := future.PollUntilDone(ctx, nil); err != nil {\n\t\treturn fmt.Errorf(\"waiting for subnet deletion completion: %w\", err)\n\t}\n\treturn nil\n}\n\nfunc newSubnetsClientImpl(subscriptionID string, cred *azidentity.DefaultAzureCredential) (*subnetsClientImpl, error) {\n\tc, err := network.NewSubnetsClient(subscriptionID, cred, nil)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"creating subnets client: %w\", err)\n\t}\n\treturn &subnetsClientImpl{\n\t\tc: c,\n\t}, nil\n}\n","sourceCodeStart":50,"sourceCodeEnd":85,"githubUrl":"https://github.com/kubernetes/kops/blob/4c8573c808a73d578c5eadc86d410646ea0b0d73/upup/pkg/fi/cloudup/azure/subnet.go#L50-L85","documentation":"BeginDelete for the subnet failed to start the deletion LRO; fires on authorization failure, a missing subnet, or the subnet still containing NICs/peer dependencies.","triggerScenarios":"Thrown at upup/pkg/fi/cloudup/azure/subnet.go:68 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Delete or move resources still inside the subnet, then retry","Check the wrapped error code; NotFound means already deleted"],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"4c8573c808a73d578c5eadc86d410646ea0b0d73","analyzedAt":"2026-09-05T04:13:19.212Z","contentChangedAt":"2026-09-05T04:13:19.212Z","schemaVersion":2},"datasetVersion":"2026-09-12T07:17:12.445Z"}