Amazon Web Services – Fixing ‘Timeout Expired’ Error When Connecting to RDS PostgreSQL with pgAdmin

amazon-rdsamazon-web-servicespostgresql

I am trying to connect to a Postgres RDS instance with pgAdmin, and I get the vague error 'timeout expired' every single time. This situation is especially strange, because my colleagues who are all on the same network can connect with no issues. This is leading me to think it's an issue on my computer.

What I've tried on my computer:

  • Restarting my PC
  • Reinstalling PostgreSQL
  • Turning off my computer's firewalls
  • Trying to connect from a fresh Windows 10 virtual machine (on the same computer)
  • Connecting with 3 different database managers: psql, DataGrip & OmniDB (Same result)
  • Verified that the domain name is being correctly resolved by my DNS (It is)
  • Connecting on a different local IP address and network interface

What I've tried on AWS:

  • Verified that the RDS instance is publicly accessible
  • Changed the security group for my RDS instance to Accept All traffic from my IP per related questions

None of these ideas have made a difference unfortunately

Edit:
Starting windows in safe mode with networking resolves this issue (although this isn't a practical fix). This makes me think a program or service that gets run on start up may be the culprit.

Best Answer

So it turns out, restarting the computer in 'Safe Mode with Networking' did the trick and I can now connect to remote postgres servers. This link from Microsoft was especially useful in accomplishing this: https://support.microsoft.com/en-us/windows/start-your-pc-in-safe-mode-in-windows-10-92c27cff-db89-8644-1ce4-b3e5e56fe234 (Although they will more than likely break that link, so my apologies to posterity).

Hopefully the list of things I've tried here helps someone else out in the future who's troubleshooting a similar issue.