apache/druid · error

Failed to stream task reports for task

Error message

Failed to stream task reports for task %s

What it means

The Overlord's task reports endpoint (GET /druid/indexer/v1/task/{id}/reports) hit an unexpected exception while fetching or streaming the task's reports. It logs the exception and returns HTTP 500 with no body.

Solutions

  1. Check Overlord logs for the full stack trace
  2. Verify task report storage config (druid.indexer.task.storage.type=local, storageDirectory) and permissions
  3. Confirm the task has actually completed and written reports before fetching
  4. Retry after the task finishes; re-run the query/task if reports were purged
Defensive patterns

Strategy: try-catch

Validate before calling

// Ensure task is complete before fetching reports
// status equals 'SUCCESS' from /druid/indexer/v1/task/{id}/status

Try / catch

try { streamReports(taskId); } catch (WebApplicationException e) { if (e.getResponse().getStatus() == 500) { /* inspect report storage dir; retry or re-run task */ } }

Prevention

When it happens

Trigger: GET /druid/indexer/v1/task/{taskid}/reports when TaskReportFileGetter or the task's report storage throws while reading reports.

Common situations: MSQ/async query reports not yet written or already cleaned up; report directory misconfigured (druid.indexer.task.storage.type or directory); permission problems on the report directory.

Understand the failure class

Background: "failed to read file", EACCES, ENOENT and "could not read <path>" errors: when a program can't read a file from disk — this error's family across 49 libraries.

Related errors


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

Appendix: source

Thrown at indexing-service/src/main/java/org/apache/druid/indexing/overlord/http/OverlordResource.java:827

  public Response doGetReports(
      @PathParam("taskid") final String taskid
  )
  {
    try {
      final Optional<InputStream> stream = taskLogStreamer.streamTaskReports(taskid);
      if (stream.isPresent()) {
        return Response.ok(stream.get()).build();
      } else {
        return Response.status(Response.Status.NOT_FOUND)
                       .entity(
                           "No task reports were found for this task. "
                           + "The task may not exist, or it may not have completed yet."
                       )
                       .build();
      }
    }
    catch (Exception e) {
      log.warn(e, "Failed to stream task reports for task %s", taskid);
      return Response.status(Response.Status.INTERNAL_SERVER_ERROR).build();
    }
  }

  private <T> Response asLeaderWith(Optional<T> x, Function<T, Response> f)
  {
    if (x.isPresent()) {
      return f.apply(x.get());
    } else {
      // Encourage client to try again soon, when we'll likely have a redirect set up
      return Response.status(Response.Status.SERVICE_UNAVAILABLE).build();
    }
  }

  @VisibleForTesting
  Set<ResourceAction> getNeededResourceActionsForTask(Task task) throws UOE
  {
    final Set<ResourceAction> resourceActions = new HashSet<>();

View on GitHub (pinned to 9b90983fd2)