apache/druid · warning
Unexpected exception occurred when deleting from container [
Error message
Unexpected exception occurred when deleting from container [%s], the following keys [%s]
What it means
AzureStorage.batchDeleteFiles() catches any unexpected Exception (beyond the Azure-specific blob batch exceptions) during a chunked batch delete, sets hadException, and logs this warning. The generic catch exists so one unexpected client error does not abort the whole deletion loop; a StorageException is thrown at the end because hadException is set.
Source
Thrown at extensions-core/azure-extensions/src/main/java/org/apache/druid/storage/azure/AzureStorage.java:298
// We have to call forEach on the response because this is the only way azure batch will throw an exception on an operation failure.
blobBatchClient.deleteBlobs(chunkOfKeys, DeleteSnapshotsOptionType.INCLUDE).forEach(response -> LOG.debug(
"Deleting blob with URL %s completed with status code %d%n",
response.getRequest().getUrl(),
response.getStatusCode()
));
}
catch (BlobStorageException | BlobBatchStorageException e) {
hadException = true;
LOG.noStackTrace().warn(
e,
"Unable to delete from container [%s], the following keys [%s]",
containerName,
chunkOfKeys
);
}
catch (Exception e) {
hadException = true;
LOG.noStackTrace().warn(
e,
"Unexpected exception occurred when deleting from container [%s], the following keys [%s]",
containerName,
chunkOfKeys
);
}
}
return !hadException;
}
/**
* See {@link AzureStorage#getBlockBlobExists(String, String, Integer)} for details.
*/
public boolean getBlockBlobExists(final String container, final String blobName) throws BlobStorageException
{
return getBlockBlobExists(container, blobName, null);
}View on GitHub (pinned to 9b90983fd2)
Solutions
- Check the logged stack trace for the unexpected exception's root cause
- Verify Azure SDK dependency versions match the Druid extension's expectations (no shaded-jar conflicts)
- Retry the deletion — batches are idempotent
- If a specific key always triggers it, delete that key individually to isolate it
- Report persistent SDK-level failures with the exception stack to the Druid community
Defensive patterns
Strategy: retry
Validate before calling
// pin the correct azure-storage-blob version on the classpath mvn dependency:tree | grep azure-storage-blob
Try / catch
try {
storage.batchDeleteFiles(container, keys);
} catch (StorageException e) {
log.error(e, "batch delete failed; see prior warnings for failing key chunk");
retryWithBackoff(() -> storage.batchDeleteFiles(container, keys));
} Prevention
- Keep Azure SDK dependencies aligned with the Druid extension version
- Delete suspicious keys individually to isolate batch failures
- Capture the warning's key chunk for targeted retries
- Report reproducible SDK exceptions upstream
When it happens
Trigger: Any non-BlobStorageException runtime error thrown by the Azure SDK (e.g., IllegalStateException from the batch builder, deserialization issues in responses, or an unexpected SDK bug) while deleting a chunk of keys.
Common situations: Incompatible azure-storage-blob SDK versions on the classpath; batch containing malformed keys; client-side bugs or OOM during large batch assembly.
Related errors
- No files were deleted on the following Azure path: [%s]
- Unable to delete from container [%s], the following keys [%s
- IOException wrapping underlying cause
- Failed to remove output directory [%s] for segment pulled fr
- Recoverable exception
AI-assisted analysis of apache/druid@9b90983fd2 (2026-09-07).
Data as JSON: /api/errors/5d4c63decf5b0785.
Report an issue: GitHub.