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

Ouverte
#2,790 7 commentaires 0 réactions 0 personnes assignées Voir sur GitHub

Les mainteneurs répondent en général sous 4 jours

Personne n'a encore pris cette issue.

Évaluation

Difficulté
5/5
Temps estimé
Plus d'une semaine
Accessibilité débutants
30/100
Type d'issue
Bug
Clarté
Plutôt claire
Activité
Active
Stack technique
docker, postgresql, redis, typescript
Domaine
api, backend, databases

Piste de recherche

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.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Description

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.

Langage dominant
TypeScript
Étoiles
10.2k
Forks
7.5k
Merge moyen
6 j 19 h
PR mergées (30 j)
4

Préparer son environnement

Par où commencer

  1. Lisez l'issue en entier, puis le guide de contribution du projet.
  2. Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
  3. Forkez le dépôt et travaillez sur une branche.
  4. Ouvrez une pull request qui référence le numéro de l'issue.

Autres issues de evolution-foundation/evolution-api

Toutes les issues de evolution-foundation/evolution-api

Issues similaires

Plus d'issues TypeScript

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.