"Internal server error" when trying to put new data in DynamoDB table with no error logs

Hello all!

I am using serverless with aws and am having some issues with DynamoDB.

Here is my code, it is very basic: https://hastebin.com/etumumubap.js

Here is my serverless file, with some info revoked: https://hastebin.com/wixudisagu.bash

The way it works is very basic, just send a POST request with the JSON in the body and it will push to DynamoDB. But anytime I send the POST request, I get met with “Internal server error” response, with no errors in the logs at all. All I get is the normal start/end messages, any stuff I logged myself, and the normal billing message. Nothing else. It seems like my callback that I pass through the put function for DynamoDB is not being called, otherwise I would at least see the console.log messages from there. I even wrapped all the code in a try catch and it didn’t catch any errors, so I’m really not sure what to do. I also tried adding a longer timeout but that did nothing as I expected.

I have followed numerous tutorials and I can never seem to get it to work unless I just clone the project the tutorial provides for me and I deploy that, but I follow the tutorial exactly and most of the code I have is copy/pasted anyways. Everything deploys with no problem. Any kind of help is appreciated.

Also I am using sls version 1.38.0

1 Like

I’m having a similar issue but I can’t see your files because the links you posted are blank.

Maybe your lambda is inside a vpc and cannot access DDB. If that’s the case you can simply add an endpoint (I think that’s the name) to DDB that lets the vpc objects to speak with DDB.
Also check the security groups…