SASL: Last message was not SASLResponse
Hi, I'm using node-pg in a serverless environment and I often see the following error:
Unhandled Rejection: Error: SASL: Last message was not SASLResponse
at /var/task/apps/lawy/.next/server/chunks/9840.js:1:2550
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async a.acquireConnection (/var/task/apps/lawy/.next/server/chunks/9840.js:1:58997)
I can see in code that it gets called in finalizeSession https://github.com/brianc/node-postgres/blob/e25428c8dceb86eb4277af90155295fd0188abce/packages/pg/lib/crypto/sasl.js#L62
When would this error happen?
Thanks for your help.
Hey @blechatellier - i need more code to reproduce this issue. if you can reproduce this in an isolated environment & provide the code I'm more than happy to take a look. Otherwise...not sure? Could be pg-bouncer? Or some misconfigured password somewhere?
Also having this problem - in a serverless function.
i need more code to reproduce this issue. if you can reproduce this in an isolated environment & provide the code I'm more than happy to take a look.
@jonnicholson94 - any way you could share with me some code that reproduces the problem? 🙏
@brianc sorry for the late reply, some of those issues were because of the supabase pooler terminating some connections randomly, the issue has been fixed on their side and this hasn't happened since.
I am also using supabase in my project facing this problem. I am still having this issue. Cloud you tell me how to fix this? @blechatellier
It was related to a change they did and fixed on their side https://github.com/supabase/supavisor/issues/344
I've also encountered that issue in the past with an onCompletion callback from streaming an AI response that was called async after the connection was closed.