1

I have put together an Amazon RDS using Postgres. I can connect to the database via pgAdminIII on my Mac and my PC without any problems. But some folks trying to connect to my RDS site get the traditional timeout message.

Is there a way to debug pgAdminIII client pc/mac issues that might cause failure to connect?

The stackoverflow Q/A so far seem to be dedicated to first time connection from pgAdmin to Amazon RDS running PostgreSQL. Unlike those issues, some of my users simply can not connect to a known working database.

I am looking for ping, traceroute type tests that point to a firewall or other client PC/Mac setup problem????

2
  • Is it setup to allow the connection in pg_hba config file? Commented Mar 10, 2015 at 3:37
  • Thank you for your interest nhahtdh. I am not sure if Amazon RDS uses this config file since linux or other os is not exposed with Amazon RDS. Just the Postgres db and a virtual router where both are likely set up correctly since others can connect. Commented Mar 10, 2015 at 23:12

1 Answer 1

2

I have reduced the problem to "Why are some pc/mac clients blocked from using the Amazon RDS port number: 5432 ?

On my home network, I can use port 5432, but other folks at their location (with their software and hardware security) can not.

Step 1

Test for valid instance name and port access (for mac or windows)

In a terminal window (for mac) or a CMD window (for PC) type this telent expression:

telnet xtrf3.[your host details].amazonaws.com 5432

Where the xtrf3.. portion of the telnet command. is the link to our PostgreSQL instance running on Amazon, and 5432 is the port number

If the telent test fails due to port number issues, you will get a long wait (maybe 2 minutes) for "connecting to xtrf…” followed by: “Could not open connection to the host, on port 5432: Connect failed”

If the telnet test fails due to invalid Amazon RDS instance name, you will quickly get the following error: “Connecting To xtrf3.[your host details].amazonaws.com...Could not open connection to the host, on port 5432: Connect failed”

If the telnet test is successful you will get a blank screen very quickly. In this case your pc or mac can find the PostgreSQL instance using the required port number

Step 2

Assuming step 1 shows that the postgreSQL instance is active on Amazon RDS, but connection times out: I discovered that the Amazon EC-2 security setting for inbound traffic was incorrect.

In my case I set up inbound TCP source address to be my home Internet provider IP address. So I could connect from home, but no one at the office or at wifi locations could connect. Changing the source address to "all" or 0.0.0.0/0 fixed the problem. Security is weaker, but the service is still password protected and good enough for this project.

One could create separate EC-2 inbound entries for each location where access is required, and eliminate the generic access to all as a further refinement once it is clear that the EC-2 security group setting was the problem.

enter image description here

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.