{"record":{"id":"b8cfd8d5edefaaea","repo":"kubernetes/kops","slug":"missing-prefix-q","errorCode":null,"errorMessage":"missing prefix %q","messagePattern":"missing prefix %q","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/nodeidentity/linode/identify.go","lineNumber":126,"sourceCode":"\tinfo := &nodeidentity.Info{\n\t\tInstanceID: instanceID,\n\t\tLabels:     buildLabelsFromTags(instance.Tags),\n\t}\n\n\tif i.cacheEnabled {\n\t\tif err := i.cache.Add(info); err != nil {\n\t\t\tklog.Warningf(\"Failed to add node identity info to cache: %v\", err)\n\t\t}\n\t}\n\n\treturn info, nil\n}\n\n// parseInstanceIDFromProviderID extracts the numeric instance ID and string ID from a provider ID.\n// It supports formats like \"linode://123\", \"linode:///123\", and \"linode://region/123\".\nfunc parseInstanceIDFromProviderID(providerID string) (int, string, error) {\n\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}","sourceCodeStart":108,"sourceCodeEnd":144,"githubUrl":"https://github.com/kubernetes/kops/blob/4c8573c808a73d578c5eadc86d410646ea0b0d73/pkg/nodeidentity/linode/identify.go#L108-L144","documentation":"parseInstanceIDFromProviderID requires the node's providerID to begin with the Linode prefix (e.g. 'linode://'); this guard fires for providerIDs in any other format. It means the Node's providerID was set by something other than the Linode cloud provider or is malformed, so the numeric instance ID cannot be extracted.","triggerScenarios":"Thrown at pkg/nodeidentity/linode/identify.go:126 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Set node.spec.providerID to the linode://<instance-id> format","Ensure the correct cloud-provider integration is stamping provider IDs on Linode nodes"],"exampleFix":null,"handlingStrategy":"type-guard","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"}