DoesS3BucketExistV2Async throws an exception #2617
-
Hi, could you please tell me why checking for the existence of a cart gives an exception? What can be the problem? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
Good morning. Per AmazonS3Util.DoesS3BucketExistV2Async(), I tried with the below code (which enables verbose logging): using (AmazonS3Client client = new AmazonS3Client(RegionEndpoint.USWest2))
{
AWSConfigs.LoggingConfig.LogTo = LoggingOptions.Console;
AWSConfigs.LoggingConfig.LogResponses = ResponseLoggingOption.Always;
AWSConfigs.LoggingConfig.LogMetrics = true;
var exists = AmazonS3Util.DoesS3BucketExistV2Async(client, "<<bucket-name>>").Result;
} The specified bucket in some other AWS account was in
If the bucket is in a different region than the one set at
So in both cases, the S3 service returned You may try enabling verbose logging and check what error is returned by S3 for your use case. Thanks, |
Beta Was this translation helpful? Give feedback.
-
Hello! Reopening this discussion to make it searchable. |
Beta Was this translation helpful? Give feedback.
Hi @MaksimSimpleCode,
Good morning.
Per AmazonS3Util.DoesS3BucketExistV2Async(),
False is returned in case S3 responds with a NoSuchBucket error. True is returned in case of success, AccessDenied error or PermanentRedirect error. An exception is thrown in case of any other error.
. If you refer code for this method, it makesAmazonS3Client.GetACLAsync()
call to check the existence of the bucket.I tried with the below code (which enables verbose logging):