question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

MinioClient.ListObjectsAsync() throws an error when the bucket is empty

See original GitHub issue

As the title says, simple code:

            try
            {
                await this.client.ListObjectsAsync(bucketName);
                return true;
            }
            catch
            {
                return false;
            }

always returns false, when the requested bucket does not contain any objects (e.g. new bucket).

The caught exception is:

System.InvalidOperationException: Sequence contains no elements.
   at System.Reactive.Subjects.AsyncSubject`1.GetResult() in D:\a\1\s\Rx.NET\Source\src\System.Reactive\Subjects\AsyncSubject.cs:line 361

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:6 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
BigUstadcommented, Nov 19, 2020

Having await on a function that is not marked async and returns IObservable may be causing an unintended error. Can you please remove the await keyword for ListObjectsAsync & try.

0reactions
BigUstadcommented, Apr 15, 2021

Fix 527 merged to master branch.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Get list of objects from S3 bucket using Minio in .Net
I can check is a bucket exists and its contents, but just only the first time after compilation. Next times i get empty...
Read more >
.NET Client API Reference — MinIO Object Storage for Linux
public MinioClient(). Creates MinIO client. This client gives an empty object that can be used with Chaining to populate only the member variables...
Read more >
io.minio.MinioClient.removeBucket java code examples
public static void teardown() throws Exception { client. ... This operation will only work if your bucket is empty. boolean found = minioClient....
Read more >
Amazon S3 examples using AWS SDK for .NET
The following code examples show you how to perform actions and implement common scenarios by using the AWS SDK for .NET with Amazon...
Read more >
Object Storage, Minio, and Kubernetes
We can't delete a bucket unless it is empty. So let's look in the container and see what it contains. List bucket contents....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found