{"record":{"id":"f01f40ae861aff51","repo":"apache/iceberg","slug":"failed-to-close-manifest-list-s-f01f40","errorCode":null,"errorMessage":"Failed to close manifest list: %s","messagePattern":"Failed to close manifest list: (.+?)","errorType":"exception","errorClass":"RuntimeIOException","httpStatus":null,"severity":"error","filePath":"core/src/main/java/org/apache/iceberg/ReachableFileCleanup.java","lineNumber":136,"sourceCode":"        .throwFailureWhenFinished()\n        .executeWith(planExecutorService)\n        .onFailure(\n            (snapshot, exc) ->\n                LOG.warn(\n                    \"Failed to determine manifests for snapshot {}\", snapshot.snapshotId(), exc))\n        .run(\n            snapshot -> {\n              try (CloseableIterable<ManifestFile> manifestFiles = readManifests(snapshot)) {\n                for (ManifestFile manifestFile : manifestFiles) {\n                  candidateSet.remove(manifestFile);\n                  if (candidateSet.isEmpty()) {\n                    return;\n                  }\n\n                  currentManifestCallback.accept(manifestFile.copy());\n                }\n              } catch (IOException e) {\n                throw new RuntimeIOException(\n                    e, \"Failed to close manifest list: %s\", snapshot.manifestListLocation());\n              }\n            });\n\n    return candidateSet;\n  }\n\n  private Set<ManifestFile> readManifests(Set<Snapshot> snapshots) {\n    Set<ManifestFile> manifestFiles = ConcurrentHashMap.newKeySet();\n    Tasks.foreach(snapshots)\n        .retry(3)\n        .stopOnFailure()\n        .throwFailureWhenFinished()\n        .executeWith(planExecutorService)\n        .onFailure(\n            (snapshot, exc) ->\n                LOG.warn(\n                    \"Failed to determine manifests for snapshot {}\", snapshot.snapshotId(), exc))","sourceCodeStart":118,"sourceCodeEnd":154,"githubUrl":"https://github.com/apache/iceberg/blob/86d9c8fc543e7c56c9f624eb725f76c9baff9570/core/src/main/java/org/apache/iceberg/ReachableFileCleanup.java#L118-L154","documentation":"During expireSnapshots cleanup, ReachableFileCleanup.pruneReferencedManifests reads each snapshot's manifest list and wraps it in a CloseableIterable. If closing that iterable raises an IOException, it is rethrown as RuntimeIOException naming the manifest list location. The failure is an I/O problem on the manifest list file.","triggerScenarios":"expireSnapshots with file cleanup where closing the manifest-list reader of a snapshot throws IOException — typically underlying FileIO errors such as unavailable storage, network failure, or corrupted/unreadable manifest list object.","commonSituations":"Object-store throttling or connectivity drops during snapshot expiration; missing/corrupted manifest list files (deleted externally or failed prior write); credential/permission problems on the warehouse path.","solutions":["Verify the manifest list files are readable and the storage backend is healthy, then retry expireSnapshots","Check FileIO credentials/permissions and network stability to the object store","If files were externally deleted, restore consistency (e.g. re-register the table or repair metadata) before cleanup"],"exampleFix":"// before\nexpireSnapshots(table).cleanExpiredFiles(true).execute();\n// after\ntry {\n  expireSnapshots(table).cleanExpiredFiles(true).execute();\n} catch (RuntimeIOException e) {\n  LOG.error(\"Manifest list I/O failure during cleanup: {}\", e.getMessage());\n  // check storage health/credentials, then retry\n}","handlingStrategy":"try-catch","validationCode":"// verify the manifest list is readable before expiration\nio.newInputFile(snapshot.manifestListLocation()).exists();","typeGuard":null,"tryCatchPattern":"try {\n  expireSnapshots(table).cleanExpiredFiles(true).execute();\n} catch (RuntimeIOException e) {\n  // inspect e.getMessage() for the manifest list location; check storage health, then retry\n}","preventionTips":["Ensure stable connectivity to the object store before long expiration jobs","Avoid external lifecycle rules deleting metadata objects","Validate FileIO credentials and permissions pre-run","Retry transient object-store failures with backoff"],"tags":["iceberg","io","snapshot-expiration"],"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"}