{"record":{"id":"35fc0f64729dd753","repo":"kubernetes/kops","slug":"invalid-instance-id-q-w","errorCode":null,"errorMessage":"invalid instance id %q: %w","messagePattern":"invalid instance id %q: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/nodeidentity/linode/identify.go","lineNumber":143,"sourceCode":"\tif !strings.HasPrefix(providerID, providerIDPrefix) {\n\t\treturn 0, \"\", fmt.Errorf(\"missing prefix %q\", providerIDPrefix)\n\t}\n\n\traw := strings.TrimPrefix(providerID, providerIDPrefix)\n\traw = strings.Trim(raw, \"/\")\n\tif raw == \"\" {\n\t\treturn 0, \"\", fmt.Errorf(\"missing instance id\")\n\t}\n\n\tparts := strings.Split(raw, \"/\")\n\tinstanceID := parts[len(parts)-1]\n\tif instanceID == \"\" {\n\t\treturn 0, \"\", fmt.Errorf(\"missing instance id\")\n\t}\n\n\tlinodeID, err := strconv.Atoi(instanceID)\n\tif err != nil {\n\t\treturn 0, \"\", fmt.Errorf(\"invalid instance id %q: %w\", instanceID, err)\n\t}\n\n\treturn linodeID, instanceID, nil\n}\n\n// isExpectedInstanceStatus returns true if the instance is in a state where it can be identified.\nfunc isExpectedInstanceStatus(status linodego.InstanceStatus) bool {\n\tswitch status {\n\tcase linodego.InstanceRunning, linodego.InstanceBooting, linodego.InstanceProvisioning:\n\t\treturn true\n\tdefault:\n\t\treturn false\n\t}\n}\n\n// buildLabelsFromTags converts Akamai (Linode) instance tags into Kubernetes node labels.\n// It handles role tags (kops.k8s.io/instance-role) and direct label tags (kops.k8s.io/* and node-role.kubernetes.io/*).\nfunc buildLabelsFromTags(tags []string) map[string]string {","sourceCodeStart":125,"sourceCodeEnd":161,"githubUrl":"https://github.com/kubernetes/kops/blob/4c8573c808a73d578c5eadc86d410646ea0b0d73/pkg/nodeidentity/linode/identify.go#L125-L161","documentation":"parseInstanceIDFromProviderID converts the trailing providerID segment into a numeric Linode instance ID with strconv.Atoi. This error wraps the parse failure when that segment is not a decimal integer, e.g. 'linode://abc' or a URL containing extra non-numeric data.","triggerScenarios":"providerID's last '/'-separated segment fails Atoi: non-numeric text ('linode://my-server'), embedded whitespace, or a multi-segment tail where the wrong segment is picked (e.g. 'linode://us-east/instance/abc').","commonSituations":"Custom or legacy providerID formats that don't match the expected 'linode://<numeric-id>' scheme, or providerIDs produced by a different tool/version of the Linode CCM.","solutions":["Check the node's providerID value and correct it to the format 'linode://<numeric-instance-id>'","Confirm the installed Linode cloud-controller-manager version emits numeric instance IDs in providerID","Trim or normalize the providerID string (strip whitespace, extra path segments) before node identification"],"exampleFix":"// before\nnode.Spec.ProviderID = \"linode://i-abc123\"\n// after\nnode.Spec.ProviderID = \"linode://12345678\"","handlingStrategy":"validation","validationCode":"pid := node.Spec.ProviderID\nid := pid[strings.LastIndex(pid, \"/\")+1:]\nif _, err := strconv.Atoi(id); err != nil {\n    return fmt.Errorf(\"providerID %q does not end in a numeric linode instance id\", pid)\n}","typeGuard":"func isNumericLinodeProviderID(pid string) bool {\n    const prefix = \"linode://\"\n    if !strings.HasPrefix(pid, prefix) {\n        return false\n    }\n    _, err := strconv.Atoi(strings.TrimPrefix(pid, prefix))\n    return err == nil\n}","tryCatchPattern":null,"preventionTips":["Standardize on the 'linode://<numeric-id>' providerID format across your tooling","Strip whitespace and unexpected path segments from providerIDs before use","Pin a Linode CCM version known to emit numeric instance IDs"],"tags":["linode","node-identity","providerid","parse-error"],"backgroundTag":"invalid-instance-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"}