{"record":{"id":"418adb157b1d4248","repo":"t8y2/dbx","slug":"kind-w-418adb","errorCode":null,"errorMessage":"kind: %w","messagePattern":"kind: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"agents/drivers/hive-go/config.go","lineNumber":790,"sourceCode":"\t\t}\n\t}\n\tif decodeErr != nil {\n\t\treturn nil, nil, decodeErr\n\t}\n\treader := strings.NewReader(string(decoded))\n\tidentifier, err := readHadoopByteArray(reader)\n\tif err != nil {\n\t\treturn nil, nil, fmt.Errorf(\"identifier: %w\", err)\n\t}\n\tpassword, err := readHadoopByteArray(reader)\n\tif err != nil {\n\t\treturn nil, nil, fmt.Errorf(\"password: %w\", err)\n\t}\n\tif len(identifier) == 0 || len(password) == 0 {\n\t\treturn nil, nil, errors.New(\"token identifier and password must be non-empty\")\n\t}\n\tif _, err := readHadoopByteArray(reader); err != nil {\n\t\treturn nil, nil, fmt.Errorf(\"kind: %w\", err)\n\t}\n\tif _, err := readHadoopByteArray(reader); err != nil {\n\t\treturn nil, nil, fmt.Errorf(\"service: %w\", err)\n\t}\n\tif reader.Len() != 0 {\n\t\treturn nil, nil, errors.New(\"token contains trailing data\")\n\t}\n\treturn identifier, password, nil\n}\n\nfunc readHadoopByteArray(reader io.ByteReader) ([]byte, error) {\n\tlength, err := readHadoopVInt(reader)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tif length < 0 {\n\t\treturn nil, fmt.Errorf(\"negative length %d\", length)\n\t}","sourceCodeStart":772,"sourceCodeEnd":808,"githubUrl":"https://github.com/t8y2/dbx/blob/c0390bff16418b651f4728520d99adf8ce48829a/agents/drivers/hive-go/config.go#L772-L808","documentation":"This error means the kind field of the Hadoop delegation token could not be read. After identifier and password parse successfully, the parser expects two more length-prefixed fields (kind and service); failure on the kind field means the payload is malformed or shorter than expected. The identifier/password emptiness check has already passed at this point.","triggerScenarios":"A token whose bytes end after identifier+password, or whose kind field length prefix is invalid, e.g. a hand-rolled or foreign token format.","commonSituations":"Tokens from custom Hadoop-compatible systems with a different field order; manually constructed tokens in tests; truncated serialization.","solutions":["Use a delegation token issued by the actual Hive/Hadoop server (Token[HIVE_DELEGATION_TOKEN])","Re-encode the token from the server's TokenIdentifier rather than crafting it manually","Compare byte layout with a known-good token to identify the structural mismatch"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"if err != nil && strings.Contains(err.Error(), \"kind:\") {\n\treturn fmt.Errorf(\"token not a standard Hadoop format: %w\", err)\n}","preventionTips":["Use server-issued delegation tokens only, not hand-crafted ones","Match token serialization to the server's Hadoop/RPC version","Test token decoding as a preflight check"],"tags":["hive","delegation-token","serialization"],"backgroundTag":"delegation-token-decode-failed","analyzedSha":"c0390bff16418b651f4728520d99adf8ce48829a","analyzedAt":"2026-09-05T23:05:10.900Z","contentChangedAt":"2026-09-05T23:05:10.900Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}