[BUG] Webhook config (url/events/headers) wiped on container restart, despite Postgres persistence
Welcome!
- [x] Yes, I have searched for similar issues on GitHub and found none.
What did you do?
We run Evolution API in production with two WhatsApp instances on Baileys, PostgreSQL storage, webhook integration to our own FastAPI receiver (MESSAGES_UPSERT + CONNECTION_UPDATE events, custom x-webhook-secret header for auth).
After restarting the evolution-api container (docker restart), we checked the webhook configuration via GET /webhook/find/{instance} for both instances and found it reset to an empty/default state:
{
"url": "",
"events": [],
"headers": null,
"enabled": true
}
This happened for both instances simultaneously, immediately after the container restart — not a gradual drift, a clean wipe.
We have a small watchdog script (runs every minute) that checks GET /webhook/find/{instance} against the expected config and re-applies it via POST /webhook/set/{instance} if it drifts. Its log shows this same "url/events/secret wiped" pattern recurring several times over the past week, always shortly after some kind of instance/container restart — most confirmed correlation is with a full docker restart of the container, but we also have some log entries suggesting an /instance/restart/{name} call (not just a full container restart) can trigger the same wipe. We haven't isolated a 100% clean minimal repro for the instance-level-restart case yet — the container-restart case is the one we can reproduce reliably.
What did you expect?
Webhook configuration (url, events, headers) is set once via POST /webhook/set/{instance} and stored in Postgres (DATABASE_ENABLED=true, DATABASE_PROVIDER=postgresql). We expected it to persist across container/instance restarts, since it's meant to be durable configuration, not runtime-only state.
What did you observe instead of what you expected?
Webhook url becomes an empty string, events becomes an empty array, and the custom secret header is dropped — for both instances — right after a container restart. enabled stays true, so the instance silently stops delivering any webhook at all until something notices and re-applies the config. We only caught this because of our own watchdog; without it, inbound message webhooks would just silently stop firing after any restart.
Reproduction steps (container restart case — reliable)
- Configure webhook for an instance:
POST /webhook/set/{instance}with aurl,events(e.g.MESSAGES_UPSERT,CONNECTION_UPDATE), and a custom header. - Confirm it's set:
GET /webhook/find/{instance}returns the values you set. docker restart <evolution-api-container>.GET /webhook/find/{instance}again —urlis"",eventsis[], headers isnull.
Our workaround
A small script runs every minute via cron/systemd timer:
GET /webhook/find/{instance}for each instance.- Compare
url,events(as a set, not exact array order), and the secret header against expected values. - If any mismatch,
POST /webhook/set/{instance}with the full correct payload again. - Alert (we use Telegram) only when a fix was actually applied, so a real drift doesn't go unnoticed.
This keeps us running, but it's a workaround for state that should be persisted, not something that should need re-checking every minute.
Which version of the API are you using?
evoapicloud/evolution-api:2.4.0-rc2 (reports internally as v2.4.0)
What is your environment?
Linux (CentOS Stream 10), Docker, network_mode: host, PostgreSQL 18 (DATABASE_ENABLED=true, DATABASE_PROVIDER=postgresql), DATABASE_SAVE_DATA_CHATS=false, DATABASE_SAVE_DATA_HISTORIC=false, DATABASE_SAVE_DATA_CONTACTS=false, DATABASE_SAVE_DATA_LABELS=false.
If applicable, paste the log output
GET /webhook/find/instance-a (right after docker restart)
{
"id": "...",
"url": "",
"headers": null,
"enabled": true,
"events": [],
"webhookByEvents": false,
"webhookBase64": false,
"instanceId": "..."
}
Closing this on our side: we have moved off Evolution API, so we can no longer reproduce or follow up on it. The report stays here for anyone who hits the same behaviour.