|
| 1 | +--- |
| 2 | +summary: "Inspect, compact, purge, and safely resubmit retained delivery failures" |
| 3 | +read_when: |
| 4 | + - A session or outbound delivery is dead-lettered |
| 5 | + - You need to remove sensitive failed-delivery detail without breaking idempotency |
| 6 | +title: "Delivery failures" |
| 7 | +--- |
| 8 | + |
| 9 | +# `openclaw delivery failures` |
| 10 | + |
| 11 | +OpenClaw keeps failed outbound and session deliveries separate from the live |
| 12 | +retry queue. The failure record can retain diagnostic or recovery detail for a |
| 13 | +bounded time while its compact tombstone continues to own a stable delivery ID. |
| 14 | + |
| 15 | +## List failure metadata |
| 16 | + |
| 17 | +```bash |
| 18 | +openclaw delivery failures list |
| 19 | +openclaw delivery failures list --queue outbound-prepared-v1 --limit 50 |
| 20 | +openclaw delivery failures list --json |
| 21 | +openclaw delivery failures list --exact-ids |
| 22 | +``` |
| 23 | + |
| 24 | +The default limit is 100 and the hard maximum is 500. Output includes queue, |
| 25 | +age, detail state, replay classification, fence policy, reason code, and retry |
| 26 | +count. It never includes the message or payload, route, target, account, |
| 27 | +session key, media path, or raw provider error. |
| 28 | + |
| 29 | +Stable identifiers can contain routing identity, so human and JSON output use |
| 30 | +a repeatable SHA-256 fingerprint by default. Pass `--exact-ids` only when an |
| 31 | +exact identifier is needed for a follow-up command. Producer-bounded fences |
| 32 | +similarly show an `idPrefixFingerprint` by default; `--exact-ids` also reveals |
| 33 | +their exact producer prefix. |
| 34 | + |
| 35 | +## Preview or apply retention cleanup |
| 36 | + |
| 37 | +```bash |
| 38 | +openclaw delivery failures purge |
| 39 | +openclaw delivery failures purge --queue session |
| 40 | +openclaw delivery failures purge --apply --yes |
| 41 | +``` |
| 42 | + |
| 43 | +`purge` is a dry run by default. Apply mode deletes only expired diagnostic |
| 44 | +rows whose policy has no fence, plus producer-bounded fences after their |
| 45 | +authored age or producer-local count limit expires. Unexpired producer-bounded, |
| 46 | +permanent, and owner-managed records keep their ownership tombstone while |
| 47 | +sensitive detail is compacted. Dry-run and apply use the same bounded row set; |
| 48 | +`--queue` and `--limit` scope both modes identically. |
| 49 | + |
| 50 | +There is no option to force-break a fence. Without `--yes`, apply mode prompts |
| 51 | +in an interactive terminal and refuses in JSON or other non-interactive use. |
| 52 | + |
| 53 | +Logical compaction clears payload-bearing JSON, raw errors, and denormalized |
| 54 | +session/channel/target/account metadata. SQLite can continue to reserve the |
| 55 | +freed pages inside the database file. To return free pages to the filesystem, |
| 56 | +stop the Gateway and run [`openclaw doctor --state-sqlite compact`](/cli/doctor#shared-state-sqlite-compaction). |
| 57 | + |
| 58 | +## Safely resubmit one failure |
| 59 | + |
| 60 | +```bash |
| 61 | +openclaw delivery failures resubmit <id> |
| 62 | +openclaw delivery failures resubmit <id> --queue session |
| 63 | +openclaw delivery failures resubmit <id> --queue outbound-prepared-v1 |
| 64 | +openclaw delivery failures resubmit <id> --url ws://127.0.0.1:18789 --token <token> |
| 65 | +``` |
| 66 | + |
| 67 | +`resubmit` requires a running, reachable Gateway and accepts the standard |
| 68 | +Gateway client options: `--url`, `--token`, `--password`, and `--timeout`. The |
| 69 | +Gateway performs the failed-to-pending transition and immediately schedules an |
| 70 | +eligible session row in its live delivery runtime. If the runtime is still |
| 71 | +starting or immediate scheduling fails after that durable transition, the |
| 72 | +command reports that the row remains queued for startup recovery. A connection |
| 73 | +or authentication failure occurs before the row changes. |
| 74 | + |
| 75 | +Session and outbound queues have independent ID namespaces. If both own the |
| 76 | +same ID, an unqualified resubmit is refused; rerun with the exact `--queue` |
| 77 | +namespace shown by `openclaw delivery failures list --exact-ids`. |
| 78 | + |
| 79 | +Success means **queued for recovery**, not delivered. Outbound rows are picked |
| 80 | +up by the Gateway's bounded outbound recovery interval; the command does not |
| 81 | +claim recipient delivery or start a second recovery loop. |
| 82 | + |
| 83 | +Generic resubmit is intentionally narrow. Outbound rows require an explicit |
| 84 | +pre-side-effect classification, a full canonical prepared payload, no durable |
| 85 | +owner or stable fence, and every queue-owned media file. Session rows require |
| 86 | +full detail, no owner, no delivery-start or settlement marker, and no ambiguity. |
| 87 | +The Gateway's failed-to-pending transition is atomic, so a second invocation |
| 88 | +does not submit the same row again. |
| 89 | + |
| 90 | +Stable outbound IDs and claimed session producers retain failed ownership even |
| 91 | +when successful sends would not keep a completion receipt. |
| 92 | + |
| 93 | +OpenClaw refuses cross-queue ambiguity, compacted, ambiguous, owner-managed, |
| 94 | +legacy-unknown, migration-namespace, missing-media, and stale-owner rows. |
| 95 | +Subagent completion failures remain under their owner commands: |
| 96 | + |
| 97 | +```bash |
| 98 | +openclaw tasks retry <task-id> |
| 99 | +openclaw tasks dismiss <task-id> |
| 100 | +``` |
| 101 | + |
| 102 | +## Backups and retained bytes |
| 103 | + |
| 104 | +Global SQLite snapshots remove every delivery queue row before publishing the |
| 105 | +snapshot, including pending work, failed fences, and completion or idempotency |
| 106 | +receipts. Restoring one is not an exactly-once delivery continuation; the |
| 107 | +sanitized artifact deliberately chooses privacy and no-replay portability over |
| 108 | +queue continuity. A normal state backup can contain the live database, so |
| 109 | +protect it like other sensitive OpenClaw state. Logical retention and SQLite |
| 110 | +file-size reclamation are separate operations; use the explicit doctor |
| 111 | +compaction flow when physical reclamation is required. |
| 112 | + |
| 113 | +## Related |
| 114 | + |
| 115 | +- [`openclaw health`](/cli/health) |
| 116 | +- [`openclaw doctor`](/cli/doctor) |
| 117 | +- [Restart recovery](/gateway/restart-recovery) |
0 commit comments