{"record":{"id":"d071e47daf7f087f","repo":"prestodb/presto","slug":"iceberg-filesystem-error","errorCode":"ICEBERG_FILESYSTEM_ERROR","errorMessage":"Failed to read table files","messagePattern":"Failed to read table files","errorType":"error_code","errorClass":"PrestoException","httpStatus":null,"severity":"error","filePath":"presto-iceberg/src/main/java/com/facebook/presto/iceberg/FilesTable.java","lineNumber":202,"sourceCode":"                            .collect(toImmutableMap(\n                                    Map.Entry<Integer, ByteBuffer>::getKey,\n                                    entry -> Transforms.identity().toHumanString(idToTypeMap.get(entry.getKey()),\n                                            Conversions.fromByteBuffer(idToTypeMap.get(entry.getKey()), entry.getValue())))));\n                }\n                if (checkNonNull(dataFile.keyMetadata(), pagesBuilder)) {\n                    pagesBuilder.appendVarbinary(Slices.wrappedBuffer(dataFile.keyMetadata()));\n                }\n                if (checkNonNull(dataFile.splitOffsets(), pagesBuilder)) {\n                    pagesBuilder.appendBigintArray(dataFile.splitOffsets());\n                }\n                if (checkNonNull(dataFile.equalityFieldIds(), pagesBuilder)) {\n                    pagesBuilder.appendIntegerArray(dataFile.equalityFieldIds());\n                }\n                pagesBuilder.endRow();\n            }\n        }\n        catch (IOException e) {\n            throw new PrestoException(ICEBERG_FILESYSTEM_ERROR, \"Failed to read table files\", e);\n        }\n        catch (RuntimeException e) {\n            // Catch Avro-specific exceptions that may occur during manifest deserialization\n            if (isAvroException(e)) {\n                throw new PrestoException(ICEBERG_INVALID_METADATA,\n                        \"Cannot read manifest files. Manifests may be written by a newer Iceberg version.\", e);\n            }\n            throw e;\n        }\n\n        // Validate that we successfully read files if manifests exist\n        // Check snapshot summary to avoid false positives on legitimately empty tables\n        if (manifestCount > 0 && fileCount == 0) {\n            long expectedFileCount = 0;\n            if (icebergTable.currentSnapshot() != null) {\n                Map<String, String> summary = icebergTable.currentSnapshot().summary();\n                try {\n                    expectedFileCount = Long.parseLong(summary.getOrDefault(\"total-data-files\", \"0\"));","sourceCodeStart":184,"sourceCodeEnd":220,"githubUrl":"https://github.com/prestodb/presto/blob/55bb57d202de3b926896fa966c2c4a44c779634e/presto-iceberg/src/main/java/com/facebook/presto/iceberg/FilesTable.java#L184-L220","documentation":"FilesTable.buildPages wraps the whole manifest/data-file reading loop: any exception while reading table files (IO errors, corrupt manifests, access failures) is converted into this PrestoException with the underlying cause attached, indicating failure to enumerate the table's data files for the FILES metadata table.","triggerScenarios":"Thrown at presto-iceberg/src/main/java/com/facebook/presto/iceberg/FilesTable.java:202 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Inspect the cause: fix underlying IO/permission problems on the table location","Verify manifest files are not corrupted; repair with Iceberg's remove_orphan_files/rewrite tooling","Retry if the failure was transient (e.g. S3 throttling)"],"exampleFix":null,"handlingStrategy":"fallback","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"}