psycopg / psycopg2

PostgreSQL database adapter for the Python programming language
https://www.psycopg.org/
Other
3.31k stars 503 forks source link

copy_expert raises invalid socket error without any debug'able traceback. #1689

Closed Krishnasai3cks closed 5 months ago

Krishnasai3cks commented 5 months ago

Specs:

I'm getting

---------------------------------------------------------------------------
OperationalError                          Traceback (most recent call last)
Cell In[5], line 25
     23     curr_file = output_file.read()
     24     output_file.seek(0)
---> 25     cursor.copy_expert(query, output_file)
     26 conn.commit()
     27 conn.close()

OperationalError: invalid socket

This is only happening on my production database. It just says invalid socket and the traceback ends. I'm unable to figure out the root cause of this issue. I've tried to search online for any leads but there aren't any.

I try the same commands in my local system and it doesn't fail. My Local System Specs:

Just some leads why this error might occur would be of great help.

dvarrazzo commented 5 months ago

I think you should look at your server logs.