{"record":{"id":"3163f41d64ceb45e","repo":"apache/druid","slug":"cannot-delete-all-segment-from-s3-deep-storage-sin","errorCode":null,"errorMessage":"Cannot delete all segment from S3 Deep Storage since druid.storage.bucket and druid.storage.baseKey are not both set.","messagePattern":"Cannot delete all segment from S3 Deep Storage since druid\\.storage\\.bucket and druid\\.storage\\.baseKey are not both set\\.","errorType":"exception","errorClass":"IllegalStateException (ISE)","httpStatus":null,"severity":"error","filePath":"extensions-core/s3-extensions/src/main/java/org/apache/druid/storage/s3/S3DataSegmentKiller.java","lineNumber":216,"sourceCode":"        }\n        // descriptor.json is a file to store segment metadata in deep storage. This file is deprecated and not stored\n        // anymore, but we still delete them if exists.\n        if (s3Client.doesObjectExist(s3Bucket, s3DescriptorPath)) {\n          log.info(\"Removing descriptor file[s3://%s/%s] from s3!\", s3Bucket, s3DescriptorPath);\n          s3Client.deleteObject(s3Bucket, s3DescriptorPath);\n        }\n      }\n    }\n    catch (S3Exception e) {\n      throw new SegmentLoadingException(e, \"Couldn't kill segment[%s]: [%s]\", segment.getId(), e);\n    }\n  }\n\n  @Override\n  public void killAll() throws IOException\n  {\n    if (segmentPusherConfig.getBucket() == null || segmentPusherConfig.getBaseKey() == null) {\n      throw new ISE(\n          \"Cannot delete all segment from S3 Deep Storage since druid.storage.bucket and druid.storage.baseKey are not both set.\");\n    }\n    log.info(\"Deleting all segment files from s3 location [bucket: '%s' prefix: '%s']\",\n             segmentPusherConfig.getBucket(), segmentPusherConfig.getBaseKey()\n    );\n    try {\n      S3Utils.deleteObjectsInPath(\n          s3ClientSupplier.get(),\n          inputDataConfig.getMaxListingLength(),\n          segmentPusherConfig.getBucket(),\n          segmentPusherConfig.getBaseKey(),\n          Predicates.alwaysTrue()\n      );\n    }\n    catch (Exception e) {\n      log.error(\"Error occurred while deleting segment files from s3. Error: %s\", e.getMessage());\n      throw new IOException(e);\n    }","sourceCodeStart":198,"sourceCodeEnd":234,"githubUrl":"https://github.com/apache/druid/blob/9b90983fd291f26935af934383ce360473179e4d/extensions-core/s3-extensions/src/main/java/org/apache/druid/storage/s3/S3DataSegmentKiller.java#L198-L234","documentation":"killAll() wipes every segment under druid.storage.baseKey, so it requires both druid.storage.bucket and druid.storage.baseKey to be configured; if either is null it throws this ISE rather than deleting from an unbounded location.","triggerScenarios":"Calling the killAll supervision API (drop-all segments) when segmentPusherConfig.getBucket() or getBaseKey() is null, i.e. neither property is set in the coordinator/runtime config.","commonSituations":"Deployment uses s3-compatible config properties (env vars) instead of druid.storage.bucket/baseKey, or killAll invoked in a setup where only a specific bucket config exists.","solutions":["Set both druid.storage.bucket and druid.storage.baseKey in the runtime properties of the services that run kill tasks.","If properties are set via environment variables, confirm they are exported to the process and not shadowed by other config styles.","Only invoke killAll when full deep-storage wipe is intended; otherwise kill individual segments."],"exampleFix":"// before (runtime.properties)\n// (missing)\n// after\ndruid.storage.bucket=my-druid-bucket\ndruid.storage.baseKey=druid/segments","handlingStrategy":"validation","validationCode":"// before invoking killAll, validate config\nif (config.getBucket() == null || config.getBaseKey() == null) {\n  throw new IllegalArgumentException(\"Set druid.storage.bucket and druid.storage.baseKey before killAll\");\n}","typeGuard":null,"tryCatchPattern":"try { killer.killAll(); } catch (ISE e) { fixRuntimeProperties(); }","preventionTips":["Set druid.storage.bucket and druid.storage.baseKey in every service's runtime.properties","Verify env-var-based configs are actually exported to the JVM","Never call killAll without confirming the target prefix"],"tags":["config","s3","missing-property","kill-all"],"backgroundTag":"missing-required-config-field","analyzedSha":"9b90983fd291f26935af934383ce360473179e4d","analyzedAt":"2026-09-07T13:32:30.957Z","contentChangedAt":"2026-09-07T13:32:30.957Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}