[BUG] Baileys session stops receiving inbound messages while dashboard still shows "Connected" — requires full container restart to recover

Aperta
#2,790 7 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 4 giorni

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
5/5
Tempo stimato
Più di una settimana
Idoneità per principianti
30/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
docker, postgresql, redis, typescript
Ambito
api, backend, databases

Direzione di ricerca

Start by tracing the Baileys session lifecycle and the ChannelStartupService connection logs; the payload does not name source files or tests. Compare how inbound message events update the chat/message store with how outbound sends and the dashboard connection status are reported. The issue is resolved when inbound messages resume reliably after recovery and the reported status reflects a stalled session.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

bug
📋 Bug Description

The WhatsApp (Baileys) session silently stops receiving new inbound messages while the Evolution Manager dashboard and the instance status both continue to report "Connected". Outbound sends (messages triggered by our own automation via the API) continue to work normally during the stall, which masks the problem and makes it hard to detect from the dashboard alone. The only reliable fix found so far is a full restart of the evolution-api container (not the in-app “Restart”/”Disconnect” buttons in Evolution Manager, which do not recover the session once it’s already stalled).

🔄 Steps to Reproduce

This appears to happen spontaneously after some hours of uptime (not tied to a specific user action). Observed recurrence: 3 times in under 48 hours.

Instance connects normally and processes inbound/outbound messages for some hours.
At some point, inbound messages stop being written to the instance’s message/chat store (findChats / findMessages), even though:
The dashboard still shows the instance as "Connected".
Outbound messages sent via our own API calls are still delivered and logged correctly (fromMe: true records keep appearing).
Using Evolution Manager’s own in-app “Restart” and “Disconnect” buttons does not recover message reception.
A full restart of the underlying Docker container (outside Evolution Manager, at the hosting/orchestration level) does recover it — confirmed via a new [ChannelStartupService] CONNECTED TO WHATSAPP log line and fresh inbound messages syncing in afterward.
The issue recurred again ~16.5 hours after the first fix, and a third time a few hours after the second restart — this time, even after the container restart logged CONNECTED TO WHATSAPP, inbound sync did not resume at all (verified directly against the instance’s own chat/message database: the most recently updated chat across the entire instance remained stuck ~9+ hours in the past, with zero new records, despite test messages sent and outbound automation continuing to fire).

✅ Expected Behavior

The instance should either genuinely reflect a disconnected/degraded state (not "Connected") when the Baileys session stops receiving events, so monitoring can catch it, and/or
The in-app Restart/Disconnect actions should reliably force a real reconnect without requiring an external container restart, and/or
A full container restart should reliably restore inbound message reception (this was not the case the third time).

❌ Actual Behavior

The Baileys session stops receiving new inbound WhatsApp messages while the instance dashboard and status endpoint still report "Connected". Outbound messages sent via our own API/automation continue to work and get logged normally (fromMe: true records keep appearing), which masks the failure.

Confirmed directly against the instance’s own database (/chat/findChats and /chat/findMessages): the most recently updated chat across the entire instance was stuck more than 9 hours in the past, with zero new inbound records, even though test messages were sent during that window and outbound automation kept firing normally.

Evolution Manager’s own in-app “Restart” and “Disconnect” buttons did not recover inbound reception. A full restart of the underlying Docker container did recover it the first time (new [ChannelStartupService] CONNECTED TO WHATSAPP log line, followed by inbound messages syncing again), but on a later occurrence, even a full container restart with that same “CONNECTED TO WHATSAPP” log line did not restore inbound message reception — the instance kept reporting “Connected” with zero new inbound activity afterward.

This has now happened 3 times in under 48 hours.

🌍 Environment

Evolution API, self-hosted via Docker (EasyPanel), with Postgres + Redis.
WhatsApp connector: Baileys, version observed in logs: 2.3000.1054337431.
Instance driven by n8n via real-time Webhook + a periodic flush/schedule trigger.

📋 Logs

📝 Additional Context

Happy to share more detailed timestamps/logs if useful — this is a production instance for a small business’s customer-service WhatsApp bot, so the silent nature of the failure (dashboard shows healthy) is the most damaging part, since it delays detection.

Lingua principale
TypeScript
Stelle
10.2k
Fork
7.5k
Merge medio
6g 19h
PR unite (30g)
4

Preparare l'ambiente

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-api

Tutte le issue di evolution-foundation/evolution-api

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.