Hey all. Pretty new to this so apologies if I misspeak on anything.
Right now I’m using serverless-http to run my express app. I’m able to ping a simple hello world endpoint from postman, however whenever I attempt to connect to my RDS through Knex, I always timeout (around 6 seconds) and get an “Internal Service Error”.
My vpc in my serverless.yaml is set with the appropriate securityGroupIds/subnetIds
Does anyone know what could be the issue, whether with rds or serverless? As well, does anyone have any tips on debugging issues like this that give the opaque internal server error? Much appreciated!
Make sure you are logging your errors and then take a look at CloudWatch logs to see what the issue is. It sounds like your Lambda is throwing errors that you’re not catching, so an invalid response is being sent to API Gateway.
Also, look at using the serverless-offline plugin so that you can run your API locally. You can either connect to a local database, or use a VPN or SSH tunnel to connect to your remote one for testing.
Ah yes I forgot to mention that the app works fine when running on serverless-offline and a local postgres instance, which is why I suspect it is something to do with rds/vpc configuration.