apache/druid · error

Failed to get storage slot due to error

Error message

Failed to get storage slot due to error [%s]

What it means

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.

Solutions

  1. Inspect the Overlord/middleManager logs for the chained RuntimeException to find the root cause
  2. Verify druid.indexer.storage type and directory settings (taskDir, storage slots) are correct and writable
  3. Free disk space or clean stale task directories in the worker task storage location
  4. Restart the middle manager/worker to rebuild the slot tracker if its state is inconsistent
Defensive patterns

Strategy: try-catch

Validate before calling

// Before scheduling, ensure the runner reports the task as runnable and disk is healthy
if (!taskRunner.getRunnerTaskWork().isEmpty() && taskDir.getParentFile().canWrite()) {
  taskRunner.run(task);
}

Type guard

boolean canSchedule = java.util.Optional.ofNullable(taskRunner.getRunnerTaskWork()).isPresent();

Try / catch

try { taskRunner.run(task); } catch (TaskStatus status) { /* inspect status.getErrorMsg() for 'Failed to get storage slot' and inspect worker storage config */ }

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Understand the failure class

Background: "This is a bug, please report it": internal invariant violations, unreachable panics, and SNH errors explained — this error's family across 47 libraries.

Related errors


AI-assisted analysis of apache/druid@9b90983fd2 (2026-09-07). Data as JSON: /api/errors/e5ea2b9995f3b7a0. Report an issue: GitHub.

Appendix: source

Thrown at indexing-service/src/main/java/org/apache/druid/indexing/overlord/ForkingTaskRunner.java:187

    synchronized (tasks) {
      tasks.computeIfAbsent(
          task.getId(), k ->
          new ForkingTaskRunnerWorkItem(
            task,
            exec.submit(
              new Callable<>() {
                @Override
                public TaskStatus call()
                {
                  final TaskStorageDirTracker.StorageSlot storageSlot;
                  try {
                    storageSlot = getTracker().pickStorageSlot(task.getId());
                  }
                  catch (RuntimeException e) {
                    LOG.warn(e, "Failed to get storage slot for task [%s], cannot schedule.", task.getId());
                    return TaskStatus.failure(
                        task.getId(),
                        StringUtils.format("Failed to get storage slot due to error [%s]", e.getMessage())
                    );
                  }

                  final File taskDir = new File(storageSlot.getDirectory(), task.getId());
                  final String attemptId = String.valueOf(getNextAttemptID(taskDir));
                  final File attemptDir = Paths.get(taskDir.getAbsolutePath(), "attempt", attemptId).toFile();

                  final ProcessHolder processHolder;
                  final String childHost = node.getHost();
                  int childPort = -1;
                  int tlsChildPort = -1;

                  if (node.isEnablePlaintextPort()) {
                    childPort = portFinder.findUnusedPort();
                  }

                  if (node.isEnableTlsPort()) {
                    tlsChildPort = portFinder.findUnusedPort();

View on GitHub (pinned to 9b90983fd2)