prestodb/presto · error · PrestoException
LANCE_ERROR
LANCE_ERROR
Error message
Failed to serialize fragment metadata
What it means
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.
Source
Thrown at presto-lance/src/main/java/com/facebook/presto/lance/LanceFragmentData.java:137
return deletionFile;
}
@JsonProperty
public String getRowIdMetadata()
{
return rowIdMetadata;
}
public static String serializeFragments(List<FragmentMetadata> fragments)
{
try {
List<LanceFragmentData> data = fragments.stream()
.map(LanceFragmentData::fromFragmentMetadata)
.collect(toImmutableList());
return MAPPER.writeValueAsString(data);
}
catch (JsonProcessingException e) {
throw new PrestoException(LanceErrorCode.LANCE_ERROR, "Failed to serialize fragment metadata", e);
}
}
public static List<FragmentMetadata> deserializeFragments(String json)
{
try {
List<LanceFragmentData> data = MAPPER.readValue(json, new TypeReference<List<LanceFragmentData>>() {});
return data.stream()
.map(LanceFragmentData::toFragmentMetadata)
.collect(toImmutableList());
}
catch (JsonProcessingException e) {
throw new PrestoException(LanceErrorCode.LANCE_ERROR, "Failed to deserialize fragment metadata", e);
}
}
public static class LanceDataFile
{View on GitHub (pinned to 55bb57d202)
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
Defensive patterns
Strategy: try-catch
Validate before calling
// smoke-test metadata round-trip at startup
try {
String json = MAPPER.writeValueAsString(
List.of(LanceFragmentData.fromFragmentMetadata(sample)));
} catch (JsonProcessingException e) {
throw new IllegalStateException("Jackson cannot serialize fragment metadata", e);
} Try / catch
try {
String json = LanceFragmentData.serializeFragments(fragments);
} catch (PrestoException e) {
if (e.getErrorCode().getName().contains("LANCE")) {
// inspect cause for Jackson failure details; align versions/config
}
} Prevention
- 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
When it happens
Trigger: 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.
Common situations: 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.
Understand the failure class
Background: "JSON serialization failed", "not JSON serializable", "Failed to serialize": why JSON marshaling errors happen and how to fix them — this error's family across 46 libraries.
Related errors
- INVALID_FUNCTION_ARGUMENT
- NOT_SUPPORTED
- Deserialized SingleMapBlock violates invariants: key %d, val
- Deserialized SingleMapBlock violates invariants: expected ha
- Value %d exceeds MAX_BYTE
AI-assisted analysis of prestodb/presto@55bb57d202 (2026-09-04).
Data as JSON: /api/errors/1c3e37272cb72e06.
Report an issue: GitHub.