Question

Postgres database connection timeout

I have a Postgres database on digitalocean. I am able to connect to it from my pod in Kubernetes. However, when I try to connect to it using pgadmin, or sqlectron, I get connection timeouts.

Error invoking remote method 'DB_CONNECT': Error: connect ETIMEDOUT

The logs show that it connects, then times out. Please what am I missing?

I have added my ip address to the trusted sources for the database.

image alt text
image caption

Submit an answer


This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Bobby Iliev
Site Moderator
Site Moderator badge
May 19, 2023

Hi there,

It sounds like you might have a dynamic IP address, I could suggest verifying that your IP has not changed by visiting a website like https://ifconfig.io/ for example.

If your IP has changed, I could suggest adding the new one to the trusted sources and then trying again.

If your IP is still the same I could suggest a few more things:

  • Check if you can actually reach the port using telnet for example:
telnet your_database_url 25061
  • If telnet works, try connecting with psql to verify that it is not a problem with the SQL client that you are using
  • If your IP address is changing frequently, you might want to spin up a VPN server and use it to connect to your database instead:

https://marketplace.digitalocean.com/apps/openvpn-access-server

Let me know how it goes!

Best,

Bobby

Try DigitalOcean for free

Click below to sign up and get $200 of credit to try our products over 60 days!

Sign up

Get our biweekly newsletter

Sign up for Infrastructure as a Newsletter.

Hollie's Hub for Good

Working on improving health and education, reducing inequality, and spurring economic growth? We'd like to help.

Become a contributor

Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.

Welcome to the developer cloud

DigitalOcean makes it simple to launch in the cloud and scale up as you grow — whether you're running one virtual machine or ten thousand.

Learn more
DigitalOcean Cloud Control Panel