waha icon indicating copy to clipboard operation
waha copied to clipboard

[BUG][NOWEB] - Delete Session - Error: async-lock timed out in queue {{session_id_here}}

Open matteus-siqueira opened this issue 11 months ago • 2 comments

I have a persistent problem, some sessions have an error status, this is normal. The problem is that when I tried to delete these sessions they changed to stopped and got stuck in this status, when I try to delete them again the API gives the following error:

{{session_id_here}} Status: 500 Response: {"statusCode":500,"timestamp":"2025-02-27T00:04:49.539Z","exception":{"stack":"Error: async-lock timed out in queue {{session_id_here}}\n at Timeout._onTimeout (/app/node_modules/async-lock/lib/index.js:213:17)\n at listOnTimeout (node:internal/timers:594:17)\n at process.processTimers (node:internal/timers:529:7)","message":"async-lock timed out in queue {{session_id_here}}","name":"Error"},"request":{"path":"/api/sessions/{{session_id_here}}","method":"DELETE","bo dy":{},"query":{}},"version":{"version":"2025.2.5","engine":"NOWEB","tier":"PLUS","browser":"/usr/bin/chromium"}}

patron:PLUS

matteus-siqueira avatar Feb 27 '25 00:02 matteus-siqueira

I forgot to say, I use postgresql

patron:PLUS

matteus-siqueira avatar Feb 27 '25 00:02 matteus-siqueira

when you execute DELETE, could you send the logs from docker container? There're few steps and I don't understand where it stucks 🤔 how many sessions is there right now? Did you increased the number of client for postgresql btw?

postgres -c max_connections=3000

When it happens could you run the command in psql server pls

show max connections number:

SHOW max_connections; 

Show the active connections (it'll help understand where it stucks as well)

SELECT * FROM pg_stat_activity;

If you have 1000 max connections, may be you have more in the server 🤔

Let's monitor it and when it happens again - pls try the above steps to find the root cause 🙏

patron:PRO

devlikepro avatar Mar 02 '25 06:03 devlikepro

Added a small fix for that issue in 2025.5.4 🤞

patron:PRO

devlikepro avatar May 23 '25 07:05 devlikepro