{"record":{"id":"fdb8adaa6447adb3","repo":"kubernetes/kops","slug":"unable-to-find-network-id-q","errorCode":null,"errorMessage":"unable to find Network ID %q","messagePattern":"unable to find Network ID %q","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"upup/pkg/fi/cloudup/defaults.go","lineNumber":86,"sourceCode":"\n\tif cloud == nil {\n\t\treturn fmt.Errorf(\"cloud cannot be nil\")\n\t}\n\n\tif cloud.ProviderID() == kops.CloudProviderGCE {\n\t\tif err := gce.PerformNetworkAssignments(ctx, c, cloud); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\tif cloud.ProviderID() == kops.CloudProviderAWS && c.Spec.Networking.NetworkCIDR == \"\" {\n\t\tif c.SharedVPC() {\n\t\t\tvpcInfo, err := cloud.FindVPCInfo(c.Spec.Networking.NetworkID)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tif vpcInfo == nil {\n\t\t\t\treturn fmt.Errorf(\"unable to find Network ID %q\", c.Spec.Networking.NetworkID)\n\t\t\t}\n\t\t\tc.Spec.Networking.NetworkCIDR = vpcInfo.CIDR\n\t\t\tif c.Spec.Networking.NetworkCIDR == \"\" {\n\t\t\t\treturn fmt.Errorf(\"unable to infer NetworkCIDR from Network ID, please specify --network-cidr\")\n\t\t\t}\n\t\t} else {\n\t\t\t// TODO: Choose non-overlapping networking CIDRs for VPCs, using vpcInfo\n\t\t\tc.Spec.Networking.NetworkCIDR = defaultAWSNetworkCIDR\n\t\t}\n\n\t\t// Amazon VPC CNI uses the same network\n\t\tif c.Spec.Networking.AmazonVPC != nil && c.Spec.Networking.NonMasqueradeCIDR != \"::/0\" {\n\t\t\tc.Spec.Networking.NonMasqueradeCIDR = c.Spec.Networking.NetworkCIDR\n\t\t}\n\t}\n\n\tif cloud.ProviderID() == kops.CloudProviderAzure && c.Spec.Networking.NetworkCIDR == \"\" {\n\t\tif c.SharedVPC() {","sourceCodeStart":68,"sourceCodeEnd":104,"githubUrl":"https://github.com/kubernetes/kops/blob/4c8573c808a73d578c5eadc86d410646ea0b0d73/upup/pkg/fi/cloudup/defaults.go#L68-L104","documentation":"Shared-VPC resolution failure in PerformAssignments on AWS: the cluster uses a shared VPC (networkID set) with no explicit NetworkCIDR, and FindVPCInfo returned nil — meaning no VPC with that ID is visible to the credentials in use, so its CIDR cannot be adopted.","triggerScenarios":"Thrown at upup/pkg/fi/cloudup/defaults.go:86 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Verify the NetworkID is a correct existing VPC ID","Grant the kOps IAM user access to describe the shared VPC in the network account","Or set --network-cidr explicitly to skip the lookup"],"exampleFix":null,"handlingStrategy":"validation","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"}