prestodb/presto · error · OrcCorruptionException
Invalid DWRF stripe cache length %s
Error message
Invalid DWRF stripe cache length %s
What it means
ORC tail-source sanity check: the DWRF stripe cache length read from the file's postscript is implausible (negative or exceeding the stripe size). A corruption sentinel for DWRF files — the postscript values for stripe cache are inconsistent with the file layout.
Source
Thrown at presto-orc/src/main/java/com/facebook/presto/orc/cache/StorageOrcFileTailSource.java:221
/**
* 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
- Restore or regenerate the file; tail corruption is not fixable in place.
- Verify with a metadata dump tool what dwrfStripeCacheLength the postscript encodes.
- Check the writer version compatibility (DWRF feature flags) of the producing job.
- Enable end-to-end checksums on the storage layer to catch corruption early.
Defensive patterns
Strategy: try-catch
Try / catch
try { tail = source.getOrcFileTail(ds, reader, validation, false, time); }
catch (OrcCorruptionException e) { reportWriterInconsistency(ds.getId(), e); } Prevention
- Pin DWRF writer versions in producing pipelines
- Check postscript integrity before long-term archival
- Enable end-to-end checksums
When it happens
Trigger: getOrcFileTail parses a postscript where dwrfStripeCacheLength is negative (e.g. large unsigned value decoded as negative toIntExact result, or corrupt bytes).
Common situations: Corruption in the last bytes of the file, or a writer version emitting incompatible postscript fields.
Related errors
- Invalid ORC metadata %s or DWRF stripe cache size %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/e24e156e0d985ff3.
Report an issue: GitHub.