简体   繁体   中英

DynamoDB Streams exception

I am trying to implement the Dynamodb Streams Java example from AWS. I get the following 2 errors repeated several times and then the program completes as expected. Any ideas what the cause is?

[error] c.a.s.k.c.l.w.ShardSyncTask - Caught exception while sync'ing Kinesis shards and leases
com.amazonaws.AmazonServiceException: null (Service: AmazonDynamoDBStreams; Status Code: 400; Error Code: UnknownOperationException; Request ID: VEPKVGT3GN8BSBP3A74LOEVIPVVV4KQNSO5AEMVJF66Q9ASUAAJG)
    at com.amazonaws.http.AmazonHttpClient.handleErrorResponse(AmazonHttpClient.java:1182) ~[aws-java-sdk-core-1.10.20.jar:na]
    at com.amazonaws.http.AmazonHttpClient.executeOneRequest(AmazonHttpClient.java:770) ~[aws-java-sdk-core-1.10.20.jar:na]
    at com.amazonaws.http.AmazonHttpClient.executeHelper(AmazonHttpClient.java:489) ~[aws-java-sdk-core-1.10.20.jar:na]
    at com.amazonaws.http.AmazonHttpClient.execute(AmazonHttpClient.java:310) ~[aws-java-sdk-core-1.10.20.jar:na]
    at com.amazonaws.services.dynamodbv2.AmazonDynamoDBStreamsClient.invoke(AmazonDynamoDBStreamsClient.java:638) ~[aws-java-sdk-dynamodb-1.10.20.jar:na]
    at com.amazonaws.services.dynamodbv2.AmazonDynamoDBStreamsClient.describeStream(AmazonDynamoDBStreamsClient.java:363) ~[aws-java-sdk-dynamodb-1.10.20.jar:na]
[error] c.a.s.d.s.m.AmazonServiceExceptionTransformer - Could not transform a DynamoDB AmazonServiceException to a compatible Kinesis exception
com.amazonaws.AmazonServiceException: null (Service: AmazonDynamoDBStreams; Status Code: 400; Error Code: UnknownOperationException; Request ID: JLVS3D8Q363LGGI60O42LDULBFVV4KQNSO5AEMVJF66Q9ASUAAJG)
    at com.amazonaws.http.AmazonHttpClient.handleErrorResponse(AmazonHttpClient.java:1182) ~[aws-java-sdk-core-1.10.20.jar:na]
    at com.amazonaws.http.AmazonHttpClient.executeOneRequest(AmazonHttpClient.java:770) ~[aws-java-sdk-core-1.10.20.jar:na]
    at com.amazonaws.http.AmazonHttpClient.executeHelper(AmazonHttpClient.java:489) ~[aws-java-sdk-core-1.10.20.jar:na]
    at com.amazonaws.http.AmazonHttpClient.execute(AmazonHttpClient.java:310) ~[aws-java-sdk-core-1.10.20.jar:na]
    at com.amazonaws.services.dynamodbv2.AmazonDynamoDBStreamsClient.invoke(AmazonDynamoDBStreamsClient.java:638) ~[aws-java-sdk-dynamodb-1.10.20.jar:na]
    at com.amazonaws.services.dynamodbv2.AmazonDynamoDBStreamsClient.describeStream(AmazonDynamoDBStreamsClient.java:363) ~[aws-java-sdk-dynamodb-1.10.20.jar:na]

We had the same problem, and it turned out we where missing the region in our settings, explicitly setting the region made it work.

For dynamodb-local you don't need a region though, so using that it will work without the region, and then when you deploy it in AWS you will get the above error.

The answer provided by @mikeal-sundberg didn't work for me, I eventually figured it was down to a difference between provided endpoints in AWS vs Dynamo local.

With Dynamo local you can use the same endpoint for the standard Dynamo client as well as the AmazonDynamoDBStreams client. When deployed, the AmazonDynamoDBStreams client needs a streams specific endpoint such as https://streams.dynamodb.eu-west-1.amazonaws.com .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM