{"record":{"id":"348e04c95efbba15","repo":"apache/iceberg","slug":"failed-to-close-manifest-entries-s","errorCode":null,"errorMessage":"Failed to close manifest entries: %s","messagePattern":"Failed to close manifest entries: (.+?)","errorType":"exception","errorClass":"RuntimeIOException","httpStatus":null,"severity":"error","filePath":"core/src/main/java/org/apache/iceberg/ManifestFilterManager.java","lineNumber":492,"sourceCode":"          ValidationException.check(\n              allRowsMatch || isDelete, // ignore delete files where some records may not match the\n              // expression\n              \"Cannot delete file where some, but not all, rows match filter %s: %s\",\n              this.deleteExpression,\n              file.location());\n\n          if (allRowsMatch) {\n            if (failAnyDelete) {\n              throw new DeleteException(reader.spec().partitionToPath(file.partition()));\n            }\n\n            // as soon as a deleted file is detected, stop scanning\n            return true;\n          }\n        }\n      }\n    } catch (IOException e) {\n      throw new RuntimeIOException(e, \"Failed to close manifest entries: %s\", manifest);\n    }\n\n    return false;\n  }\n\n  private boolean isDanglingDV(DeleteFile file) {\n    return ContentFileUtil.isDV(file) && removedDataFilePaths.contains(file.referencedDataFile());\n  }\n\n  @SuppressWarnings({\"CollectionUndefinedEquality\", \"checkstyle:CyclomaticComplexity\"})\n  private ManifestFile filterManifestWithDeletedFiles(\n      PartitionAndMetricsEvaluator evaluator, ManifestFile manifest, ManifestReader<F> reader) {\n    boolean isDelete = reader.isDeleteManifestReader();\n    // when this point is reached, there is at least one file that will be deleted in the\n    // manifest. produce a copy of the manifest with all deleted files removed.\n    Set<F> deletedFiles = newFileSet();\n    AtomicInteger duplicateDeleteCount = new AtomicInteger(0);\n","sourceCodeStart":474,"sourceCodeEnd":510,"githubUrl":"https://github.com/apache/iceberg/blob/86d9c8fc543e7c56c9f624eb725f76c9baff9570/core/src/main/java/org/apache/iceberg/ManifestFilterManager.java#L474-L510","documentation":"manifestHasDeletedFiles scans manifest entries to decide whether the manifest may contain files matching a delete expression. If the CloseableIterable of entries throws IOException while being consumed or closed, it is wrapped in this RuntimeIOException naming the manifest. The scan planning for the delete operation aborts.","triggerScenarios":"Calling filterManifest (via MergingSnapshotProducer) on a manifest whose entries cannot be read — corrupt manifest data file, missing manifest object in storage, or IO error while streaming entries.","commonSituations":"Manifests deleted externally (e.g. manual cleanup or aggressive lifecycle rules) before commit; corrupt AVRO manifests; storage read errors mid-scan; permission changes removing read access to old manifests.","solutions":["Verify the manifest file exists and is readable at its location","Restore the manifest if it was deleted by external cleanup processes","Check the wrapped cause for the precise storage error and fix permissions/connectivity"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"if (!io.newInputFile(manifest.location()).exists()) {\n  throw new IllegalStateException(\"Manifest missing before filter: \" + manifest.location());\n}","typeGuard":null,"tryCatchPattern":"try {\n  boolean hasDeletes = manifestHasDeletedFiles(manifest, ...);\n} catch (RuntimeIOException e) {\n  throw new IllegalStateException(\"Cannot read manifest entries: \" + manifest.location() + \"; check storage/permissions\", e);\n}","preventionTips":["Prevent external lifecycle policies from deleting active manifests","Validate manifest readability during planning, not just at commit","Monitor for missing-object errors on the warehouse bucket"],"tags":["io","file-read-failed","manifest-filter"],"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"}