prestodb/presto · error · OrcCorruptionException
Invalid ORC metadata %s or DWRF stripe cache size %s
Error message
Invalid ORC metadata %s or DWRF stripe cache size %s
What it means
DWRF files may carry an optional stripe footer cache. An ORC file's metadata section and the DWRF stripe cache are mutually exclusive tails: both being > 0 simultaneously is invalid. checkSizes throws OrcCorruptionException when both metadataSize and dwrfStripeCacheSize are positive.
Source
Thrown at presto-orc/src/main/java/com/facebook/presto/orc/cache/StorageOrcFileTailSource.java:214
orcDataSource,
Joiner.on('.').join(version),
CURRENT_MAJOR_VERSION,
CURRENT_MINOR_VERSION);
}
}
}
/**
* ORC metadata and DWRF stripe cache sizes are mutually exclusive because
* only ORC files have metadata, and only DWRF files have stripe cache.
* <p>
* Let's check that either both sizes are 0, or only one of them is
* greater than 0.
*/
private static void checkSizes(OrcDataSource orcDataSource, int metadataSize, int dwrfStripeCacheSize)
{
if (metadataSize > 0 && dwrfStripeCacheSize > 0) {
throw new OrcCorruptionException(orcDataSource.getId(),
"Invalid ORC metadata %s or DWRF stripe cache size %s",
metadataSize,
dwrfStripeCacheSize);
}
if (dwrfStripeCacheSize < 0) {
throw new OrcCorruptionException(orcDataSource.getId(), "Invalid DWRF stripe cache length %s", dwrfStripeCacheSize);
}
}
}
View on GitHub (pinned to 55bb57d202)
Solutions
- Regenerate the file with a DWRF writer that emits a consistent postscript.
- Validate with orc-tools/vertex-tools metadata dump to inspect both length fields.
- Check for storage corruption and restore from a known-good copy.
- Open an issue with the writer team if the file came from a specific internal pipeline version.
Defensive patterns
Strategy: try-catch
Try / catch
try { tail = source.getOrcFileTail(ds, reader, validation, false, time); }
catch (OrcCorruptionException e) { reportWriterInconsistency(ds.getId(), e); } Prevention
- Use consistent, supported DWRF writer versions
- Validate writer output (postscript fields) in CI for file-producing jobs
- Restore from backup when corruption is detected
When it happens
Trigger: getOrcFileTail reads a DWRF postscript where both dwrfStripeCacheLength and metadataLength are greater than zero — an inconsistent combination from a corrupt or non-conforming file.
Common situations: Files produced by DWRF writers with mismatched/buggy postscript fields, or corruption flipping a length field from 0 to a positive value.
Related errors
- Invalid DWRF stripe cache length %s
- Encrypted data size %s exceeds limit of 2^23
- Stripe encryption keys are missing, but file is encrypted
- Number of stripe encryption keys did not match number of enc
- Invalid file size %s
AI-assisted analysis of prestodb/presto@55bb57d202 (2026-09-04).
Data as JSON: /api/errors/4cefd45c782da8b7.
Report an issue: GitHub.