Ad
DynamoDB Local Throws Method Not Allowed Via SDK
I'm trying to use DynamoDB Local. It works perfectly fine using the AWS CLI, but when I try to use it with the AWS SDK in Node, I keep getting a "Method Not Allowed" error. The same code works perfectly fine with the real DynamoDB, so I know it's not an issue with the code.
This is how I've setup the SDK. My understanding is the region is ignored, so it doesn't matter.
new DocumentClient({
region: 'local',
endpoint: 'http://localhost:8000',
sslEnabled: false,
})
Node just gives me:
UnknownError: Method Not Allowed
at Request.extractError (/.../node_modules/aws-sdk/lib/protocol/json.js:51:27)
at Request.callListeners (/.../node_modules/aws-sdk/lib/sequential_executor.js:106:20)
at Request.emit (/.../node_modules/aws-sdk/lib/sequential_executor.js:78:10)
at Request.emit (/.../node_modules/aws-sdk/lib/request.js:683:14)
at Request.transition (/.../node_modules/aws-sdk/lib/request.js:22:10)
at AcceptorStateMachine.runTo (/.../node_modules/aws-sdk/lib/state_machine.js:14:12)
at /.../node_modules/aws-sdk/lib/state_machine.js:26:10
at Request.<anonymous> (/.../node_modules/aws-sdk/lib/request.js:38:9)
at Request.<anonymous> (/.../node_modules/aws-sdk/lib/request.js:685:12)
at Request.callListeners (/.../node_modules/aws-sdk/lib/sequential_executor.js:116:18)
I'm running DynamoDB Local on macOS 10.14.6 with Java:
java version "1.8.0_60"
Java(TM) SE Runtime Environment (build 1.8.0_60-b27)
Java HotSpot(TM) 64-Bit Server VM (build 25.60-b23, mixed mode)
But I also tried with Amazon's Docker image and still the same error.
Ad
Answer
The port was in use by another application. And Java didn't bother to mention it when starting the DynamoDB Local server...
But that doesn't explain why the AWS CLI was working. Now I'm confused...
Ad
source: stackoverflow.com
Related Questions
- → Maximum call stack exceeded when instantiating class inside of a module
- → Browserify api: how to pass advanced option to script
- → Node.js Passing object from server.js to external modules?
- → gulp-rename makes copies, but does not replace
- → requiring RX.js in node.js
- → Remove an ObjectId from an array of objectId
- → Can not connect to Redis
- → React: How to publish page on server using React-starter-kit
- → Express - better pattern for passing data between middleware functions
- → Can't get plotly + node.js to stream data coming through POST requests
- → IsGenerator implementation
- → Async/Await not waiting
- → (Socket.io on nodejs) Updating div with mysql data stops without showing error
Ad