-
Notifications
You must be signed in to change notification settings - Fork 847
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
Comments
@liwande can you provide the full stacktrace? |
1、code show as below:
AwsCredentialsProvider awsCredentialsProvider = () -> AwsBasicCredentials.create(awsConfig.getAccessKeyId(), awsConfig.getSecretAccessKey());
int maxKeys = 4;
Region region = Region.of(awsConfig.getRegion());
s3Client = S3Client.builder()
.region(region)
.credentialsProvider(awsCredentialsProvider)
.build();
ListObjectsRequest listObjects = ListObjectsRequest
.builder()
.bucket("guangfeng-demo")
.maxKeys(maxKeys)
.build();
ListObjectsResponse response = s3Client.listObjects(listObjects);
List<S3Object> contents = response.contents();
ListObjectsV2Response result = s3Client.listObjectsV2(ListObjectsV2Request.builder()
.bucket("guangfeng-demo")
.maxKeys(maxKeys)
.build());
List<S3Object> objects1 = result.contents();
List<S3Object> objects2 = result.name();
2、Description:
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)
3、Stacktrace:
Exception in thread "main" software.amazon.awssdk.services.s3.model.S3Exception: null (Service: S3, Status Code: 302, Request ID: null) at software.amazon.awssdk.core.internal.http.pipeline.stages.HandleResponseStage.handleErrorResponse(HandleResponseStage.java:115) at software.amazon.awssdk.core.internal.http.pipeline.stages.HandleResponseStage.handleResponse(HandleResponseStage.java:73) at software.amazon.awssdk.core.internal.http.pipeline.stages.HandleResponseStage.execute(HandleResponseStage.java:58) at software.amazon.awssdk.core.internal.http.pipeline.stages.HandleResponseStage.execute(HandleResponseStage.java:41) at software.amazon.awssdk.core.internal.http.pipeline.RequestPipelineBuilder$ComposingRequestPipelineStage.execute(RequestPipelineBuilder.java:206) at software.amazon.awssdk.core.internal.http.pipeline.stages.ApiCallAttemptTimeoutTrackingStage.execute(ApiCallAttemptTimeoutTrackingStage.java:64) at software.amazon.awssdk.core.internal.http.pipeline.stages.ApiCallAttemptTimeoutTrackingStage.execute(ApiCallAttemptTimeoutTrackingStage.java:36) at software.amazon.awssdk.core.internal.http.pipeline.stages.TimeoutExceptionHandlingStage.execute(TimeoutExceptionHandlingStage.java:77) at software.amazon.awssdk.core.internal.http.pipeline.stages.TimeoutExceptionHandlingStage.execute(TimeoutExceptionHandlingStage.java:39) at software.amazon.awssdk.core.internal.http.pipeline.stages.RetryableStage$RetryExecutor.doExecute(RetryableStage.java:113) at software.amazon.awssdk.core.internal.http.pipeline.stages.RetryableStage$RetryExecutor.execute(RetryableStage.java:86) at software.amazon.awssdk.core.internal.http.pipeline.stages.RetryableStage.execute(RetryableStage.java:62) at software.amazon.awssdk.core.internal.http.pipeline.stages.RetryableStage.execute(RetryableStage.java:42) at software.amazon.awssdk.core.internal.http.pipeline.RequestPipelineBuilder$ComposingRequestPipelineStage.execute(RequestPipelineBuilder.java:206) at software.amazon.awssdk.core.internal.http.StreamManagingStage.execute(StreamManagingStage.java:57) at software.amazon.awssdk.core.internal.http.StreamManagingStage.execute(StreamManagingStage.java:37) at software.amazon.awssdk.core.internal.http.pipeline.stages.ApiCallTimeoutTrackingStage.executeWithTimer(ApiCallTimeoutTrackingStage.java:80) at software.amazon.awssdk.core.internal.http.pipeline.stages.ApiCallTimeoutTrackingStage.execute(ApiCallTimeoutTrackingStage.java:60) at software.amazon.awssdk.core.internal.http.pipeline.stages.ApiCallTimeoutTrackingStage.execute(ApiCallTimeoutTrackingStage.java:42) at software.amazon.awssdk.core.internal.http.pipeline.RequestPipelineBuilder$ComposingRequestPipelineStage.execute(RequestPipelineBuilder.java:206) at software.amazon.awssdk.core.internal.http.pipeline.RequestPipelineBuilder$ComposingRequestPipelineStage.execute(RequestPipelineBuilder.java:206) at software.amazon.awssdk.core.internal.http.pipeline.stages.ExecutionFailureExceptionReportingStage.execute(ExecutionFailureExceptionReportingStage.java:37) at software.amazon.awssdk.core.internal.http.pipeline.stages.ExecutionFailureExceptionReportingStage.execute(ExecutionFailureExceptionReportingStage.java:26) at software.amazon.awssdk.core.internal.http.AmazonSyncHttpClient$RequestExecutionBuilderImpl.execute(AmazonSyncHttpClient.java:240) at software.amazon.awssdk.core.client.handler.BaseSyncClientHandler.invoke(BaseSyncClientHandler.java:96) at software.amazon.awssdk.core.client.handler.BaseSyncClientHandler.execute(BaseSyncClientHandler.java:120) at software.amazon.awssdk.core.client.handler.BaseSyncClientHandler.execute(BaseSyncClientHandler.java:73) at software.amazon.awssdk.core.client.handler.SdkSyncClientHandler.execute(SdkSyncClientHandler.java:44) at software.amazon.awssdk.awscore.client.handler.AwsSyncClientHandler.execute(AwsSyncClientHandler.java:55) at software.amazon.awssdk.services.s3.DefaultS3Client.listObjectsV2(DefaultS3Client.java:2313) at org.example.lwd.aaa.testListWithMaxKeys(aaa.java:27)
975806751@qq.com
From: Debora N. Ito
Date: 2020-11-18 05:51
To: aws/aws-sdk-java-v2
CC: liwande; Mention
Subject: Re: [aws/aws-sdk-java-v2] s3 bucket condition filtering error (#2148)
@liwande can you provide the full stacktrace?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or unsubscribe.
|
Thank you for the stacktrace. Status code 302 is described as 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. |
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. |
…d08fdd733 Pull request: release <- staging/b9f39c39-d8da-4674-9c92-c22d08fdd733
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());
// .maxKeys(10)
.build();
comment:The listObjects and listObjectsV2 methods of aws-sdk-java-v2 S3 will report an error
Possible Solution
Context
Your Environment
The text was updated successfully, but these errors were encountered: