{"record":{"id":"2a74a8ce322251f2","repo":"apache/hadoop","slug":"46","errorCode":"46","errorMessage":"The -zone option is only supported for Amazon S3 Express One Zone Storage","messagePattern":"The -zone option is only supported for Amazon S3 Express One Zone Storage","errorType":"error_code","errorClass":"ExitUtil.ExitException","httpStatus":null,"severity":"error","filePath":"hadoop-tools/hadoop-aws/src/main/java/org/apache/hadoop/fs/s3a/tools/BucketTool.java","lineNumber":221,"sourceCode":"    // may not exist\n    String bucketPrefix = \"fs.s3a.bucket.\" + bucket + '.';\n    conf.setInt(bucketPrefix + S3A_BUCKET_PROBE, 0);\n    conf.setBoolean(bucketPrefix + REJECT_OUT_OF_SPAN_OPERATIONS, false);\n    // propagate an option\n    BiFunction<String, Optional<String>, Boolean> propagate = (key, opt) ->\n        opt.map(v -> {\n          conf.set(key, v);\n          LOG.info(\"{} = {}\", key, v);\n          return true;\n        }).orElse(false);\n\n\n    propagate.apply(AWS_REGION, region);\n    propagate.apply(ENDPOINT, endpoint);\n\n    // fail fast on third party store\n    if (hasS3ExpressSuffix(bucket) && !isAwsEndpoint(endpoint.orElse(\"\"))) {\n      throw new ExitUtil.ExitException(EXIT_NOT_ACCEPTABLE, UNSUPPORTED_ZONE_ARG);\n    }\n    S3AFileSystem fs;\n    try {\n      fs = (S3AFileSystem) FileSystem.newInstance(fsURI, conf);\n    } catch (FileNotFoundException e) {\n      // this happens if somehow the probe wasn't disabled.\n      errorln(PROBE_FAILURE);\n      throw new ExitUtil.ExitException(EXIT_BAD_CONFIGURATION, PROBE_FAILURE);\n    }\n\n    try {\n\n      // now build the configuration\n      final CreateBucketConfiguration.Builder builder = CreateBucketConfiguration.builder();\n\n      if (fs.hasPathCapability(new Path(\"/\"), STORE_CAPABILITY_S3_EXPRESS_STORAGE)) {\n        //  S3 Express store requires a zone and some other other settings\n        final String az = zone.orElseThrow(() ->","sourceCodeStart":203,"sourceCodeEnd":239,"githubUrl":"https://github.com/apache/hadoop/blob/2add9630210752f88ceb1bb74eb65e37bf41da8e/hadoop-tools/hadoop-aws/src/main/java/org/apache/hadoop/fs/s3a/tools/BucketTool.java#L203-L239","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","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"],"exampleFix":"# before (express-style name against MinIO)\nhadoop aws s3guard bucket -create -endpoint http://minio.example:9000 s3a://data--use1-az4--x-s3\n# after (plain bucket name for the third-party store)\nhadoop aws s3guard bucket -create -endpoint http://minio.example:9000 s3a://data","handlingStrategy":"validation","validationCode":"String bucket = new Path(bucketArg).toUri().getHost();\nString endpoint = effectiveEndpoint(conf, bucket); // -endpoint or fs.s3a.bucket.<b>.endpoint\nif (hasS3ExpressSuffix(bucket) && !isAwsEndpoint(endpoint)) {\n  failFast(\"express-suffixed bucket names require an AWS endpoint\");\n}","typeGuard":null,"tryCatchPattern":"try {\n  int rc = new BucketTool(conf).exec(args);\n} catch (ExitUtil.ExitException e) {\n  if (e.getExitCode() == 46) {\n    // EXIT_NOT_ACCEPTABLE: fix bucket name or endpoint; retrying unchanged cannot help\n  }\n}","preventionTips":["Reserve '--x-s3' bucket names for real AWS S3 Express directories","Keep third-party store endpoints paired with plain bucket names in templates"],"tags":["s3a","s3-express","endpoint","third-party-store","bucket","exit-code-46"],"backgroundTag":"unsupported-configuration-combination","analyzedSha":"2add9630210752f88ceb1bb74eb65e37bf41da8e","analyzedAt":"2026-08-22T19:55:07.957Z","schemaVersion":2},"datasetVersion":"2026-08-22T20:17:22.307Z"}