Thread: Postgres 13.3 times out when attempting to connect via odbc & pgAdmin4

Postgres 13.3 times out when attempting to connect via odbc & pgAdmin4

From
Kevin Struckhoff
Date:
Hi,

Just installed 13.3 on CentOS 8 runnning on a VM on my win 10 laptop. I am getting an error while running the odbc connection  test:

could not connect to server: connection timed out.

This error occurs also with pAdmin4.5.5.

on the CentOS server, I can see the correct ports listening:

tcp        0      0 0.0.0.0:5432            0.0.0.0:*               LISTEN      1154/postmaster
tcp6       0      0 :::5432                 :::*                    LISTEN      1154/postmaster

I have listen_addresses set to '*' in postgresql.conf. The 1st entry below didn't help:

#listen_addresses = '192.168.56.101, localhost'         # what IP address(es) to listen on;
listen_addresses = '*'

in the pg_hba.conf file I added the 3rd line below, since I've assigned a static IP address to the CentOS server:

# IPv4 local connections:
host    all             all             127.0.0.1/32            scram-sha-256
host     all         all         192.168.56.101/32    trust

Changing the IP number to 192.168.56.1/24 didn't help either, as expected I think.

I have Postgres 12. running on another VM and I had no trouble connecting using odbc and pgAdmin4.

Not sure what may have changed between the 2 versions to bring out this error.

The one thing I have noticed on 13.3 is that it now parses the listen_addresses = '192.168.56.101, localhost' string correctly. When I used this setting it opened port 5432 for both the static ip and 127.0.0.1. In 12.7, only the port 1st ip number would be opened. With the static IP listed first, postmaster wouldn't start automatically and if localhost was first, I couldn;t use odbc, etc.

What am I missing here?

Thanks. Kevin
On Mon, Jul 19, 2021 at 6:48 PM Kevin Struckhoff <kevinstruckhoff@yahoo.com> wrote:
Hi,

Just installed 13.3 on CentOS 8 runnning on a VM on my win 10 laptop.

What is your VM software?

 
I am getting an error while running the odbc connection  test:

could not connect to server: connection timed out.

Connection timeouts are almost always caused by firewalls or gateways.  It can't be due to pg_hba, as you are not getting far enough for that to kick in yet.

Cheers,

Jeff


Re: Postgres 13.3 times out when attempting to connect via odbc & pgAdmin4

From
Kevin Struckhoff
Date:
I'm running Oracle VBox 6.1. What doesn't make sense is that I can connect via putty, WinSCP and even at port 9090 for the CentOS web client (cockpit) using the static IP address.

I suspect there's a bug in VBox, because my other VM uses just a single network adaptor set to Bridged mode and it connects just fine. However, it only works at home and not on the road. Hence the need for a static IP.

Thanks. Kevin


On Tuesday, July 20, 2021, 11:02:31 AM PDT, Jeff Janes <jeff.janes@gmail.com> wrote:


On Mon, Jul 19, 2021 at 6:48 PM Kevin Struckhoff <kevinstruckhoff@yahoo.com> wrote:
Hi,

Just installed 13.3 on CentOS 8 runnning on a VM on my win 10 laptop.

What is your VM software?

 
I am getting an error while running the odbc connection  test:

could not connect to server: connection timed out.

Connection timeouts are almost always caused by firewalls or gateways.  It can't be due to pg_hba, as you are not getting far enough for that to kick in yet.

Cheers,

Jeff


- run netcat to ee if postgres is listening on port 5432.
- then telnet to port 5432 to see if it's open.

On 7/20/21 6:05 PM, Kevin Struckhoff wrote:
I'm running Oracle VBox 6.1. What doesn't make sense is that I can connect via putty, WinSCP and even at port 9090 for the CentOS web client (cockpit) using the static IP address.

I suspect there's a bug in VBox, because my other VM uses just a single network adaptor set to Bridged mode and it connects just fine. However, it only works at home and not on the road. Hence the need for a static IP.

Thanks. Kevin


On Tuesday, July 20, 2021, 11:02:31 AM PDT, Jeff Janes <jeff.janes@gmail.com> wrote:


On Mon, Jul 19, 2021 at 6:48 PM Kevin Struckhoff <kevinstruckhoff@yahoo.com> wrote:
Hi,

Just installed 13.3 on CentOS 8 runnning on a VM on my win 10 laptop.

What is your VM software?

 
I am getting an error while running the odbc connection  test:

could not connect to server: connection timed out.

Connection timeouts are almost always caused by firewalls or gateways.  It can't be due to pg_hba, as you are not getting far enough for that to kick in yet.

Cheers,

Jeff



--
Angular momentum makes the world go 'round.

Re: Postgres 13.3 times out when attempting to connect via odbc & pgAdmin4

From
Kevin Struckhoff
Date:
using netstat -tlpn:

tcp        0      0 127.0.0.1:5432          0.0.0.0:*               LISTEN      1142/postmaster
tcp        0      0 192.168.56.101:5432     0.0.0.0:*               LISTEN      1142/postmaster
tcp6       0      0 ::1:5432                :::*                    LISTEN      1142/postmaster

telnettting to 5432 fails.

Ports 22 and 9090 are open/listening and telnetting just fine. The problem must be on the Win 10 side.

Thanks. Kevin


On Tuesday, July 20, 2021, 5:49:59 PM PDT, Ron <ronljohnsonjr@gmail.com> wrote:


- run netcat to ee if postgres is listening on port 5432.
- then telnet to port 5432 to see if it's open.

On 7/20/21 6:05 PM, Kevin Struckhoff wrote:
I'm running Oracle VBox 6.1. What doesn't make sense is that I can connect via putty, WinSCP and even at port 9090 for the CentOS web client (cockpit) using the static IP address.

I suspect there's a bug in VBox, because my other VM uses just a single network adaptor set to Bridged mode and it connects just fine. However, it only works at home and not on the road. Hence the need for a static IP.

Thanks. Kevin


On Tuesday, July 20, 2021, 11:02:31 AM PDT, Jeff Janes <jeff.janes@gmail.com> wrote:


On Mon, Jul 19, 2021 at 6:48 PM Kevin Struckhoff <kevinstruckhoff@yahoo.com> wrote:
Hi,

Just installed 13.3 on CentOS 8 runnning on a VM on my win 10 laptop.

What is your VM software?

 
I am getting an error while running the odbc connection  test:

could not connect to server: connection timed out.

Connection timeouts are almost always caused by firewalls or gateways.  It can't be due to pg_hba, as you are not getting far enough for that to kick in yet.

Cheers,

Jeff



--
Angular momentum makes the world go 'round.
Kevin Struckhoff <kevinstruckhoff@yahoo.com> writes:
> telnettting to 5432 fails.
> Ports 22 and 9090 are open/listening and telnetting just fine. The problem must be on the Win 10 side.

Sure sounds like a firewall (packet filter) issue to me.
Maybe Windows is filtering port-5432 traffic, but it's
at least as likely that you need to open the port on
the server side.  Check the iptables configuration,
or whatever local equivalent you're using.

            regards, tom lane