{"record":{"id":"5d6e0c89b48cfef0","repo":"kubernetes/kops","slug":"error-waiting-for-subnet-creation-to-complete-w","errorCode":null,"errorMessage":"error waiting for Subnet creation to complete: %w","messagePattern":"error waiting for Subnet creation to complete: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"upup/pkg/fi/cloudup/gcetasks/subnet.go","lineNumber":147,"sourceCode":"\t\t\tName:           *e.Name,\n\t\t\tNetwork:        e.Network.URL(project),\n\t\t\tStackType:      fi.ValueOf(e.StackType),\n\t\t\tIpv6AccessType: fi.ValueOf(e.Ipv6AccessType),\n\t\t}\n\n\t\tfor k, v := range e.SecondaryIpRanges {\n\t\t\tsubnet.SecondaryIpRanges = append(subnet.SecondaryIpRanges, &compute.SubnetworkSecondaryRange{\n\t\t\t\tRangeName:   k,\n\t\t\t\tIpCidrRange: v,\n\t\t\t})\n\t\t}\n\n\t\top, err := cloud.Compute().Subnetworks().Insert(t.Cloud.Project(), t.Cloud.Region(), subnet)\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"error creating Subnet: %v\", err)\n\t\t}\n\t\tif err := t.Cloud.WaitForOp(op); err != nil {\n\t\t\treturn fmt.Errorf(\"error waiting for Subnet creation to complete: %w\", err)\n\t\t}\n\t} else {\n\t\tif changes.SecondaryIpRanges != nil {\n\t\t\t// Update is split into two calls as GCE does not allow us to add and remove ranges in the same call\n\t\t\tif err := updateSecondaryRanges(cloud, \"add\", e); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\t\tif !shared {\n\t\t\t\tif err := updateSecondaryRanges(cloud, \"remove\", e); err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tchanges.SecondaryIpRanges = nil\n\t\t}\n\n\t\tif changes.StackType != nil {","sourceCodeStart":129,"sourceCodeEnd":165,"githubUrl":"https://github.com/kubernetes/kops/blob/4c8573c808a73d578c5eadc86d410646ea0b0d73/upup/pkg/fi/cloudup/gcetasks/subnet.go#L129-L165","documentation":"Wrapped error from cloud.WaitForOp after a successful Subnetworks.Insert submit. The subnet-create operation failed asynchronously (or polling errored) — the subnet may not exist even though the request was accepted; the %w carries the operation-level failure.","triggerScenarios":"Thrown at upup/pkg/fi/cloudup/gcetasks/subnet.go:147 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Inspect the operation error in the %w chain","Check whether the subnet exists (gcloud compute networks subnets describe) before retrying","Fix the underlying cause (overlap, quota) and re-run the apply"],"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-12T12:17:11.808Z"}