{"record":{"id":"1f4b6077f66bb1bc","repo":"apache/druid","slug":"target-s3-bucket-is-not-specified","errorCode":null,"errorMessage":"Target S3 bucket is not specified","messagePattern":"Target S3 bucket is not specified","errorType":"exception","errorClass":"SegmentLoadingException","httpStatus":null,"severity":"error","filePath":"extensions-core/s3-extensions/src/main/java/org/apache/druid/storage/s3/S3DataSegmentMover.java","lineNumber":97,"sourceCode":"      final String targetS3Bucket = MapUtils.getString(targetLoadSpec, \"bucket\");\n      final String targetS3BaseKey = MapUtils.getString(targetLoadSpec, \"baseKey\");\n      final String targetS3Path;\n\n      if (s3Path.endsWith(\"/\")) {\n        // segment is not compressed, list objects and move them all\n        ListObjectsV2Request request = ListObjectsV2Request.builder()\n            .bucket(s3Bucket)\n            .prefix(s3Path + \"/\")\n            .build();\n        final ListObjectsV2Response list = s3ClientSupplier.get().listObjectsV2(request);\n        targetS3Path = S3Utils.constructSegmentBasePath(\n            targetS3BaseKey,\n            DataSegmentPusher.getDefaultStorageDir(segment, false)\n        );\n        for (S3Object objectSummary : list.contents()) {\n          final String fileName = Paths.get(objectSummary.key()).getFileName().toString();\n          if (targetS3Bucket.isEmpty()) {\n            throw new SegmentLoadingException(\"Target S3 bucket is not specified\");\n          }\n          if (targetS3Path.isEmpty()) {\n            throw new SegmentLoadingException(\"Target S3 baseKey is not specified\");\n          }\n\n          safeMove(s3Bucket, s3Path, targetS3Bucket, targetS3Path + \"/\" + fileName);\n        }\n      } else {\n        targetS3Path = S3Utils.constructSegmentPath(\n            targetS3BaseKey,\n            DataSegmentPusher.getDefaultStorageDir(segment, false)\n        );\n\n        if (targetS3Bucket.isEmpty()) {\n          throw new SegmentLoadingException(\"Target S3 bucket is not specified\");\n        }\n        if (targetS3Path.isEmpty()) {\n          throw new SegmentLoadingException(\"Target S3 baseKey is not specified\");","sourceCodeStart":79,"sourceCodeEnd":115,"githubUrl":"https://github.com/apache/druid/blob/9b90983fd291f26935af934383ce360473179e4d/extensions-core/s3-extensions/src/main/java/org/apache/druid/storage/s3/S3DataSegmentMover.java#L79-L115","documentation":"During segment move, when the target bucket is derived by listing the target location, an empty targetS3Bucket means the DataSegment_move metadata did not carry a destination bucket. Moving without a bucket is impossible, so a SegmentLoadingException is thrown per object.","triggerScenarios":"move() is called with a segment whose loadSpec target (via DataSegment_move with bucket/baseKey) resolves to an empty targetS3Bucket while iterating listed objects in the source location.","commonSituations":"Coordinator move request sent with null/empty bucket field, misconfigured move task spec, older UI/client omitting the bucket parameter.","solutions":["Resend the move operation including the target \"bucket\" in the DataSegment_move loadSpec.","Verify the move task JSON in the coordinator console shows a non-empty bucket.","Check the client/tooling version that constructs the move payload for regressions."],"exampleFix":"// before: {\"type\":\"move\",\"to\":{\"type\":\"s3_zip\",\"bucket\":\"\",\"baseKey\":\"s3/base\"}}\n// after: {\"type\":\"move\",\"to\":{\"type\":\"s3_zip\",\"bucket\":\"target-bucket\",\"baseKey\":\"s3/base\"}}","handlingStrategy":"validation","validationCode":"// validate move payload before submission\nif (target == null || target.getBucket() == null || target.getBucket().isEmpty()) {\n  throw new IllegalArgumentException(\"DataSegment_move requires non-empty bucket\");\n}","typeGuard":null,"tryCatchPattern":"try { mover.move(segment, target); } catch (SegmentLoadingException e) { fixAndResubmitMove(); }","preventionTips":["Always include both bucket and baseKey in DataSegment_move specs","Validate move JSONs in tooling before submitting to the coordinator","Review move requests from scripts/CI for blank fields"],"tags":["s3","segment-move","config","validation"],"backgroundTag":"missing-required-argument","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"}