{"record":{"id":"75a9d2260db546f2","repo":"kubernetes/kops","slug":"error-listing-networks-v-75a9d2","errorCode":null,"errorMessage":"error listing Networks: %v","messagePattern":"error listing Networks: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"upup/pkg/fi/cloudup/gcetasks/network.go","lineNumber":61,"sourceCode":"var _ fi.CompareWithID = (*Network)(nil)\n\nfunc (e *Network) CompareWithID() *string {\n\treturn e.Name\n}\n\nfunc (e *Network) Find(c *fi.CloudupContext) (*Network, error) {\n\tcloud := c.T.Cloud.(gce.GCECloud)\n\tproject := cloud.Project()\n\tif e.Project != nil {\n\t\tproject = *e.Project\n\t}\n\n\tr, err := cloud.Compute().Networks().Get(project, *e.Name)\n\tif err != nil {\n\t\tif gce.IsNotFound(err) {\n\t\t\treturn nil, nil\n\t\t}\n\t\treturn nil, fmt.Errorf(\"error listing Networks: %v\", err)\n\t}\n\n\tactual := &Network{}\n\tif r.IPv4Range != \"\" {\n\t\tactual.Mode = \"legacy\"\n\t\tactual.CIDR = &r.IPv4Range\n\t} else if r.AutoCreateSubnetworks {\n\t\tactual.Mode = \"auto\"\n\t} else {\n\t\tactual.Mode = \"custom\"\n\t}\n\tactual.Project = &project\n\n\tif r.SelfLink != e.URL(project) {\n\t\tklog.Warningf(\"SelfLink did not match URL: %q vs %q\", r.SelfLink, e.URL(project))\n\t}\n\n\t// Ignore \"system\" fields","sourceCodeStart":43,"sourceCodeEnd":79,"githubUrl":"https://github.com/kubernetes/kops/blob/4c8573c808a73d578c5eadc86d410646ea0b0d73/upup/pkg/fi/cloudup/gcetasks/network.go#L43-L79","documentation":"Wrapped error from Network.Find when the Networks.Get call fails with a non-404 error. Despite the 'listing' wording it is a single-network Get against the (possibly overridden) project; fires on permission errors, wrong project, or API failures.","triggerScenarios":"Thrown at upup/pkg/fi/cloudup/gcetasks/network.go:61 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Inspect the wrapped error for the Google API reason","Verify the network name and project (including the optional shared-project override) in the spec","Ensure compute.networks.get permission on that project"],"exampleFix":null,"handlingStrategy":"try-catch","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"}