apache/druid · error · IOException

IOException wrapping underlying cause

Error message

IOException wrapping underlying cause

What it means

After a failure while listing and deleting all segment blobs in killAll(), the error is logged and rethrown as an IOException wrapping the original exception. This preserves the cause chain for callers expecting IOException from the DataSegmentKiller interface.

Source

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

    log.info(
        "Deleting all segment files from Azure storage location [bucket: '%s' prefix: '%s']",
        segmentConfig.getContainer(),
        segmentConfig.getPrefix()
    );
    try {
      AzureUtils.deleteObjectsInPath(
          azureStorage,
          inputDataConfig,
          accountConfig,
          azureCloudBlobIterableFactory,
          segmentConfig.getContainer(),
          segmentConfig.getPrefix(),
          Predicates.alwaysTrue()
      );
    }
    catch (Exception e) {
      log.error("Error occurred while deleting segment files from Azure. Error: %s", e.getMessage());
      throw new IOException(e);
    }
  }
}

View on GitHub (pinned to 9b90983fd2)

Solutions

  1. Inspect the logged "Error occurred while deleting segment files from Azure" line and its cause for the Azure SDK error
  2. Fix the underlying auth/permission/network issue and retry killAll
  3. Wrap the call site in try/catch IOException and surface getCause() for diagnosis

Example fix

// before
try { killer.killAll(); } catch (IOException e) { log.error(e.getMessage()); }
// after
try { killer.killAll(); } catch (IOException e) {
  throw new RuntimeException("killAll failed", e.getCause()); // preserve Azure cause
}
Defensive patterns

Strategy: try-catch

Validate before calling

try { azureStorage.listAzureStorageObjects(container, prefix, 1); } catch (Exception e) { throw new IllegalStateException("Azure not reachable/authorized: " + e.getMessage()); }

Try / catch

try { killer.killAll(); } catch (IOException e) { Throwable root = e.getCause(); log.error("killAll root cause: %s", root, root); }

Prevention

When it happens

Trigger: azureStorage.listAzureStorageObjects (or the delete of each blob) throws any Exception during killAll: auth failure, network error, throttling, or permission denial while enumerating/purging container contents.

Common situations: Container credentials lacking list/delete rights; transient Azure errors during large purges; container deleted mid-operation.

Understand the failure class

Background: "failed to write file", "Could not save figure", "Error saving remote file" — file write failed: causes and fixes across languages and libraries — this error's family across 38 libraries.

Related errors


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