{"record":{"id":"622c41cc681b6e78","repo":"kubernetes/kops","slug":"failed-to-convert-network-id-q-to-int-w","errorCode":null,"errorMessage":"failed to convert network ID %q to int: %w","messagePattern":"failed to convert network ID %q to int: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"upup/pkg/fi/cloudup/hetznertasks/loadbalancer.go","lineNumber":240,"sourceCode":"\t\t\treturn fi.RequiredField(\"Target\")\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc (_ *LoadBalancer) RenderHetzner(t *hetzner.HetznerAPITarget, a, e, changes *LoadBalancer) error {\n\tctx := context.TODO()\n\tactionClient := t.Cloud.ActionClient()\n\tclient := t.Cloud.LoadBalancerClient()\n\n\tif a == nil {\n\t\tif e.Network == nil {\n\t\t\treturn fmt.Errorf(\"failed to find network for loadbalancer %q\", fi.ValueOf(e.Name))\n\t\t}\n\n\t\tnetworkID, err := strconv.ParseInt(fi.ValueOf(e.Network.ID), 10, 64)\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"failed to convert network ID %q to int: %w\", fi.ValueOf(e.Network.ID), err)\n\t\t}\n\n\t\topts := hcloud.LoadBalancerCreateOpts{\n\t\t\tName: fi.ValueOf(e.Name),\n\t\t\tLoadBalancerType: &hcloud.LoadBalancerType{\n\t\t\t\tName: e.Type,\n\t\t\t},\n\t\t\tAlgorithm: &hcloud.LoadBalancerAlgorithm{\n\t\t\t\tType: hcloud.LoadBalancerAlgorithmTypeRoundRobin,\n\t\t\t},\n\t\t\tLocation: &hcloud.Location{\n\t\t\t\tName: e.Location,\n\t\t\t},\n\t\t\tLabels: e.Labels,\n\t\t\tTargets: []hcloud.LoadBalancerCreateOptsTarget{\n\t\t\t\t{\n\t\t\t\t\tType: hcloud.LoadBalancerTargetTypeLabelSelector,\n\t\t\t\t\tLabelSelector: hcloud.LoadBalancerCreateOptsTargetLabelSelector{","sourceCodeStart":222,"sourceCodeEnd":258,"githubUrl":"https://github.com/kubernetes/kops/blob/4c8573c808a73d578c5eadc86d410646ea0b0d73/upup/pkg/fi/cloudup/hetznertasks/loadbalancer.go#L222-L258","documentation":"During Hetzner load balancer creation, kOps parses the cluster network ID with strconv.ParseInt. This error wraps that parse failure, meaning the Network referenced by the load balancer task has an ID field that is not a plain decimal integer (or is empty). It indicates the network object attached to the cluster spec is malformed or was not resolved to a real Hetzner network.","triggerScenarios":"RenderHetzner in upup/pkg/fi/cloudup/hetznertasks/loadbalancer.go:240 runs strconv.ParseInt(e.Network.ID, 10, 64) and it returns an error — e.g. Network.ID is an empty string, contains non-numeric characters, whitespace, or is a name instead of a numeric Hetzner network ID.","commonSituations":"Cluster config points at a network by name rather than numeric ID; the network task never ran/failed so the ID placeholder is empty; typos or copied values with quotes/spaces in the network ID field; YAML config where network id was set to a hostname or label.","solutions":["Check the cluster spec's network configuration and set the Hetzner network ID to a numeric decimal value (e.g. \"1234567\"), not a name.","Ensure the hetznertasks Network task renders before the LoadBalancer task so the resolved ID is populated.","Verify with `hcloud network list` that the network exists and copy its numeric ID exactly, without quotes/spaces.","If the ID comes from code, confirm the field being passed is Network.ID and not Network.Name."],"exampleFix":"// before\nnetwork:\n  id: my-private-net\n// after\nnetwork:\n  id: \"1234567\"","handlingStrategy":"validation","validationCode":"id := cluster.Spec.NetworkID\nif n, err := strconv.ParseInt(id, 10, 64); err != nil || n <= 0 {\n\treturn fmt.Errorf(\"hetzner network ID %q must be a positive numeric ID\", id)\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always configure the numeric Hetzner network ID, never the network name.","Copy IDs directly from `hcloud network list` output.","Let kOps create/manage the network so the ID is resolved programmatically."],"tags":["hetzner","loadbalancer","network","config","parse-error"],"backgroundTag":"invalid-numeric-id","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"}