PostgreSQL connections are not released after QR/reconnect failures
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 45/100
Direzione di ricerca
Inizia riproducendo i flussi QR, riconnessione e inizializzazione della sessione non riuscita, monitorando al contempo le connessioni PostgreSQL dal container Evolution GO. Esamina i percorsi del database coinvolti in questi flussi, insieme a evolution-client.ts e functions/evolution-send-text/index.ts, per il problema di invio segnalato; il lavoro è completato quando i tentativi non riusciti non accumulano più connessioni inattive né esauriscono max_connections.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Welcome!
- Yes, I have searched for similar issues on GitHub and found none.
What did you do?
I am running Evolution GO in Docker with PostgreSQL 15 on Linux.
Environment summary:
- evolution-go: 0.7.2
- Docker image: evoapicloud/evolution-go:0.7.2
- PostgreSQL 15
- standalone Docker Compose deployment
I have 2 WhatsApp instances.
After QR generation / reconnect attempts, the application started failing to reconnect properly. During investigation, I checked PostgreSQL activity and noticed a large number of idle connections coming from the Evolution GO container, especially against the auth database.
At one point, PostgreSQL reached the connection limit and Evolution GO started failing on QR and send flows.
Restarting only the evolution-go container released those connections and the QR flow started working again.
This looks like database connections may not be properly released after failed initialization or reconnect attempts.
What did you expect?
I expected Evolution GO to reuse or release PostgreSQL connections correctly during QR generation, reconnect attempts, and failed session initialization.
Even if an instance fails to reconnect, the application should not keep accumulating idle database connections until PostgreSQL reaches max_connections.
What did you observe instead of what you expected?
Instead, PostgreSQL connections kept accumulating as idle connections from the Evolution GO container.
After enough reconnect / QR attempts, PostgreSQL started returning connection limit errors and Evolution GO stopped working correctly.
Observed effects:
- QR code endpoint failed
- send flows failed
- instance/session state became inconsistent
- application logs later showed "no active session found"
The issue was temporarily resolved by restarting only the evolution-go container, which immediately reduced the number of open PostgreSQL connections.
Screenshots/Videos
I can provide:
- screenshots of the disconnected instance state
- QR refresh failure
- logs showing "no active session found"
- PostgreSQL connection counts before and after restarting the container
Which version are you using?
0.7.2
Docker image: evoapicloud/evolution-go:0.7.2
PostgreSQL 15
What is your environment?
Linux
If applicable, paste the log output
Initial related error:
failed to upgrade database: failed to check if version table is up to date: pq: sorry, too many clients already
Later application error:
Erro ao enviar texto: Error: no active session found
at request (.../functions/_shared/evolution-client.ts:404:13)
at async Server. (.../functions/evolution-send-text/index.ts:50:20)
Database observation:
- max_connections: 100
- idle connections reached: 99 for the auth database
- after restarting only the evolution-go container, connections dropped back to normal
Additional Notes
This report is based on repeated behavior in production.
I cannot fully confirm yet whether this is an upstream bug or an environment-specific issue, but the behavior strongly suggests a connection leak or missing connection cleanup during failed QR/reconnect/session initialization flows.
Also, I noticed that one status endpoint appeared stale while another status endpoint reflected the live state correctly. If needed, I can open a separate issue specifically for the status inconsistency, since it may be unrelated to the PostgreSQL connection accumulation problem.
- Lingua principale
- Go
- Stelle
- 939
- Fork
- 505
- Merge medio
- 5m
- PR unite (30g)
- 1
Preparare l'ambiente
- Include un Dockerfile o un file Docker Compose
- Ha un modello di pull request
- Nessuna guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di evolution-foundation/evolution-go
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
evolution-foundation/evolution-go#193 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
evolution-foundation/evolution-go#104 ·
I maintainer di solito rispondono entro 1 giorno
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
evolution-foundation/evolution-go#101 ·
I maintainer di solito rispondono entro 1 giorno
-
POST /group/participant always returns 400 "participants is required and cannot be empty" (wrong validation middleware on route)Forse già presa Una pull request collegata a questa issue è aperta o già unita. Apertabug
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 88/100
evolution-foundation/evolution-go#97 · 2 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 5/5 Più di una settimana Idoneità per principianti 20/100
evolution-foundation/evolution-go#219 ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di evolution-foundation/evolution-go
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
cloudflare/terraform-provider-cloudflare#7423 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
router-for-me/CLIProxyAPI#6746 · 2 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
ViewData can pair the in-flight proposal with the prepared flag of another proposalForse già presa @HagarMeir l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
hyperledger/SmartBFT#710 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100