Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

PostgreSQL connections are not released after QR/reconnect failures

Aperta
#112 2 commenti 1 reazione 0 assegnatari Vedi su GitHub

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
Tipo di issue
Bug
Chiarezza
Da chiarire
Stato di attività
Tranquilla
Stack tecnologico
go, postgresql
Ambito
backend, databases

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

bug
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

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di evolution-foundation/evolution-go

Tutte le issue di evolution-foundation/evolution-go

Issue simili

Altre issue su Go

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.