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

s3 bucket condition filtering error #2148

Closed
liwande opened this issue Nov 17, 2020 · 4 comments
Closed

s3 bucket condition filtering error #2148

liwande opened this issue Nov 17, 2020 · 4 comments
Labels
bug This issue is a bug. closed-for-staleness response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 10 days.

Comments

@liwande
Copy link

liwande commented Nov 17, 2020

Describe the bug

The listObjects and listObjectsV2 methods of aws-sdk-java-v2 S3 will report an error ,if the built-in attribute prefix or maxKeys attribute is specified (no error will be reported if you do not specify it)
The error content is as follows: Exception in thread "main" software.amazon.awssdk.services.s3.model.S3Exception: null (Service: S3, Status Code: 302, Request ID: null)

Expected Behavior

The s3 bucket condition can specify the prefix or the maximum number of objects returned

Current Behavior

The specified prefix or the maximum number of objects returned is abnormal

Exception in thread "main" software.amazon.awssdk.services.s3.model.S3Exception: null (Service: S3, Status Code: 302, Request ID: null)

Steps to Reproduce

AwsCredentialsProvider awsCredentialsProvider = () -> AwsBasicCredentials.create(awsConfig.getAccessKeyId(), awsConfig.getSecretAccessKey());

    Region region = Region.of(awsConfig.getRegion());
    s3Client = S3Client.builder()
            .region(region)
            .credentialsProvider(awsCredentialsProvider)
            .build();

    ListObjectsRequest listObjects = ListObjectsRequest
            .builder()
            .bucket(bucketName)

// .maxKeys(10)
.build();

    ListObjectsResponse response = s3Client.listObjects(listObjects);
    List<S3Object> contents = response.contents()

comment:The listObjects and listObjectsV2 methods of aws-sdk-java-v2 S3 will report an error

Possible Solution

Context

Your Environment

  • AWS Java SDK version used: aws-sdk-java-v2
  • JDK version used: jdk1.8
@liwande liwande added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels Nov 17, 2020
@debora-ito
Copy link
Member

@liwande can you provide the full stacktrace?

@debora-ito debora-ito added response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 10 days. and removed needs-triage This issue or PR still needs to be triaged. labels Nov 17, 2020
@liwande
Copy link
Author

liwande commented Nov 18, 2020 via email

@github-actions github-actions bot removed the response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 10 days. label Nov 18, 2020
@debora-ito
Copy link
Member

Thank you for the stacktrace. Status code 302 is described as the requested resource resides temporarily under a different URI, so it's weird that you only get this exception when maxkeys is provided. I'm not able to reproduce the issue locally.

Can you turn the verbose wire logging on and provide us the logs? Please make sure to redact any sensitive data like access keys. I'm hoping to get additional information from the requests and reponses.

@debora-ito debora-ito added the response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 10 days. label Nov 20, 2020
@github-actions
Copy link

It looks like this issue hasn’t been active in longer than a week. In the absence of more information, we will be closing this issue soon. If you find that this is still a problem, please add a comment to prevent automatic closure, or if the issue is already closed please feel free to reopen it.

@github-actions github-actions bot added closing-soon This issue will close in 4 days unless further comments are made. closed-for-staleness and removed closing-soon This issue will close in 4 days unless further comments are made. labels Nov 26, 2020
aws-sdk-java-automation added a commit that referenced this issue Sep 19, 2022
…d08fdd733

Pull request: release <- staging/b9f39c39-d8da-4674-9c92-c22d08fdd733
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue is a bug. closed-for-staleness response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 10 days.
Projects
None yet
Development

No branches or pull requests

2 participants