apache/iceberg · warning
Deleted only of file(s) ( )
Error message
Deleted only {} of {} file(s) ({}) What it means
After SparkCleanupUtil.deleteFiles finishes, it compares the successfully deleted count against the requested path count. If some deletions failed (each logged individually), it warns that only a portion of the files were removed. Table data integrity is unaffected — these are uncommitted/abort-time files — but storage may accumulate leftovers.
Solutions
- Inspect per-file warnings emitted earlier for the failed paths.
- Run remove_orphan_files later to sweep leftover files.
- Fix underlying storage issues (quota, credentials, throttling) before rerunning workloads that abort frequently.
Defensive patterns
Strategy: fallback
Prevention
- Schedule periodic remove_orphan_files to reclaim partially-deleted files.
- Watch for recurring partial deletions — usually throttling or permission drift.
- Ensure bucket quotas/limits accommodate parallel delete bursts.
When it happens
Trigger: One or more delete calls in the parallel Tasks.foreach failed (or IOException escaped io.deleteFile for some paths), so deletedFilesCount < paths.size() after retries.
Common situations: Partial object-store throttling during large abort cleanups; permission changes mid-job; expired sessions on a subset of workers.
Understand the failure class
Background: "failed to write file", "Could not save figure", "Error saving remote file" — file write failed: causes and fixes across languages and libraries — this error's family across 38 libraries.
Related errors
- Failed to delete ( )
- Deleted only of file(s) ( )
- Failed to delete path
- Failed to delete uncommitted DV
- An error occurred closing catalog instance, ignoring...
AI-assisted analysis of apache/iceberg@86d9c8fc54 (2026-09-12).
Data as JSON: /api/errors/d56355cd0186a117.
Report an issue: GitHub.
Appendix: source
Thrown at spark/v4.0/spark/src/main/java/org/apache/iceberg/spark/source/SparkCleanupUtil.java:115
Tasks.foreach(paths)
.executeWith(ThreadPools.getWorkerPool())
.stopRetryOn(NotFoundException.class)
.suppressFailureWhenFinished()
.onFailure((path, exc) -> LOG.warn("Failed to delete {} ({})", path, context, exc))
.retry(DELETE_NUM_RETRIES)
.exponentialBackoff(
DELETE_MIN_RETRY_WAIT_MS,
DELETE_MAX_RETRY_WAIT_MS,
DELETE_TOTAL_RETRY_TIME_MS,
2 /* exponential */)
.run(
path -> {
io.deleteFile(path);
deletedFilesCount.incrementAndGet();
});
if (deletedFilesCount.get() < paths.size()) {
LOG.warn("Deleted only {} of {} file(s) ({})", deletedFilesCount, paths.size(), context);
} else {
LOG.info("Deleted {} file(s) ({})", paths.size(), context);
}
}
}
View on GitHub (pinned to 86d9c8fc54)