{"record":{"id":"e5ea2b9995f3b7a0","repo":"apache/druid","slug":"failed-to-get-storage-slot-due-to-error-s","errorCode":null,"errorMessage":"Failed to get storage slot due to error [%s]","messagePattern":"Failed to get storage slot due to error \\[(.+?)\\]","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"indexing-service/src/main/java/org/apache/druid/indexing/overlord/ForkingTaskRunner.java","lineNumber":187,"sourceCode":"    synchronized (tasks) {\n      tasks.computeIfAbsent(\n          task.getId(), k ->\n          new ForkingTaskRunnerWorkItem(\n            task,\n            exec.submit(\n              new Callable<>() {\n                @Override\n                public TaskStatus call()\n                {\n                  final TaskStorageDirTracker.StorageSlot storageSlot;\n                  try {\n                    storageSlot = getTracker().pickStorageSlot(task.getId());\n                  }\n                  catch (RuntimeException e) {\n                    LOG.warn(e, \"Failed to get storage slot for task [%s], cannot schedule.\", task.getId());\n                    return TaskStatus.failure(\n                        task.getId(),\n                        StringUtils.format(\"Failed to get storage slot due to error [%s]\", e.getMessage())\n                    );\n                  }\n\n                  final File taskDir = new File(storageSlot.getDirectory(), task.getId());\n                  final String attemptId = String.valueOf(getNextAttemptID(taskDir));\n                  final File attemptDir = Paths.get(taskDir.getAbsolutePath(), \"attempt\", attemptId).toFile();\n\n                  final ProcessHolder processHolder;\n                  final String childHost = node.getHost();\n                  int childPort = -1;\n                  int tlsChildPort = -1;\n\n                  if (node.isEnablePlaintextPort()) {\n                    childPort = portFinder.findUnusedPort();\n                  }\n\n                  if (node.isEnableTlsPort()) {\n                    tlsChildPort = portFinder.findUnusedPort();","sourceCodeStart":169,"sourceCodeEnd":205,"githubUrl":"https://github.com/apache/druid/blob/9b90983fd291f26935af934383ce360473179e4d/indexing-service/src/main/java/org/apache/druid/indexing/overlord/ForkingTaskRunner.java#L169-L205","documentation":"The Overlord's ForkingTaskRunner could not obtain a storage slot from the TaskStorageSlotTracker when starting a task locally. The task is immediately marked failed with this message instead of being scheduled, and the underlying RuntimeException is logged as a warning.","triggerScenarios":"Calling taskRunner.run(task) (via TaskRunnerUtils/call) when pickStorageSlot(taskId) throws, e.g. no storage slot is available for the task or tracker lookup fails.","commonSituations":"Overlord running tasks in local/remote mode with exhausted or misconfigured storage slots; disk configuration issues (druid.indexer.storage) on middle managers; corrupted task state preventing slot pick.","solutions":["Inspect the Overlord/middleManager logs for the chained RuntimeException to find the root cause","Verify druid.indexer.storage type and directory settings (taskDir, storage slots) are correct and writable","Free disk space or clean stale task directories in the worker task storage location","Restart the middle manager/worker to rebuild the slot tracker if its state is inconsistent"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"// Before scheduling, ensure the runner reports the task as runnable and disk is healthy\nif (!taskRunner.getRunnerTaskWork().isEmpty() && taskDir.getParentFile().canWrite()) {\n  taskRunner.run(task);\n}","typeGuard":"boolean canSchedule = java.util.Optional.ofNullable(taskRunner.getRunnerTaskWork()).isPresent();","tryCatchPattern":"try { taskRunner.run(task); } catch (TaskStatus status) { /* inspect status.getErrorMsg() for 'Failed to get storage slot' and inspect worker storage config */ }","preventionTips":["Keep druid.indexer.storage directory writable and sized for max concurrent tasks","Monitor worker free disk space before task submission","Clean stale task directories regularly"],"tags":["task-scheduling","storage","overlord"],"backgroundTag":"internal-invariant-violation","analyzedSha":"9b90983fd291f26935af934383ce360473179e4d","analyzedAt":"2026-09-07T13:32:30.957Z","contentChangedAt":"2026-09-07T13:32:30.957Z","schemaVersion":2},"datasetVersion":"2026-09-17T15:17:12.973Z"}