You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Under the hood, ListObjectsWithContext (same as ListObjects) can only return up to 1000 objects; hence truncating the contents array
Using github.com/aws/aws-sdk-go/@v/v1.40.59.mod in the following examples.
If S3 were to contain most (if not all) of the existing versions of this module, it would easily amount up to > 1000 objects. As a result, if the module version that the user requested doesn't fall within the 1000 returned objects, it causes Athens to return 404.
Error Message
Here are the only 2 error messages emitted in our logs.
However, for 2, currently I'm seeing 4000+ objects by using the prefix github.com/aws/aws-sdk-go/@v/ on my S3. Hence, I am not sure if iterating through all the available pages (objects) is good idea here because:
Slowness
Can generate multiple requests to a service
What do you guys think?
I'm happy to submit a PR (I also have access to AWS for testing). Let me know :)
Describe the bug
The current
s3.Exists
method inchecker.go
may return a 404 even if the module cache is present in S3.:athens/pkg/storage/s3/checker.go
Lines 25 to 30 in cc496af
Under the hood,
ListObjectsWithContext
(same asListObjects
) can only return up to 1000 objects; hence truncating the contents arrayIf S3 were to contain most (if not all) of the existing versions of this module, it would easily amount up to > 1000 objects. As a result, if the module version that the user requested doesn't fall within the 1000 returned objects, it causes Athens to return 404.
Error Message
Here are the only 2 error messages emitted in our logs.
To Reproduce
Steps to reproduce the behavior:
github.com/aws/aws-sdk-go
curl https://goproxy.company.com/github.com/aws/aws-sdk-go/@v/v1.40.59.mod
Expected behavior
Athens to return response code 200 with the following:
Environment (please complete the following information):
Additional context
athens/pkg/storage/s3/checker.go
Lines 25 to 30 in cc496af
The previous implementation of prefix string results in
ListObjectsWithContext
almost always returning <1000 objects due to its more precise filter:The text was updated successfully, but these errors were encountered: