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

  1. Check for Jackson version conflicts on the classpath and align the connector's Jackson dependency with the server's
  2. Inspect the wrapped JsonProcessingException message to find the unserializable field/type and add/maintain the appropriate Jackson module or @JsonIgnore/@JsonProperty annotations
  3. 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

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


AI-assisted analysis of prestodb/presto@55bb57d202 (2026-09-04). Data as JSON: /api/errors/1c3e37272cb72e06. Report an issue: GitHub.