{"record":{"id":"5a072a03b3e2912f","repo":"kubernetes/kops","slug":"failed-to-find-network-q","errorCode":null,"errorMessage":"failed to find network %q","messagePattern":"failed to find network %q","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"upup/pkg/fi/cloudup/hetznertasks/network.go","lineNumber":67,"sourceCode":"\treturn v.ID\n}\n\nfunc (v *Network) Find(c *fi.CloudupContext) (*Network, error) {\n\tcloud := c.T.Cloud.(hetzner.HetznerCloud)\n\tclient := cloud.NetworkClient()\n\n\tidOrName := fi.ValueOf(v.Name)\n\tif v.ID != nil {\n\t\tidOrName = fi.ValueOf(v.ID)\n\t}\n\n\tnetwork, _, err := client.Get(context.TODO(), idOrName)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"failed to find network %q: %w\", idOrName, err)\n\t}\n\tif network == nil {\n\t\tif v.ID != nil {\n\t\t\treturn nil, fmt.Errorf(\"failed to find network %q\", idOrName)\n\t\t}\n\t\treturn nil, nil\n\t}\n\n\tmatches := &Network{\n\t\tName:      v.Name,\n\t\tLifecycle: v.Lifecycle,\n\t\tID:        new(strconv.FormatInt(network.ID, 10)),\n\t}\n\n\tif v.ID == nil {\n\t\tmatches.IPRange = network.IPRange.String()\n\t\tmatches.Labels = network.Labels\n\t\tmatches.Region = v.Region\n\t\tfor _, subnet := range network.Subnets {\n\t\t\tif subnet.IPRange != nil {\n\t\t\t\tmatches.Region = string(subnet.NetworkZone)\n\t\t\t\tmatches.Subnets = append(matches.Subnets, subnet.IPRange.String())","sourceCodeStart":49,"sourceCodeEnd":85,"githubUrl":"https://github.com/kubernetes/kops/blob/4c8573c808a73d578c5eadc86d410646ea0b0d73/upup/pkg/fi/cloudup/hetznertasks/network.go#L49-L85","documentation":"The Hetzner Cloud API responded successfully to client.Get for the network, but returned nil — meaning no network matching the given ID or name exists in the project. kOps throws this only when the task had an explicit ID set (v.ID != nil), because a missing network is then a hard failure rather than 'needs to be created'.","triggerScenarios":"Find in upup/pkg/fi/cloudup/hetznertasks/network.go:67: client.Get returns no error but network == nil while v.ID is set — i.e. the configured network ID does not exist in the Hetzner project the token can access.","commonSituations":"Network was deleted manually in the Hetzner console; cluster config references a network from another project; stale/typo'd network ID after reusing a cluster spec; token scoped to the wrong project.","solutions":["Verify the configured network ID with `hcloud network list` in the correct project and update the cluster spec.","Remove the explicit ID so kOps creates a new network, or create the network manually first.","Confirm the API token belongs to the project that contains the network.","If the network was deleted intentionally, run `kops update cluster` to recreate infrastructure."],"exampleFix":"// before\nnetwork:\n  id: \"9999999\"  # deleted network\n// after\nnetwork:\n  id: \"1234567\"  # existing network ID from `hcloud network list`","handlingStrategy":"validation","validationCode":"out, err := exec.Command(\"hcloud\", \"network\", \"describe\", cfg.NetworkID).Output()\nif err != nil {\n\treturn fmt.Errorf(\"network %q does not exist in this Hetzner project: %w\", cfg.NetworkID, err)\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Validate the configured network ID exists before running kops update.","Don't reuse cluster specs across Hetzner projects without updating the network ID.","Check for manual deletions in the Hetzner console before reconciling."],"tags":["hetzner","network","not-found","config","lookup"],"backgroundTag":"resource-not-found","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"}