{"record":{"id":"e3f5af375a01f122","repo":"apache/druid","slug":"could-not-create-temp-distribution-directory","errorCode":null,"errorMessage":"Could not create temp distribution directory.","messagePattern":"Could not create temp distribution directory\\.","errorType":"exception","errorClass":"IllegalStateException","httpStatus":null,"severity":"error","filePath":"indexing-service/src/main/java/org/apache/druid/indexing/common/task/batch/parallel/PartialDimensionDistributionParallelIndexTaskRunner.java","lineNumber":266,"sourceCode":"    try {\n      allReportsProcessedPhaser.arriveAndAwaitAdvance();\n      executor.shutdownNow();\n    }\n    catch (Exception e) {\n      throw new ISE(e, \"Exception while waiting to extract distributions.\");\n    }\n  }\n\n  private File createDistributionsDir()\n  {\n    File taskTempDir = getToolbox().getConfig().getTaskTempDir(getTaskId());\n    File distributionsDir = new File(taskTempDir, \"dimension_distributions\");\n    try {\n      FileUtils.mkdirp(distributionsDir);\n      return distributionsDir;\n    }\n    catch (IOException e) {\n      throw new ISE(e, \"Could not create temp distribution directory.\");\n    }\n  }\n\n  private void cleanupDistributionsDir()\n  {\n    try {\n      FileUtils.deleteDirectory(tempDistributionsDir);\n    }\n    catch (IOException e) {\n      log.warn(e, \"Could not delete temp distribution directory.\");\n    }\n  }\n\n  private String toIntervalString(Interval interval)\n  {\n    return\n        new DateTime(interval.getStartMillis(), interval.getChronology())\n        + \"_\"","sourceCodeStart":248,"sourceCodeEnd":284,"githubUrl":"https://github.com/apache/druid/blob/9b90983fd291f26935af934383ce360473179e4d/indexing-service/src/main/java/org/apache/druid/indexing/common/task/batch/parallel/PartialDimensionDistributionParallelIndexTaskRunner.java#L248-L284","documentation":"Before collecting sub-task distributions, the runner creates a 'dimension_distributions' directory under the task's temp dir. Failure to create it (IOException from FileUtils.mkdirp) is wrapped in this ISE.","triggerScenarios":"mkdirp fails because the parent task temp dir is not writable, the path exists as a regular file, or the disk/filesystem is full or read-only.","commonSituations":"Wrong permissions on druid.indexer.task.baseTaskDir; running workers as a different user after an upgrade; disk full on the worker node; a stale file occupying the directory path.","solutions":["Check permissions and ownership of the task base dir (druid.indexer.task.baseTaskDir) for the worker user.","Free disk space or remount the volume if it is full or read-only.","Remove any stale file at the <taskTempDir>/dimension_distributions path and retry."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"// before starting tasks\nFile base = new File(baseTaskDirPath);\nif (!base.isDirectory() || !base.canWrite()) {\n  throw new IllegalStateException(\"Task base dir missing or not writable: \" + base);\n}","typeGuard":null,"tryCatchPattern":"catch (IllegalStateException e) { if (e.getMessage().contains(\"Could not create temp distribution directory\")) { checkPermissionsAndDisk(baseTaskDir); } else { throw e; } }","preventionTips":["Ensure the worker user owns or can write druid.indexer.task.baseTaskDir.","Monitor free space on the task volume.","After user/permission changes on workers, smoke-test a small batch task."],"tags":["druid","filesystem","mkdir","permissions"],"backgroundTag":"mkdir-permission-denied","analyzedSha":"9b90983fd291f26935af934383ce360473179e4d","analyzedAt":"2026-09-07T13:32:30.957Z","contentChangedAt":"2026-09-07T13:32:30.957Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}