panic: "interface conversion: interface {} is *events.Archive, not map[string]interface {}" can crash the process (v0.7.1)
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Idoneità per principianti
- 55/100
Direzione di ricerca
Traccia il produttore o serializzatore di eventi webhook, AMQP e WebSocket che gestisce gli eventi whatsmeow, iniziando dall’asserzione di tipo a map[string]interface{}. Confronta la gestione di *events.Archive con quella degli altri tipi di evento e ispeziona il percorso di recupero dal panic. Il lavoro è completato quando gli eventi archive e unarchive vengono inoltrati senza un panic dovuto all’asserzione di tipo e un panic in un handler non può terminare il processo.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Version
evolution-go v0.7.1 (Docker image evoapicloud/evolution-go:0.7.1).
Describe the bug
The event handler panics when processing a *events.Archive event (emitted by whatsmeow when a chat is archived/unarchived on any device of the account). It's a type-assertion failure — the event serialization layer seems to expect a map[string]interface{} but receives a *events.Archive:
[Client ERROR] Event handler panicked while handling a *events.Archive: interface conversion: interface {} is *events.Archive, not map[string]interface {}
panic({0x16a4b20?, 0x...?})
/usr/local/go/src/runtime/panic.go:783 +0x132
The same line repeats for every *events.Archive received.
Impact
The panic is usually recovered, but occasionally it brings the whole process down and Docker restarts the container. This is especially severe with CONNECT_ON_STARTUP=false: after the restart none of the instances reconnect automatically, so the entire fleet stays offline until a manual mass POST /instance/connect.
On a ~140-instance fleet we observed ~3 container restarts in 16h traced to this panic, plus hundreds of these panic log lines per day (peaks during business hours, when chats get archived the most).
To Reproduce
- Instance connected with webhook delivery enabled.
- Archive or unarchive a 1-1 chat — via
POST /chat/archive, from the phone, or arriving through app-state / history sync. - whatsmeow emits
events.Archive→ the handler panics with the type assertion above.
Expected behavior
events.Archive should be serialized/dispatched without panicking — and a panic in an event handler should never be able to crash the whole process (the recover should fully contain it).
Likely location
The event producer/serializer for webhook/AMQP/WebSocket output — something does value.(map[string]interface{}) on a value that is actually *events.Archive. The events.Archive struct (JID, Timestamp, Action, FromFullSync) probably needs an explicit mapping like the other event types have.
Environment
- Docker
evoapicloud/evolution-go:0.7.1 - Postgres backend (
evogo_auth/evogo_users) - Webhook delivery enabled
- ~140 instances
Workaround we applied
On our side we stopped issuing POST /chat/archive (we archive only in our own DB), which removes the events we generate — but archives coming from the phone / history sync still trigger it. Happy to provide a fuller stack trace or more logs if useful.
- Lingua principale
- Go
- Stelle
- 878
- Fork
- 461
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Guida per i contributori
Nessuna guida per i contributori indicizzata per questo repository
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di evolution-foundation/evolution-go
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
-
bug
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 88/100
evolution-foundation/evolution-go#97 · 2 commenti ·
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 48/100
Tutte le issue di evolution-foundation/evolution-go
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
bazel-contrib/rules_go#4726 · 1 commento ·
-
area/auto-scaling area/monitoring area/ops-productivity kind/enhancement
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
-
Type/Improvement
Difficoltà 1/5 1-3 ore Idoneità per principianti 90/100
OpenNSW/nsw-srilanka#522 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 92/100