Monday, 22 June 2020

Trouble moving my Node/express server to AWS. pg.connect callback never invoked.

I have a working web site running Express and talking to a postgres DB on Heroku. On heroku I'm using their managed node server so I dont see the OS and i push from git right using their scripts. I connect to the DB using a connection string they are providing.Now trying to Move to AWS and setting it all up myself on an EC2 instance (which is linux box). I have everything set up and the security seems correct. From the ec-2 instance I can use PSQL to connect to the postgres DB. BUT....From with in Express I can't see to connect. I'm using the pg NPM I've tried setting all the enviorment variable (PGHOST, PGPASSWORD etc), I've tried passing them in a json, I've tried the json as both individual items and as a connection string. The same exact connection string works from the command line with psql.The connection and any query simply never call the callback so they basically hang and do nothing. I dont have any error code or feedback to go on.How can I debug this?

Submitted June 22, 2020 at 04:25PM by Sislar

No comments:

Post a Comment