{"record":{"id":"2768f15ccc29ee86","repo":"quickwit-oss/tantivy","slug":"invaliddata-2768f1","errorCode":"InvalidData","errorMessage":"No extended field type is associated with code {ext_type_code:?}","messagePattern":"No extended field type is associated with code (.+?)","errorType":"error_code","errorClass":"io::Error","httpStatus":null,"severity":"error","filePath":"src/schema/document/de.rs","lineNumber":384,"sourceCode":"    ) -> Result<Self, DeserializeError> {\n        let type_code = <u8 as BinarySerializable>::deserialize(reader)?;\n\n        let value_type = match type_code {\n            type_codes::TEXT_CODE => ValueType::String,\n            type_codes::U64_CODE => ValueType::U64,\n            type_codes::I64_CODE => ValueType::I64,\n            type_codes::F64_CODE => ValueType::F64,\n            type_codes::BOOL_CODE => ValueType::Bool,\n            type_codes::DATE_CODE => ValueType::DateTime,\n            type_codes::HIERARCHICAL_FACET_CODE => ValueType::Facet,\n            type_codes::BYTES_CODE => ValueType::Bytes,\n            type_codes::EXT_CODE => {\n                let ext_type_code = <u8 as BinarySerializable>::deserialize(reader)?;\n\n                match ext_type_code {\n                    type_codes::TOK_STR_EXT_CODE => ValueType::PreTokStr,\n                    _ => {\n                        return Err(DeserializeError::from(io::Error::new(\n                            io::ErrorKind::InvalidData,\n                            format!(\n                                \"No extended field type is associated with code {ext_type_code:?}\"\n                            ),\n                        )))\n                    }\n                }\n            }\n            type_codes::IP_CODE => ValueType::IpAddr,\n            type_codes::NULL_CODE => ValueType::Null,\n            type_codes::ARRAY_CODE => ValueType::Array,\n            type_codes::OBJECT_CODE => ValueType::Object,\n            #[expect(deprecated)]\n            type_codes::JSON_OBJ_CODE => ValueType::JSONObject,\n            _ => {\n                return Err(DeserializeError::from(io::Error::new(\n                    io::ErrorKind::InvalidData,\n                    format!(\"No field type is associated with code {type_code:?}\"),","sourceCodeStart":366,"sourceCodeEnd":402,"githubUrl":"https://github.com/quickwit-oss/tantivy/blob/b5d8deb80c26924e6b007a5b1a7630f35ca64de4/src/schema/document/de.rs#L366-L402","documentation":"During document/schema deserialization, the EXT_CODE type code is followed by an extended type byte identifying the specific extended value type. Only TOK_STR_EXT_CODE (PreTokStr) is known; any other byte is rejected with this InvalidData error wrapped in a DeserializeError, since the encoding is undefined for unknown extended codes.","triggerScenarios":"from_reader (Value deserialization) reading a stream whose EXT_CODE byte is followed by an unknown extended type code: files written by a newer tantivy version introducing new ext types, corrupted byte streams, or hand-crafted serialization in tests/tools.","commonSituations":"Forward-compatibility break: an index or document snapshot written by a newer tantivy that supports extra extended field types, read by an older version; bit rot in stored documents containing pre-tokenized strings.","solutions":["Upgrade tantivy to the version that wrote the data so the extended type code is recognized","Restore the affected file from a backup or re-index the documents","If producing the bytes yourself, only emit known extended codes (TOK_STR_EXT_CODE)","Hex-dump the offending byte to identify which ext code is present"],"exampleFix":"// before\ntantivy = \"0.21\" // reading data written by tantivy 0.22 with a new ext code\n// after\ntantivy = \"0.22\" // match (or exceed) the writer's version","handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"match from_reader_result {\n    Err(e) if e.to_string().contains(\"No extended field type\") => {\n        eprintln!(\"data written by newer/incompatible tantivy; upgrade\");\n    }\n    Err(e) => return Err(e),\n    Ok(v) => v,\n}","preventionTips":["Keep reader tantivy version >= writer version","Re-export serialized documents when upgrading versions","Only emit documented type_codes when hand-writing encodings","Store the tantivy version alongside serialized snapshots"],"tags":["deserialization","schema","version-mismatch","invalid-data"],"backgroundTag":"unknown-field-type-code","analyzedSha":"b5d8deb80c26924e6b007a5b1a7630f35ca64de4","analyzedAt":"2026-09-05T13:20:51.521Z","contentChangedAt":"2026-09-05T13:20:51.521Z","schemaVersion":2},"datasetVersion":"2026-09-12T17:17:11.597Z"}