close

[Solved] Postgres SSL SYSCALL : EOF detected with python and psycopg

Hello Guys, How are you all? Hope You all Are Fine. Today I get the following error Postgres SSL SYSCALL : EOF detected with python and psycopg in python. So Here I am Explain to you all the possible solutions here.

Without wasting your time, Let’s start This Article to Solve This Error.

How Postgres SSL SYSCALL : EOF detected with python and psycopg Error Occurs?

Today I get the following error Postgres SSL SYSCALL : EOF detected with python and psycopg in python.

How To Solve Postgres SSL SYSCALL : EOF detected with python and psycopg Error ?

  1. How To Solve Postgres SSL SYSCALL : EOF detected with python and psycopg Error ?

    To Solve Postgres SSL SYSCALL : EOF detected with python and psycopg Error If you want to kill the processes from long_running just comment out the last line and insert SELECT pg_cancel_backend(long_running.pid) from long_running ;

  2. Postgres SSL SYSCALL : EOF detected with python and psycopg

    To Solve Postgres SSL SYSCALL : EOF detected with python and psycopg Error If you want to kill the processes from long_running just comment out the last line and insert SELECT pg_cancel_backend(long_running.pid) from long_running ;

Solution 1

I ran into this problem when running a slow query in a Droplet on a Digital Ocean instance. All other SQL would run fine and it worked on my laptop. After scaling up to a 1 GB RAM instance instead of 512 MB it works fine so it seems that this error could occur if the process is running out of memory.

Solution 2

Very similar answer to what @FoxMulder900 did, except I could not get his first select to work. This works, though:

WITH long_running AS (
    SELECT pid, now() - pg_stat_activity.query_start AS duration, query, state
    FROM pg_stat_activity
    WHERE (now() - pg_stat_activity.query_start) > interval '1 minutes'
      and state = 'active'
)
SELECT * from long_running;

If you want to kill the processes from long_running just comment out the last line and insert SELECT pg_cancel_backend(long_running.pid) from long_running ;

Summery

It’s all About this issue. Hope all solution helped you a lot. Comment below Your thoughts and your queries. Also, Comment below which solution worked for you? Thank You.

Also, Read