Troubleshooting¶
Use this page as a decision tree first, checklist second.
Connection Decision Tree¶
flowchart TD
A[Client cannot connect] --> B{Network reachable?}
B -- No --> B1[Fix outbound network/DNS/TLS]
B -- Yes --> C{Backend path writable?}
C -- No --> C1[Fix storage permissions]
C -- Yes --> D{Pairing still valid?}
D -- No --> D1[Re-pair account]
D -- Yes --> E[Inspect EvConnectFailure / EvStreamError payload]
Always check first
- outbound network
- backend storage write access
- session validity
Frequent Reconnects¶
Possible causes:
- unstable network
- another active session replacing stream (
EvStreamReplaced) - backend corruption or stale state
Action Path¶
- log reconnect timestamp and reason event
- verify if replacement is expected (another device/session)
- isolate backend path ownership to single runtime instance
Message Send Fails¶
Fast Checklist¶
- validate
JIDtarget format - ensure
client.is_connected()is true - verify protobuf payload shape if using
send_message - classify exception (
PyPayloadBuildErrorvsEventDispatchError)
try:
await client.send_text(chat_jid, "hello")
except PyPayloadBuildError:
# payload/content issue
...
except EventDispatchError:
# dispatch/runtime issue
...
Media Download Fails¶
- verify media subtype object (image/video/audio/etc.)
- if direct path expired, call
request_media_reupload(...) - retry with bounded attempt count
Audit fields
Log message_id, chat_jid, and retry counter for every reupload attempt.
Sync Events Are Confusing¶
Sync events are normal in multi-device behavior.
Treat EvArchiveUpdate, EvMarkChatAsReadUpdate, and EvDeleteChatUpdate as state convergence signals.
Escalation Path¶
If issue persists:
- capture event type + metadata snapshot
- capture backend health and storage checks
- reduce to minimal reproducible handler
- compare against QnA and Error Handling