Can't connect to external database

bennettcolecohenTRIAL

a year ago

I have a simple express server that does the following on startup:

  • Fetches my database (RDS) credentials from the AWS secrets manager

  • Downloads the SSL certificate from S3 to store in root directory

  • Creates a connection string and connects to the database.

It currently gets hung up trying to connect and eventually times out.

Why is this?

Here’s what I’ve done to debug:

  • Verified this runs locally. I’m not using a VPC with my database

  • Verified the connection string using psql

  • I'm also confident the file is being dumped into the root properly

Any tips would be greatly appreciated.

7 Replies

a year ago

It currently gets hung up trying to connect and eventually times out. Why is this?

With the information provided, I have no way of answering this correctly, firewall perhaps?

My recommendation would be to add extremely verbose logging so that you are sure every little bit of code is doing what it should.


bennettcolecohenTRIAL

a year ago

Yeah totally get it. There are a bunch of things that could be going wrong. It sets the connection string properly starts trying to connect, but never finishes. Server crashed when it times out :/


bennettcolecohenTRIAL

a year ago

I suppose it could totally be an RDS problem.


a year ago

Could be many things, and verbose logging is likely to help you narrow it down.


bennettcolecohenTRIAL

a year ago

Yup. logged verbosely and kinda just stuck @ this starting to connect from node-postgres…not sure how much more verbose I could get. Any tips?


a year ago

Run a database on Railway instead haha.


servicePRO

a year ago

Hello, I have my Database (RDS) running in AWS, I want to migrate data to mysql or postgresql. Which one do you prefer?