apache/hadoop · error · ExitUtil.ExitException
46
46
Error message
The -zone option is only supported for Amazon S3 Express One Zone Storage
What it means
Fail-fast check in the bucket tool before instantiating the filesystem: if the bucket name carries the S3 Express One Zone suffix (directory buckets are named like 'data--use1-az4--x-s3') but the effective endpoint is not an AWS endpoint (NetworkBinding.isAwsEndpoint), the tool exits 46 (EXIT_NOT_ACCEPTABLE) with 'The -zone option is only supported for Amazon S3 Express One Zone Storage'. Directory buckets only exist in real AWS S3, so combining an express-style name with a third-party S3-compatible endpoint is rejected up front.
Source
Thrown at hadoop-tools/hadoop-aws/src/main/java/org/apache/hadoop/fs/s3a/tools/BucketTool.java:221
// may not exist
String bucketPrefix = "fs.s3a.bucket." + bucket + '.';
conf.setInt(bucketPrefix + S3A_BUCKET_PROBE, 0);
conf.setBoolean(bucketPrefix + REJECT_OUT_OF_SPAN_OPERATIONS, false);
// propagate an option
BiFunction<String, Optional<String>, Boolean> propagate = (key, opt) ->
opt.map(v -> {
conf.set(key, v);
LOG.info("{} = {}", key, v);
return true;
}).orElse(false);
propagate.apply(AWS_REGION, region);
propagate.apply(ENDPOINT, endpoint);
// fail fast on third party store
if (hasS3ExpressSuffix(bucket) && !isAwsEndpoint(endpoint.orElse(""))) {
throw new ExitUtil.ExitException(EXIT_NOT_ACCEPTABLE, UNSUPPORTED_ZONE_ARG);
}
S3AFileSystem fs;
try {
fs = (S3AFileSystem) FileSystem.newInstance(fsURI, conf);
} catch (FileNotFoundException e) {
// this happens if somehow the probe wasn't disabled.
errorln(PROBE_FAILURE);
throw new ExitUtil.ExitException(EXIT_BAD_CONFIGURATION, PROBE_FAILURE);
}
try {
// now build the configuration
final CreateBucketConfiguration.Builder builder = CreateBucketConfiguration.builder();
if (fs.hasPathCapability(new Path("/"), STORE_CAPABILITY_S3_EXPRESS_STORAGE)) {
// S3 Express store requires a zone and some other other settings
final String az = zone.orElseThrow(() ->View on GitHub (pinned to 2add963021)
Solutions
- For third-party S3-compatible stores, use a normal bucket name without the '--x-s3' availability-zone suffix
- For a real S3 Express One Zone bucket, drop the custom -endpoint or set it to an AWS endpoint (s3.amazonaws.com or a regional s3.<region>.amazonaws.com)
- Check for leftover fs.s3a.endpoint or fs.s3a.bucket.<bucket>.endpoint overrides steering the client at a non-AWS URL
Example fix
# before (express-style name against MinIO) hadoop aws s3guard bucket -create -endpoint http://minio.example:9000 s3a://data--use1-az4--x-s3 # after (plain bucket name for the third-party store) hadoop aws s3guard bucket -create -endpoint http://minio.example:9000 s3a://data
Defensive patterns
Strategy: validation
Validate before calling
String bucket = new Path(bucketArg).toUri().getHost();
String endpoint = effectiveEndpoint(conf, bucket); // -endpoint or fs.s3a.bucket.<b>.endpoint
if (hasS3ExpressSuffix(bucket) && !isAwsEndpoint(endpoint)) {
failFast("express-suffixed bucket names require an AWS endpoint");
} Try / catch
try {
int rc = new BucketTool(conf).exec(args);
} catch (ExitUtil.ExitException e) {
if (e.getExitCode() == 46) {
// EXIT_NOT_ACCEPTABLE: fix bucket name or endpoint; retrying unchanged cannot help
}
} Prevention
- Reserve '--x-s3' bucket names for real AWS S3 Express directories
- Keep third-party store endpoints paired with plain bucket names in templates
When it happens
Trigger: Bucket argument ending in '--x-s3' together with '-endpoint http://minio.example:9000' or a config override (fs.s3a.endpoint / fs.s3a.bucket.<bucket>.endpoint) pointing at MinIO, Ceph or another S3-compatible store; also an endpoint string malformed enough that isAwsEndpoint() does not recognize it as AWS.
Common situations: Testing S3 Express-style bucket naming against on-prem stores; endpoint typos or missing scheme/host in the endpoint URL; configs copied from third-party store documentation applied to express-named buckets.
Related errors
- Bucket does not exist. Accessing with fs.s3a.endpoint set t
- Bucket does not exist
- 42
- Wrong bucket: %s, in path: %s, expected bucket: %s
- GCS bucket name cannot be empty.
AI-assisted analysis of apache/hadoop@2add963021 (2026-08-22).
Data as JSON: /api/errors/2a74a8ce322251f2.
Report an issue: GitHub.