{"record":{"id":"e0c40cac1555a0b5","repo":"apache/druid","slug":"invalid-value-start-byte-s","errorCode":null,"errorMessage":"Invalid value start byte [%s]","messagePattern":"Invalid value start byte \\[(.+?)\\]","errorType":"exception","errorClass":"IllegalStateException","httpStatus":null,"severity":"error","filePath":"processing/src/main/java/org/apache/druid/frame/field/StringFieldReader.java","lineNumber":599,"sourceCode":"\n            final byte b = memory.getByte(i);\n\n            if (b == StringFieldWriter.VALUE_TERMINATOR) {\n              final int len = Ints.checkedCast(i - position);\n\n              final ByteBuffer buf = FrameReaderUtils.readByteBuffer(memory, position, len);\n              list.add(buf);\n\n              position += len;\n\n              break;\n            }\n          }\n\n          break;\n\n        default:\n          throw new ISE(\"Invalid value start byte [%s]\", kind);\n      }\n    }\n\n    if (!rowTerminatorSeen) {\n      throw new ISE(\"Unexpected end of field\");\n    }\n    return isEffectivelyNull;\n  }\n}\n","sourceCodeStart":581,"sourceCodeEnd":609,"githubUrl":"https://github.com/apache/druid/blob/9b90983fd291f26935af934383ce360473179e4d/processing/src/main/java/org/apache/druid/frame/field/StringFieldReader.java#L581-L609","documentation":"Each value in a string field must begin with a known kind byte (e.g. NULL_BYTE or NOT_NULL_BYTE). When addStringsToList reads a kind byte outside the recognized set, the field encoding is not what the reader expects, and it throws ISE. This means the bytes are not a validly encoded string/string-array field.","triggerScenarios":"Decoding memory with an invalid first byte per value — frames written by a different serializer version, offsets misaligned by earlier bad decoding, or wrapping arbitrary bytes as a string field.","commonSituations":"Version skew between writer and reader of frame format; reading a non-string field as a string field; corrupted durable storage frames after crash.","solutions":["Re-generate or re-fetch the frame to rule out corruption.","Align reader and writer on the same Druid version / frame format version.","Confirm the field is actually a string/string-array field before invoking addStringsToList."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try {\n  reader.readStringsFromMemory(memory, position, limit, list);\n} catch (IllegalStateException e) {\n  if (e.getMessage().startsWith(\"Invalid value start byte\")) {\n    throw new CorruptFrameException(\"Field encoding mismatch; likely version skew\", e);\n  }\n  throw e;\n}","preventionTips":["Never decode a non-string field as a string field; check the field kind first.","Avoid mixing Druid versions that changed frame serialization in one cluster."],"tags":["frame-corruption","string-field","decoder","invalid-encoding","druid"],"backgroundTag":"internal-invariant-violation","analyzedSha":"9b90983fd291f26935af934383ce360473179e4d","analyzedAt":"2026-09-07T13:32:30.957Z","contentChangedAt":"2026-09-07T13:32:30.957Z","schemaVersion":2},"datasetVersion":"2026-09-17T15:17:12.973Z"}