Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(stream): use getBucketACL instead of headBucket to check if bucket exist #879

Merged
merged 1 commit into from
Jan 4, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -600,7 +600,7 @@ private void checkAvailable(S3Utils.S3Context s3Context) {
String multipartPath = String.format("check_available_multipart/%d", System.nanoTime());
try {
// Check network and bucket
readS3Client.headBucket(b -> b.bucket(bucket)).get(3, TimeUnit.SECONDS);
readS3Client.getBucketAcl(b -> b.bucket(bucket)).get(3, TimeUnit.SECONDS);

// Simple write/read/delete
this.write(path, Unpooled.wrappedBuffer(content)).get(30, TimeUnit.SECONDS);
Expand All @@ -619,7 +619,7 @@ private void checkAvailable(S3Utils.S3Context s3Context) {
LOGGER.error("Failed to write/read/delete object on S3 ", e);
String exceptionMsg = String.format("Failed to write/read/delete object on S3. You are using s3Context: %s.", s3Context);

Throwable cause = e.getCause();
Throwable cause = e.getCause() != null ? e.getCause() : e;
if (cause instanceof SdkClientException) {
if (cause.getMessage().contains("UnknownHostException")) {
Throwable rootCause = ExceptionUtils.getRootCause(cause);
Expand Down
Loading