Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

panic: "interface conversion: interface {} is *events.Archive, not map[string]interface {}" can crash the process (v0.7.1)

Aperta
#95 1 commento 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
55/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Tranquilla
Stack tecnologico
go
Ambito
api, backend

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
  1. Instance connected with webhook delivery enabled.
  2. Archive or unarchive a 1-1 chat — via POST /chat/archive, from the phone, or arriving through app-state / history sync.
  3. 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

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

Tutte le issue di evolution-foundation/evolution-go

Issue simili

Altre issue su Go

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.