Using AsyncPostgresSaver with Supabase's session pooler crashes with psycopg.OperationalError #2967
Replies: 3 comments
-
Hey, |
Beta Was this translation helpful? Give feedback.
-
I am having this issue also. after some time the connection gets lost. what I tried for now is this. whenever a connection is lost, i reconnect it automatically in my workflow. some how it is working, but not an optimal solution. So looking for that. |
Beta Was this translation helpful? Give feedback.
-
I managed to solve it by using the following parameters
I manually close the connections when needed. In my case it seemed like the "autocommit" function was creating many redundant connections and this fixed it. Not sure if this is helpful to you though |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hello all! I hope you are doing well. I am having issues with the psycopg.OperationalError and AsyncConnectionPool. I am using FastAPI in a container that is deployed on AWS AppRunner. Given that AppRunner doesn't have outgoing IPv6, I cannot directly use Supabase's postgres URL
postgresql://postgres:[YOUR-PASSWORD]@db.[PROJECT-ID].supabase.co:5432/postgres
.Therefore, I have to go through the Session pooler:
postgresql://postgres.[PROJECT-ID]:[YOUR-PASSWORD]@aws-0-eu-west-3.pooler.supabase.com:5432/postgres
.Here is how I instanciate my pool:
Unfortunately, I am randomly having the error
psycopg.OperationalError: consuming input failed: server closed the connection unexpectedly
when the code tries to executeI tried using:
but it still doesn't work. I looked on Supabase what connections are there and I can see 4 idle connections yet it crashed with the error mentioned above:
I would be really grateful for any help on this subject. This is the last step missing to put our chatbot with LangGraph's superpowers into production. Thank you very much for your time!
Beta Was this translation helpful? Give feedback.
All reactions