{"record":{"id":"1c3e37272cb72e06","repo":"prestodb/presto","slug":"lance-error-1c3e37","errorCode":"LANCE_ERROR","errorMessage":"Failed to serialize fragment metadata","messagePattern":"Failed to serialize fragment metadata","errorType":"error_code","errorClass":"PrestoException","httpStatus":null,"severity":"error","filePath":"presto-lance/src/main/java/com/facebook/presto/lance/LanceFragmentData.java","lineNumber":137,"sourceCode":"        return deletionFile;\n    }\n\n    @JsonProperty\n    public String getRowIdMetadata()\n    {\n        return rowIdMetadata;\n    }\n\n    public static String serializeFragments(List<FragmentMetadata> fragments)\n    {\n        try {\n            List<LanceFragmentData> data = fragments.stream()\n                    .map(LanceFragmentData::fromFragmentMetadata)\n                    .collect(toImmutableList());\n            return MAPPER.writeValueAsString(data);\n        }\n        catch (JsonProcessingException e) {\n            throw new PrestoException(LanceErrorCode.LANCE_ERROR, \"Failed to serialize fragment metadata\", e);\n        }\n    }\n\n    public static List<FragmentMetadata> deserializeFragments(String json)\n    {\n        try {\n            List<LanceFragmentData> data = MAPPER.readValue(json, new TypeReference<List<LanceFragmentData>>() {});\n            return data.stream()\n                    .map(LanceFragmentData::toFragmentMetadata)\n                    .collect(toImmutableList());\n        }\n        catch (JsonProcessingException e) {\n            throw new PrestoException(LanceErrorCode.LANCE_ERROR, \"Failed to deserialize fragment metadata\", e);\n        }\n    }\n\n    public static class LanceDataFile\n    {","sourceCodeStart":119,"sourceCodeEnd":155,"githubUrl":"https://github.com/prestodb/presto/blob/55bb57d202de3b926896fa966c2c4a44c779634e/presto-lance/src/main/java/com/facebook/presto/lance/LanceFragmentData.java#L119-L155","documentation":"LanceFragmentData.serializeFragments failed to convert the list of fragment metadata to JSON (JsonProcessingException), wrapped as LANCE_ERROR. Fragment metadata serialization is used to carry split/commit info through the connector, so this failure blocks split creation.","triggerScenarios":"Calling serializeFragments when MAPPER.writeValueAsString(data) throws JsonProcessingException — e.g. a Jackson version incompatibility, unexpected object graph from fromFragmentMetadata, or a mapper configuration that cannot serialize the Lance FragmentMetadata-derived fields.","commonSituations":"Jackson version conflicts on the classpath (connector built against one Jackson, runtime ships another); new Lance SDK types not handled by the configured mapper; annotation/visibility config changes breaking serialization of metadata POJOs.","solutions":["Check for Jackson version conflicts on the classpath and align the connector's Jackson dependency with the server's","Inspect the wrapped JsonProcessingException message to find the unserializable field/type and add/maintain the appropriate Jackson module or @JsonIgnore/@JsonProperty annotations","Ensure the Lance library version matches what LanceFragmentData was built against; upgrade or pin it consistently"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"// smoke-test metadata round-trip at startup\ntry {\n    String json = MAPPER.writeValueAsString(\n        List.of(LanceFragmentData.fromFragmentMetadata(sample))); \n} catch (JsonProcessingException e) {\n    throw new IllegalStateException(\"Jackson cannot serialize fragment metadata\", e);\n}","typeGuard":null,"tryCatchPattern":"try {\n    String json = LanceFragmentData.serializeFragments(fragments);\n} catch (PrestoException e) {\n    if (e.getErrorCode().getName().contains(\"LANCE\")) {\n        // inspect cause for Jackson failure details; align versions/config\n    }\n}","preventionTips":["Lock Jackson versions across connector and server dependencies","Test metadata (de)serialization in CI whenever the Lance SDK is upgraded","Keep metadata POJOs simple and Jackson-annotated","Verify all Lance types on the metadata path have registered modules"],"tags":["presto","lance","json","serialization"],"backgroundTag":"json-serialization-failed","analyzedSha":"55bb57d202de3b926896fa966c2c4a44c779634e","analyzedAt":"2026-09-04T12:50:26.162Z","contentChangedAt":"2026-09-04T12:50:26.162Z","schemaVersion":2},"datasetVersion":"2026-09-11T21:17:09.523Z"}