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

listObjectsV2 causes endless loop > 1000 items #578

Closed
IsNull opened this issue May 21, 2017 · 5 comments
Closed

listObjectsV2 causes endless loop > 1000 items #578

IsNull opened this issue May 21, 2017 · 5 comments
Assignees
Milestone

Comments

@IsNull
Copy link
Contributor

IsNull commented May 21, 2017

Using the new (default) listObjectsV2 to list objects causes an endless loop when there are more than 1000 items returned by the server and recursive is set to true. The iterator will list the first 1000 items over and over again.

I guess there is some error in the continuation token logic in the java client.

To reproduce, create 1001 items in a bucket and use the simplistic code below to list them:

    private static void testEndlessLoop(){

        MinioClient minioClient = null;
        try {
            minioClient = new MinioClient(
                    "http://myminio.lan:9000",
                    accessKey,
                    accessSecret);


            Iterable<Result<Item>> iterable = minioClient.listObjects(
                    "mybucket",
                    "some/prefix/",
                    true,
                    false);  // if set to true it works, using V1
            

            iterable.forEach(o -> {
                try {
                    System.out.println(o.get().objectName());
                } catch (Exception e) {
                    e.printStackTrace();
                }
            });
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

If you have trouble reproducing it on your end let me know.

Versions
minio-java 3.0.4
minio RELEASE.2017-05-05T01-14-51Z

@harshavardhana
Copy link
Member

Have you tried with mc does that work ?

@vadmeste
Copy link
Member

I was able to reproduce this. I can take it.

@IsNull
Copy link
Contributor Author

IsNull commented Jun 19, 2017

@harshavardhana any chance of a new release which contains this fix? While the problem is not really an issue for me (as I switched back to the v1 api), all new users have a non working default configuration as V2 has been made the default.

@harshavardhana
Copy link
Member

@harshavardhana any chance of a new release which contains this fix? While the problem is not really an issue for me (as I switched back to the v1 api), all new users have a non working default configuration as V2 has been made the default.

Sure we will make a new release soon @IsNull - thanks for getting back to us.

@klingtnet
Copy link

klingtnet commented Jun 20, 2017

This is also an issue for the latest minio-go. See #719 in minio-go.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants