user2604705
user2604705

Reputation: 99

Local stack DynamoDB is not working

I am tring to test my AWS resources locally. I found a very nice docker image which has almost all the serives avaible and same can be used for local testing. One of the services for DynamoDB is not working. This is also for my application.

I google it a lot, but I am not able to find the root cause. As per my docker container logs. Below are the logs.

docker run -it -p 4567-4578:4567-4578 -p 8080:8080 localstack/localstack

2018-07-30T12:49:17:ERROR:localstack.services.generic_proxy: Error forwarding request: expected string or buffer Traceback (most recent call last): File "/opt/code/localstack/localstack/services/generic_proxy.py", line 181, in forward path=path, data=data, headers=forward_headers) File "/opt/code/localstack/localstack/services/dynamodb/dynamodb_listener.py", line 35, in forward_request TypeError: expected string or buffer

Upvotes: 2

Views: 10770

Answers (1)

y4h2
y4h2

Reputation: 3383

I think you are using wrong port. The answer can be find in localstack's issue list: https://github.com/localstack/localstack/issues/675

The DynamoDB's GUI in localstack is running on port 4564. Run following command, then you are able to access the GUI on localhost:4564/shell

docker run -d -p 4569:4569 -p 4564:4564 localstack/localstack:latest

connection code

const dynamoose = require('dynamoose');
const AWS = require('aws-sdk');

dynamoose.local('http://localhost:4569');

dynamoose.AWS.config.update({
  region: 'us-east-1',
});
const Purchase = dynamoose.model('test', {
  test: {
    type: String,
    hashKey: true,
  }
}, {
  update: true,
});

Upvotes: 1

Related Questions