2

I have a lambda function that connects to RDS instance using AWS RDS Proxy. I occasionally get timeout errors when connecting to RDS DB instance. I have plenty of connections in the pool. I use rds proxy userid & pass to connect

ERROR:

{
    "errorType": "Error",
    "errorMessage": "connect ETIMEDOUT",
    "code": "ETIMEDOUT",
    "errorno": "ETIMEDOUT",
    "syscall": "connect",
    "fatal": true,
    "stack": [
        "Error: connect ETIMEDOUT",
        "    at Connection._handleTimeoutError (/var/task/node_modules/mysql2/lib/connection.js:178:17)",
        "    at listOnTimeout (internal/timers.js:554:17)",
        "    at processTimers (internal/timers.js:497:7)"
    ]
}

I use nodejs 12 version and mysql2 for db access. SQS queue is added as a trigger to Lambda and it processes the messages received from the queue

There is no issue with the security groups. Lambda and RDS Proxy is part of the same security Group. Moreover this timeout happens only few times. How do i debug this issue?

Ann
  • 217
  • 1
  • 9
  • If you are trying to connect to RDS from a Lambda function, how are you handling the Inbound Rules? – smac2020 Jan 19 '21 at 18:23
  • Please see additional info i added above. timeouts happen once in a while, not all the time – Ann Jan 19 '21 at 18:34
  • @Ann Any luck with troubleshooting this? – Kamil Bednarz Jun 24 '21 at 11:34
  • @Ann I'm experiencing the same problem with Python lambda talking to RDS Proxy PostgreSQL. I saw this happening yesterday every 30-60 minutes. (some context: Python 3.8, ZIP file with 40MB of dependencies, 1024MB RAM) when ConcurrentExecutions metric was going up by 1 (not every single time though). I'm still on the fence if this was a cold-start thing (rather not) or something related to RDS Proxy & connection management. – Kamil Bednarz Jun 24 '21 at 11:43
  • I have been running into this exact same issue. It's driving us nuts. Everything will be fine for weeks, and then all of a sudden we get the etimedout error. Are you trying to reuse the connections yourself from inside your node call? That is my latest guess for us: that our node.js code and rds proxy are both trying to manage our connections and eventually things go awry. – John Paschal Jan 25 '22 at 20:36

0 Answers0