Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

AWS DynamoDB Requested resource not found

I am trying to connect my app to DynamoDB. I have set everything up the way Amazon recommends. But i still keep getting the same error over and over again:

   7-21 11:02:29.856  10027-10081/com.amazonaws.cognito.sync.demo E/AndroidRuntime﹕ FATAL EXCEPTION: AsyncTask #1     Process: com.amazonaws.cognito.sync.demo, PID: 10027     java.lang.RuntimeException: An error occured while executing doInBackground()             at android.os.AsyncTask$3.done(AsyncTask.java:304)             at java.util.concurrent.FutureTask.finishCompletion(FutureTask.java:355)             at java.util.concurrent.FutureTask.setException(FutureTask.java:222)             at java.util.concurrent.FutureTask.run(FutureTask.java:242)             at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:231)             at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)             at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)             at java.lang.Thread.run(Thread.java:818)      Caused by: com.amazonaws.services.dynamodbv2.model.ResourceNotFoundException: Requested resource not found (Service: AmazonDynamoDBv2; Status Code: 400; Error Code: ResourceNotFoundException; Request ID: GIONOKT7E3AMTC4PO19CPLON93VV4KQNSO5AEMVJF66Q9ASUAAJG)             at com.amazonaws.http.AmazonHttpClient.handleErrorResponse(AmazonHttpClient.java:710)             at com.amazonaws.http.AmazonHttpClient.executeHelper(AmazonHttpClient.java:385)             at com.amazonaws.http.AmazonHttpClient.execute(AmazonHttpClient.java:196)             at com.amazonaws.services.dynamodbv2.AmazonDynamoDBClient.invoke(AmazonDynamoDBClient.java:2930)             at com.amazonaws.services.dynamodbv2.AmazonDynamoDBClient.updateItem(AmazonDynamoDBClient.java:930)             at com.amazonaws.mobileconnectors.dynamodbv2.dynamodbmapper.DynamoDBMapper$SaveObjectHandler.doUpdateItem(DynamoDBMapper.java:1173)             at com.amazonaws.mobileconnectors.dynamodbv2.dynamodbmapper.DynamoDBMapper$2.executeLowLevelRequest(DynamoDBMapper.java:873)             at com.amazonaws.mobileconnectors.dynamodbv2.dynamodbmapper.DynamoDBMapper$SaveObjectHandler.execute(DynamoDBMapper.java:1056)             at com.amazonaws.mobileconnectors.dynamodbv2.dynamodbmapper.DynamoDBMapper.save(DynamoDBMapper.java:904)             at com.amazonaws.mobileconnectors.dynamodbv2.dynamodbmapper.DynamoDBMapper.save(DynamoDBMapper.java:688)             at com.amazonaws.cognito.sync.Utils.FriendsSyncManager.initalize_credentialprovider(FriendsSyncManager.java:43)             at com.amazonaws.cognito.sync.ValU.FriendListActivity$SyncFriends.doInBackground(FriendListActivity.java:168)             at com.amazonaws.cognito.sync.ValU.FriendListActivity$SyncFriends.doInBackground(FriendListActivity.java:160)             at android.os.AsyncTask$2.call(AsyncTask.java:292) 

            What could be the solution?   

like image 791
Cédric Portmann Avatar asked Jul 21 '15 15:07

Cédric Portmann


People also ask

What causes DynamoDB system errors?

The most likely cause of a failed read or a failed write is throttling. For BatchGetItem , one or more of the tables in the batch request does not have enough provisioned read capacity to support the operation. For BatchWriteItem , one or more of the tables does not have enough provisioned write capacity.

How many requests per second can DynamoDB handle?

Fast and flexible NoSQL database service for any scale DynamoDB can handle more than 10 trillion requests per day and can support peaks of more than 20 million requests per second.

What are DynamoDB system errors?

The SystemErrors metric is incremented each time DynamoDB responds with a 500 HTTP error. This metric means that the DynamoDB service is experiencing internal errors, which can be correlated with issues you are seeing in the rest of your application.

What is DynamoDBMapper?

The DynamoDBMapper class is the entry point to Amazon DynamoDB. It provides access to a DynamoDB endpoint and enables you to access your data in various tables. It also enables you to perform various create, read, update, and delete (CRUD) operations on items, and run queries and scans against tables.


2 Answers

Okey it seems you need to add:

ddbClient.setRegion(Region.getRegion(Regions.EU_WEST_1));   // Add correct Region. In my case its EU_WEST_1 

after the following line:

AmazonDynamoDBClient ddbClient = new AmazonDynamoDBClient(credentialsProvider); 

Now it works. The table was successfully created. Have a nice day and thanks!

like image 95
Cédric Portmann Avatar answered Sep 22 '22 12:09

Cédric Portmann


It seems that the table you are trying to connect to doesn't exist. Verify the table name in your code agains the name of the table you created.

Please note that table name is case sensative.

like image 43
0x90 Avatar answered Sep 21 '22 12:09

0x90