#12564 psql to db01.stg on batcave: error: could not connect to server: Connection timed out
Closed: Fixed with Explanation by zlopez. Opened by lbrabec.

Describe what you would like us to do:


Comand psql -U testdaysuser -d testdays -h db01.stg.iad2.fedoraproject.org -p 5432 on batcave fails with error:

psql: error: could not connect to server: Connection timed out
    Is the server running on host "db01.stg.iad2.fedoraproject.org" (10.3.166.32) and accepting
    TCP/IP connections on port 5432?

Connecting to prod db01 works as expected.

Quotes from infra channel by @zlopez:
"it would be somewhere in the network as the psql command itself is working on db01.stg directly"
"It seems that the issue is not in the nftrules, because there is a lot of allowed traffic comming from other IPs on the port, but when trying to watch for traffic from batcave I get none. There must be something else in the network that doesn't allow that."

When do you need this to be done by? (YYYY/MM/DD)


No rush :-)


Metadata Update from @zlopez:
- Issue priority set to: Waiting on Assignee (was: Needs Review)
- Issue tagged with: Needs investigation, low-gain, ops

I think this might be the RHIT native firewall between vlans here.

We can request the port opening, but... that might take a while and also I don't want to distract them from working on the rdu3 networking stuff. :)

Alternately, we can figure out access for you to some staging machine to run this. Not sure what one though....

Access to some staging machine sounds good, but there is really no need for rush :-) As workaround on stg I can just import psycopg2 in python repl (in pod terminal) and fix something there, it is less convenient but works.
Good thing is that psql connection to production db works, if we'd need that.

Ah yeah, if you have pod you can use for this, perhaps thats a better solution? The openshift cluster should always be able to access the database server.

As we are now in RDU3 and the issue is still there

psql -U testdaysuser -d testdays -h db01.stg.rdu3.fedoraproject.org -p 5432
psql: error: could not connect to server: Connection timed out
        Is the server running on host "db01.stg.rdu3.fedoraproject.org" (10.16.166.32) and accepting
        TCP/IP connections on port 5432?

Metadata Update from @zlopez:
- Issue assigned to zlopez

I checked and the port is open on our side, so I asked RH IT if they could open it.

This is resolved now.

[root@batcave01 zlopez][PROD-RDU3]# psql -U testdaysuser -d testdays -h db01.stg.rdu3.fedoraproject.org -p 5432
Password for user testdaysuser:

Metadata Update from @zlopez:
- Issue close_status updated to: Fixed with Explanation
- Issue status updated to: Closed (was: Open)

Metadata