79638646

Date: 2025-05-26 09:25:32
Score: 0.5
Natty:
Report link

Issue resolved:

It turned out that the Python script (using psycopg2) was connecting to 127.0.0.1:5432, which is IPv4.
However, the SSH tunnel was listening only on IPv6 — ::1:5432.

As a result:

In the code, I made an adjustment:
I forced psycopg2 to use IPv6 by specifying local_bind_address, and it automatically selected a free port.

Reasons:
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Self-answer (0.5):
  • Low reputation (1):
Posted by: Виталий Тищенко