prestodb/presto · error · OrcCorruptionException

Invalid file metadata

Error message

Invalid file metadata

What it means

ORC metadata-reading error: parsing the file metadata section's protobuf failed (InvalidProtocolBufferException), wrapped as 'Invalid file metadata'. The metadata region after the footer is malformed — corruption, truncation, or reading a non-ORC file with the DWRF reader.

Source

Thrown at presto-orc/src/main/java/com/facebook/presto/orc/metadata/ExceptionWrappingMetadataReader.java:67

            throws OrcCorruptionException, IOException
    {
        try {
            return delegate.readPostScript(data, offset, length);
        }
        catch (InvalidProtocolBufferException e) {
            throw new OrcCorruptionException(e, orcDataSourceId, "Invalid postscript");
        }
    }

    @Override
    public Metadata readMetadata(HiveWriterVersion hiveWriterVersion, InputStream inputStream)
            throws OrcCorruptionException, IOException
    {
        try {
            return delegate.readMetadata(hiveWriterVersion, inputStream);
        }
        catch (InvalidProtocolBufferException e) {
            throw new OrcCorruptionException(e, orcDataSourceId, "Invalid file metadata");
        }
    }

    @Override
    public Footer readFooter(HiveWriterVersion hiveWriterVersion,
            InputStream inputStream,
            DwrfEncryptionProvider dwrfEncryptionProvider,
            DwrfKeyProvider dwrfKeyProvider,
            OrcDataSource orcDataSource,
            Optional<OrcDecompressor> decompressor)
            throws OrcCorruptionException, IOException
    {
        try {
            return delegate.readFooter(hiveWriterVersion, inputStream, dwrfEncryptionProvider, dwrfKeyProvider, orcDataSource, decompressor);
        }
        catch (InvalidProtocolBufferException e) {
            throw new OrcCorruptionException(e, orcDataSourceId, "Invalid file footer");
        }

View on GitHub (pinned to 55bb57d202)

Solutions

  1. Verify the file was fully written and flushed
  2. Check for block-level corruption on the storage system
  3. Reproduce reading the file with another ORC tool
Defensive patterns

Strategy: try-catch

When it happens

Trigger: Thrown at presto-orc/src/main/java/com/facebook/presto/orc/metadata/ExceptionWrappingMetadataReader.java:67 when the library encounters an invalid state.

Common situations: See trigger scenarios.


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