This guide explains when to replay failed inbound events and how to inspect prior failures in the Credence Backend. It targets operators who need to troubleshoot live incidents without modifying code.
- At‑least‑once delivery: Queue or Horizon events that failed (e.g., network timeout, transient DB error) are captured for replay.
- Manual operator request: When an alert indicates a failed event, operators can trigger a replay via the Admin API.
- Automated retry: The system automatically retries events after a back‑off; operators may intervene if retries exceed the configured limit.
- View the failure ledger:
The response contains a list of events with
curl -X GET http://localhost:3000/api/admin/failure‑ledger
id,type,timestamp, anderrordetails. - Check logs (structured logging example):
Look for
docker compose logs -f backend | grep "failed_event_id"
eventIdanderrorMessagefields. - Database audit (if persisted):
SELECT * FROM failed_events WHERE status = 'failed' ORDER BY created_at DESC LIMIT 20;
POST /api/admin/replay/:eventId- Path parameter:
eventId– the UUID of the failed event. - Response:
{"status":"queued","eventId":"<id>"} - Idempotency: Include
Idempotency-Keyheader to avoid duplicate replays.
credence replay --event-id <event-id>- Query the event status:
curl http://localhost:3000/api/admin/event-status/<event-id>
- Ensure side‑effects are replay‑safe (see
docs/REPLAY_SAFE_HANDLERS.md). - Confirm no duplicate notifications were sent (check webhook logs).
- Missing idempotency: Replays without
Idempotency-Keymay cause duplicate external calls. - Stale data: If the underlying record changed since the original failure, the replay may be rejected – check for version conflicts.
- Resource limits: High replay volumes can saturate DB/Redis; monitor metrics in
docs/OBSERVABILITY.md.
- Replay‑Safe Handlers & Side‑Effects – ensures side‑effects are safe during retries.
- Operational Guides in README – entry point for operators.