Error Triage Hub (9)
Meta WA Cloud API Webhook Retry Queue Backlog & Duplicate Jobs
Expired Meta Cloud tokens, media download timeouts, and rate-limited template sends trigger exponential Sidekiq retries that flood Redis memory.
Backlog: > 10,000 retry jobs | Impact: Delayed inbound messages
How Failed Media Downloads & Token 401s Snowball Retries
Every inbound Meta Cloud webhook with voice notes or video triggers an asynchronous media fetch from Graph API endpoints before attaching to ActiveStorage. If outbound TLS stalls or an expired token returns HTTP 401, Sidekiq schedules up to 25 exponential retries per message.
Auditing Sidekiq RetrySet Size Before Redis OOM
Check Sidekiq::RetrySet.new.size and filter by Webhooks::WhatsappEventsJob or SendReplyJob. Thousands of serialized JSON payloads in the retry zset consume hundreds of megabytes of Redis RAM and replay storms on worker restart.
Measured Thresholds & Configuration
| Failure Mode | Sidekiq Retry Behavior | Triage Action |
|---|---|---|
| Expired Graph API Token (401) | 25 retries over 21 days | Alert on 401 + purge stale retry set |
| Slow media download timeout | Blocks default worker threads | Move media fetch to dedicated pod |
| Burst webhook duplicate delivery | Redundant DB conversation locks | Idempotency + split critical queue |