{"record":{"id":"402ab00ab7424dc8","repo":"kubernetes/kops","slug":"failed-to-find-network-q-w","errorCode":null,"errorMessage":"failed to find network %q: %w","messagePattern":"failed to find network %q: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"upup/pkg/fi/cloudup/hetznertasks/network.go","lineNumber":63,"sourceCode":"\nvar _ fi.CompareWithID = (*Network)(nil)\n\nfunc (v *Network) CompareWithID() *string {\n\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","sourceCodeStart":45,"sourceCodeEnd":81,"githubUrl":"https://github.com/kubernetes/kops/blob/4c8573c808a73d578c5eadc86d410646ea0b0d73/upup/pkg/fi/cloudup/hetznertasks/network.go#L45-L81","documentation":"The Hetzner Cloud API call client.Get(context.TODO(), idOrName) in the Network task's Find returned an error while looking up the cluster network by ID or name. This wraps the underlying API error (auth failure, network unreachable, rate limit, or transient Hetzner API error), so the original cause is always included via %w.","triggerScenarios":"Find in upup/pkg/fi/cloudup/hetznertasks/network.go:63 calls client.Get(ctx, idOrName) and the Hetzner API returns a non-nil error — e.g. invalid HCLOUD_TOKEN, 401/403 unauthorized, rate limiting (429), timeouts, or DNS/connectivity failures.","commonSituations":"Missing or expired Hetzner API token in the environment; wrong project (network lives in a different Hetzner project than the token can see); corporate proxy/firewall blocking api.hetzner.cloud; Hetzner API outage or rate limiting during reconciliation.","solutions":["Inspect the wrapped cause (%w) in the error message to identify the actual API failure.","Verify the Hetzner API token is valid, has network read permissions, and belongs to the project containing the network.","Test connectivity: `curl -H \"Authorization: Bearer $HCLOUD_TOKEN\" https://api.hetzner.cloud/v1/networks`.","If rate limited or transient (429/5xx), retry reconciliation after a short delay."],"exampleFix":"null","handlingStrategy":"try-catch","validationCode":"// preflight: verify token works before running kops\ncurl -fsS -H \"Authorization: Bearer $HCLOUD_TOKEN\" https://api.hetzner.cloud/v1/networks > /dev/null || echo \"Hetzner API unreachable or token invalid\"","typeGuard":null,"tryCatchPattern":"if err := runKopsUpdate(); err != nil {\n\tvar apiErr *hcloud.ErrorResponse\n\tif errors.As(err, &apiErr) {\n\t\tswitch apiErr.Code {\n\t\thcloud.ErrorCodeUnauthorized, hcloud.ErrorCodeForbidden:\n\t\t\t// fix HCLOUD_TOKEN / project permissions\n\t\tdefault:\n\t\t\t// transient: retry with backoff\n\t\t}\n\t}\n}","preventionTips":["Keep HCLOUD_TOKEN valid and scoped to the correct project with network read permissions.","Preflight-check API connectivity before long update runs.","Watch for 429 rate limits when running many concurrent kops operations."],"tags":["hetzner","network","api","authentication","lookup"],"backgroundTag":"api-request-failed","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"}