Frequent Postgres Connection Failures in n8n (TLS handshake, DNS EAI_AGAIN, timeouts) with AWS RDS

Hi n8n community :waving_hand:,

I’m facing frequent and intermittent PostgreSQL connection failures in my self-hosted n8n setup, and I’m trying to understand whether this is an n8n issue, Node.js behavior, or something related to AWS RDS networking/DNS.

I’ve self-hosted n8n in Vultr VM . n8n’s own db is postgres db that is hosted inside docker.

In my workflows , I’m connecting to external postgres DBs using the postgres db nodes of n8n.

Observed Errors (intermittent)

The same simple queries fail randomly at random times :

:one: TLS handshake failure

Client network socket disconnected before secure TLS connection was established

:two: DNS resolution failure

getaddrinfo EAI_AGAIN datacurve-crawling-database.cs9o80ocag8d.us-east-1.rds.amazonaws.com
The DNS server returned an error, perhaps the server is offline

:three: Connection timeout

Connection timed out
100.31.27.197:5432

What I’ve Checked

Query complexity: :cross_mark: Not an issue (simple COUNT queries)

n8n workflow logic: :cross_mark: Not the issue (fails at connection level)

This is impacting scheduled workflows, and I’m trying to determine whether:

This is an n8n Postgres node issue

A Node.js DNS/TLS issue

Or an AWS RDS networking edge case

Thanks in advance!

hello @gaurav.pant

Seems you have a network issue on the n8n instance. DNS and TLS are mostly affected by the host; n8n is just a consumer.

so , the problem is with my AWS database ?
n8n should work ?

not the database, the host instance of the n8n (where it resides). in AWS usually it’s an EC2 instance.