apache/flink · error · IllegalConfigurationException
Invalid path-style-access '%s' for bucket '%s'. Must be 'tru
Error message
Invalid path-style-access '%s' for bucket '%s'. Must be 'true' or 'false'
What it means
BucketConfigProvider throws IllegalConfigurationException when the per-bucket property 'path-style-access' is not exactly 'true' or 'false' (case-insensitive). The value is used with Boolean.parseBoolean, which silently defaults to false on bad input, so the provider pre-validates and rejects ambiguous values.
Source
Thrown at flink-filesystems/flink-s3-fs-native/src/main/java/org/apache/flink/fs/s3native/BucketConfigProvider.java:84
try {
b.assumeRoleSessionDurationSeconds(Integer.parseInt(v));
} catch (NumberFormatException e) {
throw new IllegalConfigurationException(
String.format(
"Invalid assume-role.session-duration '%s' for bucket '%s'. "
+ "Must be a valid integer (e.g., 3600)",
v, b.getBucketName()),
e);
}
});
applicators.put("assume-role.session-name", S3BucketConfig.Builder::assumeRoleSessionName);
applicators.put("aws.credentials.provider", S3BucketConfig.Builder::credentialsProvider);
applicators.put("endpoint", S3BucketConfig.Builder::endpoint);
applicators.put(
"path-style-access",
(b, v) -> {
if (!"true".equalsIgnoreCase(v) && !"false".equalsIgnoreCase(v)) {
throw new IllegalConfigurationException(
String.format(
"Invalid path-style-access '%s' for bucket '%s'. "
+ "Must be 'true' or 'false'",
v, b.getBucketName()));
}
b.pathStyleAccess(Boolean.parseBoolean(v));
});
applicators.put("region", S3BucketConfig.Builder::region);
applicators.put("secret-key", S3BucketConfig.Builder::secretKey);
applicators.put("sse.kms.key-id", S3BucketConfig.Builder::sseKmsKeyId);
applicators.put("sse.type", S3BucketConfig.Builder::sseType);
PROPERTY_APPLICATORS = Collections.unmodifiableMap(applicators);
KNOWN_PROPERTIES_BY_LENGTH =
applicators.keySet().stream()
.sorted(Comparator.comparingInt(String::length).reversed())
.collect(Collectors.toList());
}View on GitHub (pinned to 2f3c205e92)
Solutions
- Use exactly true or false (any case) for path-style-access, e.g. path-style-access: true.
- Remove quotes and whitespace; do not use 1/0/yes/no.
- If using MinIO or a non-AWS endpoint that needs path-style, double-check the endpoint property too.
Example fix
# before s3.bucket.my-bucket.path-style-access: yes # after s3.bucket.my-bucket.path-style-access: true
Defensive patterns
Strategy: validation
Validate before calling
static boolean parsePathStyle(String raw, String bucket) {
if ("true".equalsIgnoreCase(raw) || "false".equalsIgnoreCase(raw)) {
return Boolean.parseBoolean(raw);
}
throw new IllegalArgumentException("path-style-access for '" + bucket + "' must be 'true' or 'false', got: " + raw);
} Prevention
- Use only true/false literals in path-style-access values.
- Normalize YAML/JSON config booleans to strings 'true'/'false' before feeding bucket config.
- Add pre-flight config validation so bad values fail at submit time, not at first S3 access.
When it happens
Trigger: Setting s3.bucket.<bucket>.path-style-access to values like 'yes', '1', 'on', or 'TRUE ' (with whitespace) in bucket-specific S3 configuration.
Common situations: Porting configs from MinIO examples or other tools that accept 1/0 or yes/no; YAML boolean handling that serializes as On/Off; stray whitespace from templated configs.
Related errors
- Invalid assume-role.session-duration '%s' for bucket '%s'. M
- Entropy length must be >= 0 when entropy injection key is se
- Invalid S3 URI: missing or empty bucket name in URI: {}
- Not allowed configuration change(s) were detected:\n - {erro
- At least one trigger condition must be configured.
AI-assisted analysis of apache/flink@2f3c205e92 (2026-08-14).
Data as JSON: /api/errors/f306a943cc0ac4d4.
Report an issue: GitHub.