apache/flink · error · IllegalConfigurationException

Bucket '%s': both 's3.bucket.%s.access-key' and 's3.bucket.%

Error message

Bucket '%s': both 's3.bucket.%s.access-key' and 's3.bucket.%s.secret-key' must be set together. Found only %s.

What it means

Error "Bucket '%s': both 's3.bucket.%s.access-key' and 's3.bucket.%s.secret-key' must be set together. Found only %s." thrown in apache/flink.

Source

Thrown at flink-filesystems/flink-s3-fs-native/src/main/java/org/apache/flink/fs/s3native/S3BucketConfig.java:329

            this.assumeRoleSessionName = assumeRoleSessionName;
            return this;
        }

        Builder assumeRoleSessionDurationSeconds(int assumeRoleSessionDurationSeconds) {
            this.assumeRoleSessionDurationSeconds = assumeRoleSessionDurationSeconds;
            return this;
        }

        Builder credentialsProvider(String credentialsProvider) {
            this.credentialsProvider = credentialsProvider;
            return this;
        }

        S3BucketConfig build() {
            boolean hasAccessKey = !StringUtils.isNullOrWhitespaceOnly(accessKey);
            boolean hasSecretKey = !StringUtils.isNullOrWhitespaceOnly(secretKey);
            if (hasAccessKey != hasSecretKey) {
                throw new IllegalConfigurationException(
                        String.format(
                                "Bucket '%s': both 's3.bucket.%s.access-key' and "
                                        + "'s3.bucket.%s.secret-key' must be set together. "
                                        + "Found only %s.",
                                bucketName,
                                bucketName,
                                bucketName,
                                hasAccessKey ? "access-key" : "secret-key"));
            }
            return new S3BucketConfig(this);
        }
    }
}

View on GitHub (pinned to 2f3c205e92)

Solutions

  1. Address the cause reported by the error message: Bucket 'the reported value': both 's3.bucket.the reported value.access-key' and 's3.bucket.the reported value.secret-key' must be set together. Found only the reported value.
  2. Verify the inputs, configuration values, and classpath/dependency setup related to this operation, then retry.

Example fix

Correct the condition described ("Bucket 'the reported value': both 's3.bucket.the reported value.access-key' and 's3.bucket.the reported value.secret-key' must be set together. Found only the reported value.") and rerun the job or command.

When it happens

Trigger: Triggered at runtime when the operation fails because: Bucket 'the reported value': both 's3.bucket.the reported value.access-key' and 's3.bucket.the reported value.secret-key' must be set together. Found only the reported value.

Common situations: Commonly caused by misconfiguration, missing dependencies or files, unsupported types or operations, or invalid user input leading to: Bucket 'the reported value': both 's3.bucket.the reported value.access-key' and 's3.bucket.the reported value.secret-key' must be set together. Found only the reported value.


AI-assisted analysis of apache/flink@2f3c205e92 (2026-08-14). Data as JSON: /api/errors/5814fc2f8bd7b619. Report an issue: GitHub.