ListObjectsV2 doesn't check start-after value. #79

Closed
opened 2025-12-28 17:36:13 +00:00 by sami · 1 comment
Owner

Originally created by @masterSplinter01 on GitHub (Jul 23, 2021).

Originally assigned to: @masterSplinter01 on GitHub.

While #154 I noticed that ListObjectsV2 doesn't check is a value of start-after an existing key in a bucket or not. It just choose objects which have a key > the string in the start-after.

Minio's behaviour is the same.

For example: a bucket keeps 2 objects: aaa, zzz

Minio's response to a request with non-existing key in start-after:

aws s3api list-objects-v2 --bucket start --endpoint-ur http://127.0.0.1:9000 --start-after k
{
    "Contents": [
        {
            "Key": "zzz",
            "LastModified": "2021-07-30T11:07:08.050000+00:00",
            "ETag": "\"93fed3735690f84390df9e0c7fd2e869\"",
            "Size": 952107,
            "StorageClass": "STANDARD",
            "Owner": {
                "DisplayName": "minio",
                "ID": "02d6176db174dc93cb1b899f7c6078f08654445fe8cf1b6ce98d8855f66bdbf4"
            }
        }
    ]
}

Expected: ???

As it's written here https://docs.aws.amazon.com/AmazonS3/latest/API/API_ListObjectsV2.html#API_ListObjectsV2_RequestParameters
the value should be an existing key.

Let's check how AWS behave. If it checks the value, we can add a check of start-after. Otherwise just close the issue.

Originally created by @masterSplinter01 on GitHub (Jul 23, 2021). Originally assigned to: @masterSplinter01 on GitHub. While #154 I noticed that ListObjectsV2 doesn't check is a value of start-after an existing key in a bucket or not. It just choose objects which have a key > the string in the start-after. Minio's behaviour is the same. For example: a bucket keeps 2 objects: `aaa`, `zzz` Minio's response to a request with non-existing key in start-after: ``` aws s3api list-objects-v2 --bucket start --endpoint-ur http://127.0.0.1:9000 --start-after k { "Contents": [ { "Key": "zzz", "LastModified": "2021-07-30T11:07:08.050000+00:00", "ETag": "\"93fed3735690f84390df9e0c7fd2e869\"", "Size": 952107, "StorageClass": "STANDARD", "Owner": { "DisplayName": "minio", "ID": "02d6176db174dc93cb1b899f7c6078f08654445fe8cf1b6ce98d8855f66bdbf4" } } ] } ``` Expected: `???` As it's written here https://docs.aws.amazon.com/AmazonS3/latest/API/API_ListObjectsV2.html#API_ListObjectsV2_RequestParameters the value should be an existing key. Let's check how AWS behave. If it checks the value, we can add a check of start-after. Otherwise just close the issue.
sami 2025-12-28 17:36:13 +00:00
  • closed this issue
  • added the
    question
    label
Author
Owner

@KirillovDenis commented on GitHub (Aug 2, 2021):

Neither the first nor the second version of the listObjects checks the key (bucket contains a-obj and z-obj).

denis@denis-nspcc:~/github$ export AWS_MAX_ATTEMPTS=1 && aws s3api list-objects-v2 --profile aws --bucket dkirillov  --start-after k
{
    "Contents": [
        {
            "Key": "z-obj",
            "LastModified": "2021-08-02T13:11:48+00:00",
            "ETag": "\"b92a2dc415085614e4f8006b99d6418d\"",
            "Size": 17,
            "StorageClass": "STANDARD"
        }
    ]
}

@KirillovDenis commented on GitHub (Aug 2, 2021): Neither the first nor the second version of the `listObjects` checks the key (bucket contains `a-obj` and `z-obj`). ``` denis@denis-nspcc:~/github$ export AWS_MAX_ATTEMPTS=1 && aws s3api list-objects-v2 --profile aws --bucket dkirillov --start-after k { "Contents": [ { "Key": "z-obj", "LastModified": "2021-08-02T13:11:48+00:00", "ETag": "\"b92a2dc415085614e4f8006b99d6418d\"", "Size": 17, "StorageClass": "STANDARD" } ] } ```
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
nspcc-dev/neofs-s3-gw#79
No description provided.