{"record":{"id":"98640ee15593dbbe","repo":"apache/hadoop","slug":"failed-to-write-manifest-data-for-task-taskid-to","errorCode":null,"errorMessage":"Failed to write manifest data for task {taskId}to local file","messagePattern":"Failed to write manifest data for task (.+?)to local file","errorType":"exception","errorClass":"EntryWriteException","httpStatus":null,"severity":"error","filePath":"hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-core/src/main/java/org/apache/hadoop/mapreduce/lib/output/committer/manifest/stages/LoadManifestsStage.java","lineNumber":213,"sourceCode":"    final String attemptID = manifest.getTaskAttemptID();\n    LOG.debug(\"{}: task attempt {} added {} directories\",\n        getName(), attemptID, created);\n\n    // add to the summary.\n    summaryInfo.add(manifest);\n\n    // clear the manifest extra data so if\n    // blocked waiting for queue capacity,\n    // memory use is reduced.\n    manifest.setIOStatistics(null);\n    manifest.getExtraData().clear();\n\n    // queue those files.\n    final boolean enqueued = entryWriter.enqueue(manifest.getFilesToCommit());\n    if (!enqueued) {\n      LOG.warn(\"{}: Failed to write manifest for task {}\",\n          getName(), attemptID);\n      throw new EntryWriteException(attemptID);\n    }\n\n  }\n\n  /**\n   * Coalesce all directories and clear the entry in the manifest.\n   * There's only ever one writer at a time, which it is hoped reduces\n   * contention. before the lock is acquired: if there are no new directories,\n   * the write lock is never needed.\n   * @param manifest manifest to process\n   * @return the number of directories created;\n   */\n  @VisibleForTesting\n  int coalesceDirectories(final TaskManifest manifest) {\n\n    // build a list of dirs to create.\n    // this scans the map\n    final List<DirEntry> toCreate = manifest.getDestDirectories().stream()","sourceCodeStart":195,"sourceCodeEnd":231,"githubUrl":"https://github.com/apache/hadoop/blob/2add9630210752f88ceb1bb74eb65e37bf41da8e/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-core/src/main/java/org/apache/hadoop/mapreduce/lib/output/committer/manifest/stages/LoadManifestsStage.java#L195-L231","documentation":"During job commit, LoadManifestsStage streams every manifest's file entries into a local entry sequence file through a bounded queue writer. EntryWriteException('Failed to write manifest data for task <id>to local file') is thrown when EntryWriter.enqueue() returns false - the queue is full and the writer thread is not draining it, classically because the local disk holding the entry sequence file is full or the writer thread has already failed and stopped consuming. The job commit aborts at the AM.","triggerScenarios":"entryWriter.enqueue(manifest.getFilesToCommit()) returning false during LoadManifestsStage: local scratch disk exhausted where the entry sequence file is written, the writer thread terminated after an earlier IO error, or a task with an enormous file list flooding the bounded queue after the writer stalled.","commonSituations":"Jobs producing millions of small files so the local entry sequence file grows huge; small or shared local disks on the AM node; yarn.nodemanager.local.dirs filling up; earlier local write errors visible higher in the logs before this failure.","solutions":["Check free space on the AM node's local filesystem (where the entry sequence file lives) and free/extend it.","Scan the commit logs above this exception for the writer thread's original error - this exception is often the symptom, not the cause.","Reduce file counts (fewer, larger output files; fewer reduce tasks writing many small partitions) so manifests are smaller.","After freeing space, rerun the job; commit-time local state is rebuilt from the task manifests."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"// before submit: ensure the local filesystem has room for the entry sequence file\nFile localDir = new File(conf.get(\"yarn.app.mapreduce.am.stagingDir\", \"/tmp\"));\nlong usable = localDir.getUsableSpace();\nif (usable < MIN_FREE_BYTES) { // scale with expected file count, e.g. 100 bytes/file\n  throw new IOException(\"Insufficient local disk (\" + usable + \" bytes) for manifest commit\");\n}","typeGuard":null,"tryCatchPattern":"try {\n  boolean ok = job.waitForCompletion(true);\n} catch (IOException e) {\n  if (e.getClass().getSimpleName().equals(\"EntryWriteException\")) {\n    // local-side failure at commit: free local disk, reduce output file count, rerun\n  }\n}","preventionTips":["Monitor free space on AM local disks; size scratch for the job's total file-entry volume.","Consolidate output into fewer, larger files to shrink the entry sequence file and queue pressure.","On failure, check earlier writer-thread errors in the logs before resubmitting."],"tags":["hadoop","manifest-committer","local-disk","disk-full","job-commit","queue"],"backgroundTag":"disk-space-exhausted","analyzedSha":"2add9630210752f88ceb1bb74eb65e37bf41da8e","analyzedAt":"2026-08-22T19:55:07.957Z","schemaVersion":2},"datasetVersion":"2026-08-23T01:17:44.959Z"}