-
Notifications
You must be signed in to change notification settings - Fork 247
Closed
Labels
Description
The logic for BucketExistsAsync is incorrect. All it determines is that the response Exception isn't a BucketNotFoundException. This means if you have another exception such as HttpRequestException, it responds that the bucket exists true even when it might not.
minio-dotnet/Minio/ApiEndpoints/BucketOperations.cs
Lines 83 to 85 in 2e46392
return response is not null && | |
(response.Exception is null || | |
response.Exception.GetType() != typeof(BucketNotFoundException)); |
I was getting a "The SSL connection could not be established, see inner exception." and never knew until I stepped into the lib code.
wuzhenda, will056, uvsxx and fadakkden21
Activity
minio#1118 throw exceptions returned from BucketExistsAsync
albracko commentedon Jul 12, 2024
This is not the only method that has wrong exception handling. I just lost few hours trying to figure out why
BucketExistsAsync
returns true, yet methodListBucketsAsync
returns an object that was created with default constructor.In my case i had wrong endpoint, but NO info about this in logs or any exception...which was harder to find out because i was testing on Gitlab CI....so had only logs available
I looked up your code, and the implementation of
ExecuteTaskCoreAsync
is not in-line with error handling in your API methods. All errors are basically being swallowed, leaving developers searching for a true cause why the API is not working.RoyalScribblz commentedon Jul 12, 2024
Yes @albracko I also experienced this with putting and getting objects, I spent a while trying to figure out why I get
""
response back from getting object but turns out whole time it was never even putting anything in there in the first place as there was no connection but it swallowed exception.rekarpc98 commentedon Jul 20, 2024
I think exception handling needs a review.
my code:
bool exists = await minioClient.BucketExistsAsync(new BucketExistsArgs().WithBucket(bucketName));
I will get true even if the minio container be down and not be accessible by any mean 🙄
jculverwell commentedon Nov 11, 2024
Any progress on this?
jculverwell commentedon Nov 12, 2024
Swallowing all the errors is really disappointing. I spent a whole day investigating why the Minio dotnet Client was saying it could find a bucket I couldn't see it. Thankfully I found this github issue. To find the actual issue I ended up installing the AWSSDK.S3 nuget package and using the code below. This immediately surfaced an SSL issue.
Hope you guys can get this fixed.
`using Amazon;
using Amazon.S3;
public class TestMinioAWS
{
private readonly AmazonS3Client _s3Client;
}
`
apiweb commentedon Mar 10, 2025
Sorry to ask, any news about a release with the bug fix?
I’m suffering from the same problem. I saw that the bug was fixed in January.
albracko commentedon Mar 11, 2025
The bug was not fixed yet. They just resolved this ticket with an incorrect PR (already sent them an email to reopen the ticket once it's really fixed). The bug is being fixed with this PR:
#1141