I’m trying to connect to my database from the office where I work. The database is hosted in AWS and I’m using Datagrip. I have a whitelist.tf file included that has the office network added.
When testing the connection I mostly get the following message:
[08001] Connection to “myproject”.amazonaws.com:5432 refused. Check that the hostname and port are correct and that the postmaster is accepting TCP/IP connections.
But only once in a while I’m actually able to make a successful connection without changing any settings.
I then get:
DBMS: PostgreSQL (ver. 14.10)
Case sensitivity: plain=lower, delimited=exact
Driver: PostgreSQL JDBC Driver (ver. 42.6.0, JDBC4.2)
Ping: 47 ms
SSL: yes
This problem happens to anyone that is trying to make the connection from the office network/vpn. So it will not be related to my personal computer (I think). I’ve also verified the firewall rules for the network and even added a specific allow rule for the correct ip and port.
The problem does not persist when using any other network when working from home.
I don’t know if it’s related, but we also host nuget and npm packages in AWS. When restoring or npm installing from the office network, it takes really long. This is also not the case when working from home.
In any other case the network works perfectly fine.
I have no clue where I can look next. Are there settings in AWS that I can verify? Is there something in my database configuration that I can check? Any other options?
- Added the IP of the office in the whitelist.tf file
- Verified database credentials (sometimes the connection is successful)
- Verified firewall rules
- Verified if the problem only happens on my machine
- Verified that the problem does not happen at home
Matthias Van de Poel is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.