{"record":{"id":"4b441a9002d2ff22","repo":"apache/druid","slug":"unrecognized-multi-value-flag-d-for-version-s","errorCode":null,"errorMessage":"Unrecognized multi-value flag[%d] for version[%s]","messagePattern":"Unrecognized multi-value flag\\[(.+?)\\] for version\\[(.+?)\\]","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"processing/src/main/java/org/apache/druid/segment/serde/DictionaryEncodedColumnPartSerde.java","lineNumber":451,"sourceCode":"        }\n      }\n\n      private WritableSupplier<ColumnarMultiInts> readMultiValuedColumn(\n          VERSION version,\n          ByteBuffer buffer,\n          int flags,\n          SegmentFileMapper fileMapper\n      )\n      {\n        switch (version) {\n          case UNCOMPRESSED_MULTI_VALUE: {\n            return VSizeColumnarMultiInts.readFromByteBuffer(buffer);\n          }\n          case UNCOMPRESSED_WITH_FLAGS: {\n            if (Feature.MULTI_VALUE.isSet(flags)) {\n              return VSizeColumnarMultiInts.readFromByteBuffer(buffer);\n            } else {\n              throw new IAE(\"Unrecognized multi-value flag[%d] for version[%s]\", flags, version);\n            }\n          }\n          case COMPRESSED: {\n            if (Feature.MULTI_VALUE.isSet(flags)) {\n              return CompressedVSizeColumnarMultiIntsSupplier.fromByteBuffer(buffer, byteOrder, fileMapper);\n            } else if (Feature.MULTI_VALUE_V3.isSet(flags)) {\n              return V3CompressedVSizeColumnarMultiIntsSupplier.fromByteBuffer(buffer, byteOrder, fileMapper);\n            } else {\n              throw new IAE(\"Unrecognized multi-value flag[%d] for version[%s]\", flags, version);\n            }\n          }\n          default:\n            throw new IAE(\"Unsupported multi-value version[%s]\", version);\n        }\n      }\n    };\n  }\n","sourceCodeStart":433,"sourceCodeEnd":469,"githubUrl":"https://github.com/apache/druid/blob/9b90983fd291f26935af934383ce360473179e4d/processing/src/main/java/org/apache/druid/segment/serde/DictionaryEncodedColumnPartSerde.java#L433-L469","documentation":"For UNCOMPRESSED_WITH_FLAGS single-format multi-value columns, the stored flags int must have the MULTI_VALUE feature bit set; anything else is not a readable layout, so readMultiValuedColumn throws this IAE with the raw flags value and version. It indicates a corrupt or hand-modified column header.","triggerScenarios":"Reading a VERSION.UNCOMPRESSED_WITH_FLAGS multi-valued string column where Feature.MULTI_VALUE.isSet(flags) is false — i.e. the flags int in the serialized column is invalid for this read path.","commonSituations":"Segment file corruption (flags bytes overwritten or truncated file read from wrong offset); manually patched/converted segment files; bugs in custom code writing segments directly with the segment-writing APIs.","solutions":["Restore the segment from deep storage or a backup; the flags field is corrupt.","Re-ingest the affected time chunk to regenerate the segment.","Check for any custom tooling that rewrites or truncates segment files and stop using it on production segments.","If it reproduces from a task, capture the task logs and report the ingestion bug with Druid version details."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try {\n    column = cache.getColumn(\"multiDim\");\n} catch (IAE e) {\n    if (e.getMessage().contains(\"Unrecognized multi-value flag\")) {\n        log.warn(\"Corrupt flags in segment column; scheduling re-ingestion of %s\", segmentId);\n        reingestionService.submit(segmentId);\n        return null;\n    }\n    throw e;\n}","preventionTips":["Treat segment files as immutable Druid-owned artifacts; never hand-edit them.","Keep backups/deep-storage copies of all segments.","Watch checksum/integrity in any segment transport tooling."],"tags":["druid","segment","corrupt-segment","flags","deserialization"],"backgroundTag":"invalid-flag-value","analyzedSha":"9b90983fd291f26935af934383ce360473179e4d","analyzedAt":"2026-09-07T13:32:30.957Z","contentChangedAt":"2026-09-07T13:32:30.957Z","schemaVersion":2},"datasetVersion":"2026-09-14T11:17:12.474Z"}