{"record":{"id":"37b8f0ed510309a0","repo":"prestodb/presto","slug":"invalid-file-metadata","errorCode":null,"errorMessage":"Invalid file metadata","messagePattern":"Invalid file metadata","errorType":"exception","errorClass":"OrcCorruptionException","httpStatus":null,"severity":"error","filePath":"presto-orc/src/main/java/com/facebook/presto/orc/metadata/ExceptionWrappingMetadataReader.java","lineNumber":67,"sourceCode":"            throws OrcCorruptionException, IOException\n    {\n        try {\n            return delegate.readPostScript(data, offset, length);\n        }\n        catch (InvalidProtocolBufferException e) {\n            throw new OrcCorruptionException(e, orcDataSourceId, \"Invalid postscript\");\n        }\n    }\n\n    @Override\n    public Metadata readMetadata(HiveWriterVersion hiveWriterVersion, InputStream inputStream)\n            throws OrcCorruptionException, IOException\n    {\n        try {\n            return delegate.readMetadata(hiveWriterVersion, inputStream);\n        }\n        catch (InvalidProtocolBufferException e) {\n            throw new OrcCorruptionException(e, orcDataSourceId, \"Invalid file metadata\");\n        }\n    }\n\n    @Override\n    public Footer readFooter(HiveWriterVersion hiveWriterVersion,\n            InputStream inputStream,\n            DwrfEncryptionProvider dwrfEncryptionProvider,\n            DwrfKeyProvider dwrfKeyProvider,\n            OrcDataSource orcDataSource,\n            Optional<OrcDecompressor> decompressor)\n            throws OrcCorruptionException, IOException\n    {\n        try {\n            return delegate.readFooter(hiveWriterVersion, inputStream, dwrfEncryptionProvider, dwrfKeyProvider, orcDataSource, decompressor);\n        }\n        catch (InvalidProtocolBufferException e) {\n            throw new OrcCorruptionException(e, orcDataSourceId, \"Invalid file footer\");\n        }","sourceCodeStart":49,"sourceCodeEnd":85,"githubUrl":"https://github.com/prestodb/presto/blob/55bb57d202de3b926896fa966c2c4a44c779634e/presto-orc/src/main/java/com/facebook/presto/orc/metadata/ExceptionWrappingMetadataReader.java#L49-L85","documentation":"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.","triggerScenarios":"Thrown at presto-orc/src/main/java/com/facebook/presto/orc/metadata/ExceptionWrappingMetadataReader.java:67 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Verify the file was fully written and flushed","Check for block-level corruption on the storage system","Reproduce reading the file with another ORC tool"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"55bb57d202de3b926896fa966c2c4a44c779634e","analyzedAt":"2026-09-04T12:50:26.162Z","contentChangedAt":"2026-09-04T12:50:26.162Z","schemaVersion":2},"datasetVersion":"2026-09-11T21:17:09.523Z"}