{"record":{"id":"bad17e0186212922","repo":"apache/iceberg","slug":"failed-to-read-manifest-s","errorCode":null,"errorMessage":"Failed to read manifest: %s","messagePattern":"Failed to read manifest: (.+?)","errorType":"exception","errorClass":"RuntimeIOException","httpStatus":null,"severity":"critical","filePath":"core/src/main/java/org/apache/iceberg/SnapshotProducer.java","lineNumber":882,"sourceCode":"          manifest.path(),\n          manifest.length(),\n          manifest.partitionSpecId(),\n          ManifestContent.DATA,\n          manifest.sequenceNumber(),\n          manifest.minSequenceNumber(),\n          snapshotId,\n          stats.summaries(),\n          null,\n          addedFiles,\n          addedRows,\n          existingFiles,\n          existingRows,\n          deletedFiles,\n          deletedRows,\n          null);\n\n    } catch (IOException e) {\n      throw new RuntimeIOException(e, \"Failed to read manifest: %s\", manifest.path());\n    }\n  }\n\n  private static void updateTotal(\n      ImmutableMap.Builder<String, String> summaryBuilder,\n      Map<String, String> previousSummary,\n      String totalProperty,\n      Map<String, String> currentSummary,\n      String addedProperty,\n      String deletedProperty) {\n    String totalStr = previousSummary.get(totalProperty);\n    if (totalStr != null) {\n      try {\n        long newTotal = Long.parseLong(totalStr);\n\n        String addedStr = currentSummary.get(addedProperty);\n        if (newTotal >= 0 && addedStr != null) {\n          newTotal += Long.parseLong(addedStr);","sourceCodeStart":864,"sourceCodeEnd":900,"githubUrl":"https://github.com/apache/iceberg/blob/86d9c8fc543e7c56c9f624eb725f76c9baff9570/core/src/main/java/org/apache/iceberg/SnapshotProducer.java#L864-L900","documentation":"During commit, SnapshotProducer reads each existing manifest to build the new snapshot summary (tracking added/deleted files and rows). An IOException while opening/reading a manifest Avro file is rethrown as RuntimeIOException including the manifest's location. Usually the manifest file is missing, unreadable, or corrupt at its recorded path.","triggerScenarios":"commit()/apply() on a snapshot producer whose base table references manifests that cannot be read: manifest deleted externally, catalog/metadata moved, expired pre-signed access, truncated/corrupt Avro file, or wrong FileIO scheme for the manifest location.","commonSituations":"Manifests removed by an over-aggressive expireSnapshots/cleanup job or by hand; table cloned/copied between buckets without rewriting metadata; misconfigured FileIO (e.g., S3 credentials lost or region mismatch); network failure while streaming a manifest from object storage; metadata repair left dangling manifest paths.","solutions":["Check the manifest path in the error and verify the file exists and is readable via the table's FileIO.","Restore the manifest from the object store versioning/backup or re-register the table from a valid metadata version (metadata json with intact manifests).","Fix FileIO configuration (credentials, region, endpoint) if the cause indicates access/network errors.","If the manifest is unrecoverable, repair metadata (e.g., remove dangling entries via rewrite/commit tooling) rather than retrying reads."],"exampleFix":"// before\nTable table = catalog.loadTable(\"db.tbl\");\ntable.newFastAppend().appendFile(df).commit(); // Failed to read manifest: s3://old-bucket/.../avro\n// after\n// re-register the table at a metadata version whose manifests exist\nHadoopTables tables = new HadoopTables();\nTable repaired = tables.load(\"s3://bucket/db.tbl/metadata/00042-...metadata.json\");\nrepaired.newFastAppend().appendFile(df).commit();","handlingStrategy":"try-catch","validationCode":"// verify all current manifests are readable before attempting a commit\nfor (ManifestFile m : table.currentSnapshot().allManifests(table.io())) {\n  try (var r = ManifestFiles.read(m, table.io())) { /* readable */ }\n}","typeGuard":null,"tryCatchPattern":"try {\n  producer.commit();\n} catch (RuntimeIOException e) {\n  // message contains the manifest path; check existence before retry\n  String path = extractManifestPath(e.getMessage());\n  throw new IllegalStateException(\"Manifest unreadable at \" + path + \"; restore from backup\", e);\n}","preventionTips":["Never delete manifest files manually; only use expireSnapshots/orphan-file cleanup that respects metadata references.","Enable object-store versioning so manifests deleted by mistake are recoverable.","When copying tables between locations, use Iceberg tools (register/snapshot transfer) that rewrite metadata paths.","Validate manifests as part of metadata integrity checks before scheduling writes."],"tags":["io","manifest","read","corruption","runtime-io-exception"],"backgroundTag":"file-read-failed","analyzedSha":"86d9c8fc543e7c56c9f624eb725f76c9baff9570","analyzedAt":"2026-09-12T00:46:39.097Z","contentChangedAt":"2026-09-12T00:46:39.097Z","schemaVersion":2},"datasetVersion":"2026-09-14T16:17:12.679Z"}