{"record":{"id":"b3d1d12f6a3448e8","repo":"kubernetes/kops","slug":"deleting-network-security-group-w","errorCode":null,"errorMessage":"deleting network security group: %w","messagePattern":"deleting network security group: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"upup/pkg/fi/cloudup/azure/networksecuritygroup.go","lineNumber":78,"sourceCode":"\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}\n\t\t\treturn nil, fmt.Errorf(\"listing network security groups: %w\", err)\n\t\t}\n\t\tl = append(l, resp.Value...)\n\t}\n\treturn l, nil\n}\n\nfunc (c *NetworkSecurityGroupsClientImpl) Delete(ctx context.Context, resourceGroupName, NetworkSecurityGroupName string) error {\n\tfuture, err := c.c.BeginDelete(ctx, resourceGroupName, NetworkSecurityGroupName, nil)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"deleting network security group: %w\", err)\n\t}\n\tif _, err = future.PollUntilDone(ctx, nil); err != nil {\n\t\treturn fmt.Errorf(\"waiting for network security group deletion completion: %w\", err)\n\t}\n\treturn nil\n}\n\nfunc newNetworkSecurityGroupsClientImpl(subscriptionID string, cred *azidentity.DefaultAzureCredential) (*NetworkSecurityGroupsClientImpl, error) {\n\tc, err := network.NewSecurityGroupsClient(subscriptionID, cred, nil)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"creating network security groups client: %w\", err)\n\t}\n\treturn &NetworkSecurityGroupsClientImpl{\n\t\tc: c,\n\t}, nil\n}\n","sourceCodeStart":60,"sourceCodeEnd":95,"githubUrl":"https://github.com/kubernetes/kops/blob/4c8573c808a73d578c5eadc86d410646ea0b0d73/upup/pkg/fi/cloudup/azure/networksecuritygroup.go#L60-L95","documentation":"BeginDelete for the network security group failed to start the deletion LRO; fires on authorization failure, a missing NSG, or the NSG still being in use by subnets/NICs.","triggerScenarios":"Thrown at upup/pkg/fi/cloudup/azure/networksecuritygroup.go:78 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Detach subnets/NICs still using the NSG and retry","Check the wrapped error code; NotFound means already deleted","Verify delete permissions"],"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"}