{"record":{"id":"aaa857b143e07459","repo":"apache/iceberg","slug":"runtimeioexception","errorCode":null,"errorMessage":"RuntimeIOException","messagePattern":"RuntimeIOException","errorType":"exception","errorClass":"RuntimeIOException","httpStatus":null,"severity":"error","filePath":"core/src/main/java/org/apache/iceberg/BaseRewriteManifests.java","lineNumber":269,"sourceCode":"              manifest -> {\n                if (containsDeletes(manifest) || !matchesPredicate(manifest)) {\n                  keptManifests.add(manifest);\n                } else {\n                  rewrittenManifests.add(manifest);\n                  try (ManifestReader<DataFile> reader =\n                      ManifestFiles.read(manifest, ops().io(), ops().current().specsById())\n                          .select(Collections.singletonList(\"*\"))) {\n                    reader\n                        .liveEntries()\n                        .forEach(\n                            entry ->\n                                appendEntry(\n                                    entry,\n                                    clusterByFunc.apply(entry.file()),\n                                    manifest.partitionSpecId()));\n\n                  } catch (IOException x) {\n                    throw new RuntimeIOException(x);\n                  }\n                }\n              });\n    } finally {\n      Tasks.foreach(writers.values()).executeWith(workerPool()).run(WriterWrapper::close);\n    }\n  }\n\n  private boolean containsDeletes(ManifestFile manifest) {\n    return manifest.content() == ManifestContent.DELETES;\n  }\n\n  private boolean matchesPredicate(ManifestFile manifest) {\n    return predicate == null || predicate.test(manifest);\n  }\n\n  private void validateDeletedManifests(\n      Set<ManifestFile> currentManifests, long currentSnapshotID) {","sourceCodeStart":251,"sourceCodeEnd":287,"githubUrl":"https://github.com/apache/iceberg/blob/86d9c8fc543e7c56c9f624eb725f76c9baff9570/core/src/main/java/org/apache/iceberg/BaseRewriteManifests.java#L251-L287","documentation":"During BaseRewriteManifests.apply(), entries are appended to new manifest writers on worker threads. Any underlying IOException while writing a manifest is wrapped in RuntimeIOException, which aborts the rewrite with this unchecked exception.","triggerScenarios":"An IOException occurs while writing new manifest files during a rewriteManifests() commit — disk full, permission denied, transient metadata-IO failure on the FileIO backend, or a broken connection to object storage.","commonSituations":"HDFS/S3 outages or throttling during large manifest rewrites; insufficient permissions on the metadata directory; disk-quota exhaustion on the warehouse volume.","solutions":["Inspect the cause (getCause()) to find the real IOException and fix storage access (permissions, quota, connectivity).","Retry the rewriteManifests() operation once storage is healthy — the operation is safe to rerun.","Verify the FileIO's warehouse/metadata location is writable and has free space.","Reduce rewrite concurrency (smaller worker pool) if object storage is throttling requests."],"exampleFix":"// handling\ntry {\n  table.rewriteManifests().clusterBy(f -> f.partition()).commit();\n} catch (RuntimeIOException e) {\n  LOG.error(\"Manifest rewrite failed: {}\", e.getCause(), e);\n  // fix storage issue, then retry\n}","handlingStrategy":"try-catch","validationCode":"// pre-check the metadata location is writable\nboolean writable = table.io() instanceof SupportsBulkOperations\n    ? canWrite(table.io(), table.location() + \"/metadata\")\n    : true;","typeGuard":null,"tryCatchPattern":"try {\n  table.rewriteManifests().clusterBy(f -> f.partition()).commit();\n} catch (RuntimeIOException e) {\n  LOG.error(\"Manifest write failed: {}\", e.getCause(), e);\n  // remediate storage (space/permissions/connectivity) and retry\n}","preventionTips":["Monitor disk/object-store capacity before large rewrites","Verify metadata-directory write permissions for the job's service account","Handle object-storage throttling by limiting worker pool size","Inspect getCause() of RuntimeIOException to find the root IOException"],"tags":["io","manifest-rewrite","storage","iceberg"],"backgroundTag":"file-write-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"}