Instance stays "open" but stops receiving messages after "stream errored out" (ack class="status") — Baileys #2858, fix with 3 lines
メンテナーはふだん 4 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 初心者へのやさしさ
- 45/100
- issue の種類
- バグ
- 明瞭さ
- 明確に書かれている
- 活発さ
- 活発
- 技術スタック
- node.js, typescript
調査の方向性
Read the Baileys receive handler at node_modules/baileys/lib/Socket/messages-recv.js, especially the CB:notification handler near line 1220 in version 7.0.0-rc.9. Check whether the upstream PR #2866 has been released and how this project manages Baileys patches or version upgrades. Done means status stanzas are acknowledged and affected instances continue receiving messages; the report cites deployments with no further status stream errors.
索引モデルが issue の本文から書いたものです。
説明
Welcome!
- Yes, I have searched for similar issues on GitHub and found none.
What did you do?
Running evoapicloud/evolution-api:v2.3.7 (Baileys 7.0.0-rc.9), Postgres + Redis, ~30 QR instances with Chatwoot integration. Nothing special: instances were just running normally.
What did you expect?
Instances that show connectionStatus "open" keep receiving incoming messages: they are stored in the Message table and the messages.upsert webhook is fired.
What did you observe instead of what you expected?
Some instances stay "open" but stop receiving: messages arrive on the phone, but nothing is stored in the Message table and no webhook fires. Other instances on the same server keep working.
- Restarting the instance (/instance/restart) does NOT fix it.
- Restarting the whole container does NOT fix it.
- Logout + new QR fixes it, until it happens again (in one case, less than 3 hours later).
Each episode starts with a Baileys "stream errored out" whose node is an ack with class="status" (see logs below). Within 1-3 seconds, the affected instance auto-reconnects (its Instance.updatedAt changes) and from then on it receives nothing.
Note: this is not the same as #2773 (disappearing messages). Here ALL incoming messages stop for the instance, regardless of the contact.
Screenshots/Videos
No response
Which version of the API are you using?
2.3.7
What is your environment?
Docker
Other environment specifications
Docker image evoapicloud/evolution-api:v2.3.7 (Baileys 7.0.0-rc.9), PostgreSQL 17, Redis 7 (CACHE_REDIS_ENABLED=true), Chatwoot integration enabled, ~30 WHATSAPP-BAILEYS (QR) instances on the same server.
If applicable, paste the log output
{"level":50,"msg":"stream errored out",
"reasonNode":{"tag":"ack","attrs":{"class":"status","type":"text","id":"AC9087..."}},
"fullErrorNode":{"tag":"stream:error","attrs":{},
"content":[{"tag":"ack","attrs":{"class":"status","type":"text","id":"AC9087..."}}]}}
type can be text or media. We saw 3-9 of these per hour on our server, each one followed by an instance auto-reconnecting.
Additional Notes
Root cause: Baileys issue #2858 (https://github.com/WhiskeySockets/Baileys/issues/2858). Since late September 2026 WhatsApp sends top-level <status> stanzas (Status updates) that Baileys never acks. ~50 min later the server closes the stream with the missing ack; on reconnect the same <status> is redelivered and never acked, so the session stays "open" without receiving. The upstream fix (PR #2866) is not released yet.
Fix: in node_modules/baileys/lib/Socket/messages-recv.js, right after the CB:notification handler (around line 1220 in rc.9), add:
ws.on('CB:status', (node) => {
sendMessageAck(node).catch(error => onUnexpectedError(error, 'acking status stanza'));
});
A plain ack, no error code (a NACK keeps the stanza pending). Evolution ignores Status (readStatus: false), so nothing is lost.
To make it persistent, we build a derived image instead of editing the container:
FROM evoapicloud/evolution-api:v2.3.7
COPY patch-status.cjs /tmp/
RUN node /tmp/patch-status.cjs /evolution/node_modules/baileys \
&& node --check /evolution/node_modules/baileys/lib/Socket/messages-recv.js
Our script inserts those lines and fails the build if the Baileys version is not exactly 7.0.0-rc.9 or the anchor code is not found, so it can't silently break on upgrade. Happy to share it.
Result: deployed on two servers. Zero "stream errored out" with class "status" since then, and an instance that had been broken for 14+ hours started receiving again after the restart, without re-pairing.
Suggestion: bump Baileys once #2866 is released, or ship this handler via patch-package in the meantime.
- 主要言語
- TypeScript
- スター
- 10.2k
- フォーク
- 7.5k
- 平均マージ
- 6日 19時間
- マージ済み PR(30日)
- 4
環境構築
- Dockerfile または Docker Compose ファイルあり
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
evolution-foundation/evolution-api のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
evolution-foundation/evolution-api#2796 ·
メンテナーはふだん 4 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
evolution-foundation/evolution-api#2795 ·
メンテナーはふだん 4 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
evolution-foundation/evolution-api#2782 ·
メンテナーはふだん 4 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
evolution-foundation/evolution-api#2723 ·
メンテナーはふだん 4 日以内に返信
-
難易度 1/5 1〜3時間 初心者へのやさしさ 88/100
evolution-foundation/evolution-api#2704 ·
メンテナーはふだん 4 日以内に返信
evolution-foundation/evolution-api の issue をすべて見る
似ている issue
-
review: medium
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
1lck/Lithe-IDEA#2432 ·
メンテナーはふだん 1 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
openpickleball/frontend#222 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
abhigyanpatwari/GitNexus#4124 ·
メンテナーはふだん 1 日以内に返信
-
area:web enhancement P2
難易度 1/5 1時間未満 初心者へのやさしさ 88/100
agent-of-empires/agent-of-empires#6076 · コメント 1 件 · リアクション 1 件 ·
メンテナーはふだん 1 日以内に返信
-
good first issue
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
laaielichter/Godotwright#250 ·
メンテナーはふだん 1 日以内に返信