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
AWS SDKv2 Kinesis API recently introduced a bug (confirmed by AWS on internal case) where listing shards fails when there are more than 1000 shards; StreamName is provided (or StreamFilter in general); Next Token is provided.
Reproduction
This can be reproduced by either using Kinesis listShards API by using one of the following ListShardRequest examples for stream with more than 1000 shards:
The issue appears even when no NextToken is provided as it is automatically generated by the KinesisClient.
Example exception
software.amazon.awssdk.services.kinesis.model.InvalidArgumentException: NextToken and ShardFilter cannot be provided together.
(Service: Kinesis, Status Code: 400, Request ID: **UUID**, Extended Request ID: **ID**)
at software.amazon.awssdk.core.internal.http.CombinedResponseHandler.handleErrorResponse(CombinedResponseHandler.java:125)
at software.amazon.awssdk.core.internal.http.CombinedResponseHandler.handleResponse(CombinedResponseHandler.java:82)
at software.amazon.awssdk.core.internal.http.CombinedResponseHandler.handle(CombinedResponseHandler.java:60)
at software.amazon.awssdk.core.internal.http.CombinedResponseHandler.handle(CombinedResponseHandler.java:41)
at software.amazon.awssdk.core.internal.http.pipeline.stages.HandleResponseStage.execute(HandleResponseStage.java:50)
at software.amazon.awssdk.core.internal.http.pipeline.stages.HandleResponseStage.execute(HandleResponseStage.java:38)
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:74)
at software.amazon.awssdk.core.internal.http.pipeline.stages.ApiCallAttemptTimeoutTrackingStage.execute(ApiCallAttemptTimeoutTrackingStage.java:43)
at software.amazon.awssdk.core.internal.http.pipeline.stages.TimeoutExceptionHandlingStage.execute(TimeoutExceptionHandlingStage.java:79)
at software.amazon.awssdk.core.internal.http.pipeline.stages.TimeoutExceptionHandlingStage.execute(TimeoutExceptionHandlingStage.java:41)
at software.amazon.awssdk.core.internal.http.pipeline.stages.ApiCallAttemptMetricCollectionStage.execute(ApiCallAttemptMetricCollectionStage.java:55)
at software.amazon.awssdk.core.internal.http.pipeline.stages.ApiCallAttemptMetricCollectionStage.execute(ApiCallAttemptMetricCollectionStage.java:39)
at software.amazon.awssdk.core.internal.http.pipeline.stages.RetryableStage2.executeRequest(RetryableStage2.java:93)
at software.amazon.awssdk.core.internal.http.pipeline.stages.RetryableStage2.execute(RetryableStage2.java:56)
at software.amazon.awssdk.core.internal.http.pipeline.stages.RetryableStage2.execute(RetryableStage2.java:36)
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:53)
at software.amazon.awssdk.core.internal.http.StreamManagingStage.execute(StreamManagingStage.java:35)
at software.amazon.awssdk.core.internal.http.pipeline.stages.ApiCallTimeoutTrackingStage.executeWithTimer(ApiCallTimeoutTrackingStage.java:82)
at software.amazon.awssdk.core.internal.http.pipeline.stages.ApiCallTimeoutTrackingStage.execute(ApiCallTimeoutTrackingStage.java:62)
at software.amazon.awssdk.core.internal.http.pipeline.stages.ApiCallTimeoutTrackingStage.execute(ApiCallTimeoutTrackingStage.java:43)
at software.amazon.awssdk.core.internal.http.pipeline.stages.ApiCallMetricCollectionStage.execute(ApiCallMetricCollectionStage.java:50)
at software.amazon.awssdk.core.internal.http.pipeline.stages.ApiCallMetricCollectionStage.execute(ApiCallMetricCollectionStage.java:32)
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:210)
at software.amazon.awssdk.core.internal.handler.BaseSyncClientHandler.invoke(BaseSyncClientHandler.java:103)
at software.amazon.awssdk.core.internal.handler.BaseSyncClientHandler.doExecute(BaseSyncClientHandler.java:173)
at software.amazon.awssdk.core.internal.handler.BaseSyncClientHandler.lambda$execute$1(BaseSyncClientHandler.java:80)
at software.amazon.awssdk.core.internal.handler.BaseSyncClientHandler.measureApiCallSuccess(BaseSyncClientHandler.java:182)
at software.amazon.awssdk.core.internal.handler.BaseSyncClientHandler.execute(BaseSyncClientHandler.java:74)
at software.amazon.awssdk.core.client.handler.SdkSyncClientHandler.execute(SdkSyncClientHandler.java:45)
at software.amazon.awssdk.awscore.client.handler.AwsSyncClientHandler.execute(AwsSyncClientHandler.java:53)
at software.amazon.awssdk.services.kinesis.DefaultKinesisClient.listShards(DefaultKinesisClient.java:1624)
at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
at java.base/java.lang.reflect.Method.invoke(Method.java:580)
at jdk.proxy2/jdk.proxy2.$Proxy140.listShards(Unknown Source)
at org.apache.beam.sdk.io.aws2.kinesis.ShardListingUtils.listShards(ShardListingUtils.java:151)
at org.apache.beam.sdk.io.aws2.kinesis.SimplifiedKinesisClient.lambda$listShardsFollowingClosedShard$1(SimplifiedKinesisClient.java:113)
at org.apache.beam.sdk.io.aws2.kinesis.SimplifiedKinesisClient.wrapExceptions(SimplifiedKinesisClient.java:229)
at org.apache.beam.sdk.io.aws2.kinesis.SimplifiedKinesisClient.listShardsFollowingClosedShard(SimplifiedKinesisClient.java:112)
at org.apache.beam.sdk.io.aws2.kinesis.ShardRecordsIterator.findSuccessiveShardRecordIterators(ShardRecordsIterator.java:138)
at org.apache.beam.sdk.io.aws2.kinesis.ShardReadersPool.readFromSuccessiveShards(ShardReadersPool.java:344)
at org.apache.beam.sdk.io.aws2.kinesis.ShardReadersPool.readLoop(ShardReadersPool.java:183)
at org.apache.beam.sdk.io.aws2.kinesis.ShardReadersPool.lambda$startReadingShards$0(ShardReadersPool.java:143)
at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:572)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:317)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642)
at java.base/java.lang.Thread.run(Thread.java:1583)
Partial workaround
To fix the issue asap on our side we fixed in our fork the affected Java code yet it does not cover all the usages of affected API in other languages.
The updated classes were as follows:
What happened?
Description
AWS SDKv2 Kinesis API recently introduced a bug (confirmed by AWS on internal case) where listing shards fails when there are more than 1000 shards; StreamName is provided (or StreamFilter in general); Next Token is provided.
Reproduction
This can be reproduced by either using Kinesis
listShards
API by using one of the followingListShardRequest
examples for stream with more than 1000 shards:ListShardsRequest.builder().shardFilter(f -> f.type(type)).build()
ListShardsRequest.builder().shardFilter(shardFilter).maxResults(maxResults).build()
ListShardsRequest.builder().shardFilter(shardFilter).nextToken(nextListShardsToken).build()
The issue appears even when no
NextToken
is provided as it is automatically generated by theKinesisClient
.Example exception
Partial workaround
To fix the issue asap on our side we fixed in our fork the affected Java code yet it does not cover all the usages of affected API in other languages.
The updated classes were as follows:
sdks/java/io/amazon-web-services2/src/main/java/org/apache/beam/sdk/io/aws2/kinesis/ShardListingUtils.java
sdks/java/io/amazon-web-services2/src/test/java/org/apache/beam/sdk/io/aws2/kinesis/ShardListingUtilsTest.java
sdks/java/io/amazon-web-services2/src/main/java/org/apache/beam/sdk/io/aws2/kinesis/KinesisIO.java
Issue Priority
Priority: 2 (default / most bugs should be filed as P2)
Issue Components
The text was updated successfully, but these errors were encountered: