apache/druid · error · SegmentLoadingException

e.getMessage()

Error message

e.getMessage()

What it means

In AzureDataSegmentPuller.getSegmentFiles, when downloading and unzipping a segment from Azure fails, the original exception (ExceptionUtils.AzureTaskOffsetException-adjacent handling aside) is rethrown as a SegmentLoadingException whose message is simply e.getMessage(). It tells you the pull/unzip of the segment to local disk failed; the cause carries the real error.

Source

Thrown at extensions-core/azure-extensions/src/main/java/org/apache/druid/storage/azure/AzureDataSegmentPuller.java:96

          false
      );

      log.info("Loaded %d bytes from [%s] to [%s]", result.size(), actualBlobPath, outDir.getAbsolutePath());
      return result;
    }
    catch (IOException e) {
      try {
        FileUtils.deleteDirectory(outDir);
      }
      catch (IOException ioe) {
        log.warn(
            ioe,
            "Failed to remove output directory [%s] for segment pulled from [%s]",
            outDir.getAbsolutePath(),
            blobPath
        );
      }
      throw new SegmentLoadingException(e, e.getMessage());
    }
  }
}

View on GitHub (pinned to 9b90983fd2)

Solutions

  1. Check getCause() of the SegmentLoadingException for the underlying Azure/unzip error
  2. Verify the segment exists at the blob path in the configured container
  3. Re-download by restarting the historical segment load; if the zip is corrupt, re-push the segment
  4. Confirm credentials have read (list/get) permissions

Example fix

// before
throw new SegmentLoadingException(e, e.getMessage());
// after
throw new SegmentLoadingException(e, "Failed to pull segment[%s] from Azure", blobPath);
Defensive patterns

Strategy: try-catch

Validate before calling

// check blob exists before pulling
if (!azureStorage.objectExists(container, blobPath)) throw new FileNotFoundException(blobPath);

Try / catch

try { files = puller.getSegmentFiles(descriptor); } catch (SegmentLoadingException e) { log.error("Pull failed for %s: %s", descriptor, e.getCause()); cleanUpOutDir(); }

Prevention

When it happens

Trigger: getSegmentFiles catches a failure while pulling the segment blob from Azure (download error, corrupt/missing zip, permissions, missing blob) and wraps it with message e.getMessage().

Common situations: Segment blob deleted from Azure while a historical loads it; corrupted or partially uploaded segment zips; wrong container/prefix config on historicals; transient network failures.

Understand the failure class

Background: 'Something went wrong' / 'Request failed (500)' / 'HTTP error! status: 404' — what failed HTTP requests actually mean and how to find the real cause — this error's family across 28 libraries.

Related errors


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