{"record":{"id":"33cc781969b89f25","repo":"kubernetes/kops","slug":"network-with-name-q-not-found","errorCode":null,"errorMessage":"Network with name %q not found","messagePattern":"Network with name %q not found","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"upup/pkg/fi/cloudup/gcetasks/network.go","lineNumber":145,"sourceCode":"\tcase \"\":\n\t\t// Treated as \"keep existing\", only allowed for shared mode\n\t\tif !fi.ValueOf(e.Shared) {\n\t\t\treturn fmt.Errorf(\"must specify mode for (non-shared) Network\")\n\t\t}\n\n\tdefault:\n\t\treturn fmt.Errorf(\"unknown mode %q for Network\", e.Mode)\n\t}\n\n\treturn nil\n}\n\nfunc (_ *Network) RenderGCE(t *gce.GCEAPITarget, a, e, changes *Network) error {\n\tshared := fi.ValueOf(e.Shared)\n\tif shared {\n\t\t// Verify the network was found\n\t\tif a == nil {\n\t\t\treturn fmt.Errorf(\"Network with name %q not found\", fi.ValueOf(e.Name))\n\t\t}\n\t}\n\n\tif a == nil {\n\t\tklog.V(2).Infof(\"Creating Network with CIDR: %q\", fi.ValueOf(e.CIDR))\n\n\t\tnetwork := &compute.Network{\n\t\t\tName: *e.Name,\n\t\t}\n\n\t\tswitch e.Mode {\n\t\tcase \"legacy\":\n\t\t\tnetwork.IPv4Range = fi.ValueOf(e.CIDR)\n\n\t\tcase \"auto\":\n\t\t\tnetwork.AutoCreateSubnetworks = true\n\n\t\tcase \"custom\":","sourceCodeStart":127,"sourceCodeEnd":163,"githubUrl":"https://github.com/kubernetes/kops/blob/4c8573c808a73d578c5eadc86d410646ea0b0d73/upup/pkg/fi/cloudup/gcetasks/network.go#L127-L163","documentation":"Guard error from Network.RenderGCE when the spec marks the network as shared but Find() located no matching network (a == nil). A shared network is expected to pre-exist and be adopted, so absence of the named network is fatal rather than triggering creation.","triggerScenarios":"Thrown at upup/pkg/fi/cloudup/gcetasks/network.go:145 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Verify the network name (and project override) in the cluster spec matches the existing GCE network","Create the network in GCE first if it does not exist","Drop the shared flag if kOps should create and manage the network"],"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-12T07:17:12.445Z"}