Reference profile recovery runbook
What to do, and what never to do, when a reference-profile deployment stops halfway: owner failover, an unknown effect, a redelivered callback, an outbox backlog, a failed run with an effect in doubt.
Use this page when something in a reference-profile deployment stopped halfway: the process that was running the background loops died, an external effect has no recorded outcome, a callback or webhook arrived twice, events are not being delivered, or a run ended failed with an effect in doubt. Each section says what the failure looks like, how to tell, what is safe to do, and what is never safe.
It collects what Reference profile and ADR 0002 explain in pieces, and it adds no behavior: every state, code and endpoint below is the one the code uses, and the scenarios V07 (a dispatcher killed at any moment), V08 (a timeout) and V09 (outbox and inbox) in caliber/tests/egi_scenarios/ exercise the effect and event paths end to end. The older Operations runbook covers recoveries that do not depend on the lease (releases, queues, rollbacks) and is still the page for those.
All HTTP paths are relative to /ajax-api/2.0/mlflow/caliber; this page writes them as /caliber/....
What is wired today
Read this first: it decides which sections you will meet in practice.
| Piece | On main | What it means for you |
|---|---|---|
Execution-owner lease, failover, execution_role in readiness | merged (B13.2, B13.3) | Failover below applies as written |
Outbox, inbox, process_once | merged (B13.4, B13.5a) | Backlog and redelivery sections apply as written |
| Receipt callback | merged (B05.4b, B13.5b) | The one consumer of the inbound inbox |
| Effect proposals, receipts, reconciler, operator view | merged as modules and a read-only view (B05.1 to B05.6) | Rows appear in the view only once something writes proposals |
| The dispatcher that dispatches proposals | merged (B04.1, #724); a manifest-backed webhook or API-request node dispatches through it only when its run supplies a governed effect context (B04.2), and no production worker builds that context yet | A real run's effects still go through the legacy effect ledger; proposal rows appear only where something supplies that context |
| The owner loop that runs the reconciler, and the rule for a dispatch stuck under the current lease | merged (B05.5d, #997): EffectReconcilerTask, reference profile, on by default (CALIBER_EFFECT_RECONCILER_ENABLED) | Every CALIBER_EFFECT_RECONCILER_INTERVAL_SECONDS (15 s) the owner asks about unknown and abandoned effects by key, and a dispatch left under the current lease longer than CALIBER_EFFECT_IN_FLIGHT_MAX_SECONDS (15 min) becomes unknown |
| An audited operator action for a proposal | merged (B05.5d, #997): reconcile and nothing else | Asks the downstream now, as the owner, and records who asked and why. It never records what you believe: see What you can do that is safe |
| Parking a gated run and resuming it after reconciliation | merged (B05.5c, #996) | A gated run is durably waiting_effect; authoritative settlement wakes the same run from its checkpoint |
So today the effect you will actually meet is a legacy ledger claim (caliber_effect_ledger, status in_progress); the proposal states below are what the same procedures become when the dispatcher lands, and they are written down now so that the first unknown proposal is not the first time anyone reads them.
Rules that never bend
- Never send a dispatched effect again by hand, and never re-run something to "make it go through". A dispatched effect may already have happened. The only way back from
unknownis a question to the downstream by the original key (there is no transition fromunknowntodispatched). - Never mark an effect failed, skipped or reconciled without the downstream's own evidence. The platform records
failedfor anunknowneffect only by moving it throughreconciledfirst, and only when the connector proves absence final (absence_proven); a definitive rejection is recordedfailedonly fromdispatched, on the first and only dispatch. A missing record is delayed visibility until proven otherwise. For a legacy claim,skipandretryare statements about the outside world: make them only after you looked at the remote system. - Never edit or delete ledger, proposal, receipt, manifest, outbox or inbox rows. They are the evidence. On PostgreSQL the immutable tables refuse it; on SQLite (development only) they do not, which is a reason to stay off it, not a way around.
- Never edit a shipped migration, and never downgrade the schema to fix a stuck row: a downgrade drops tables together with their rows (0116 drops
caliber_execution_owner, 0119 the outbox and its inbox, 0122 the inbound inbox, 0123 the proposals, 0125 the receipts; 0126 and 0127 drop the dispatch token and the approval binding columns), and the evidence goes with them. Schema changes are a new revision. - Never start a second owner by hand. Do not write the
caliber_execution_ownerrow and do not run loops outside the lease. A secondary acquires the lease by itself when the old one lapses. - Capture before you act. Save the output of the first-look commands below with the time; a restart destroys some of it.
First look
# Is this replica ready, which profile is it under, and is it the owner or a secondary? (the body is wrapped in "data")
curl -s -H "Authorization: Bearer $CALIBER_TOKEN" "$CALIBER_BASE_URL/ajax-api/2.0/mlflow/caliber/readiness" | jq '.data | {ready, profile, execution_role}'
# Is the workflow-run queue draining, and are workers alive?
curl -s -H "Authorization: Bearer $CALIBER_TOKEN" "$CALIBER_BASE_URL/ajax-api/2.0/mlflow/caliber/system/queue"
# Effects that need a person: legacy ledger claims and effect proposals, labelled apart
curl -s -H "Authorization: Bearer $CALIBER_TOKEN" "$CALIBER_BASE_URL/ajax-api/2.0/mlflow/caliber/system/effects"
# Outbound webhooks that were never delivered
curl -s -H "Authorization: Bearer $CALIBER_TOKEN" "$CALIBER_BASE_URL/ajax-api/2.0/mlflow/caliber/system/webhook-dead-letters"
The readiness body (under data; curl does not unwrap it, and neither does it unwrap the 2xx answers of the callback) carries profile and execution_role. Ask every replica: exactly one should answer owner and the rest secondary. The lease owner's id is host:pid:random, one per process incarnation, so it names the machine that holds it. The read-only queries used below (PostgreSQL; expires_at is naive UTC database time):
-- the execution-owner lease: who holds it, which fencing token, when it lapses, and whether it already has
SELECT lease_name, owner_id, fencing_token, acquired_at, renewed_at, expires_at,
expires_at <= timezone('utc', clock_timestamp()) AS lapsed
FROM caliber_execution_owner;
-- outbox depth: pending, delivered and dead rows
SELECT status, count(*) AS n, min(created_at) AS oldest FROM caliber_event_outbox GROUP BY status;
-- outbox rows that ran out of attempts, with the consumer and exception class that failed (never a payload)
SELECT event_id, event_type, attempts, last_error, created_at
FROM caliber_event_outbox WHERE status = 'dead' ORDER BY created_at;
-- inbound inbox reservations that never reached processed
SELECT consumer, source, event_id, status, received_at FROM caliber_inbox_events WHERE status = 'received';
Which section
| What you see | Go to |
|---|---|
No owner anywhere, two owners, runs not draining after a crash or deploy | Owner crash and failover |
A legacy claim in_progress, or a proposal dispatched, unknown or reconciled | A stuck or unknown effect |
A run failed with UnknownEffectError or an effect that "was claimed but never recorded an outcome" | A gated, parked, or failed run |
A callback or webhook delivered twice, inbox_payload_mismatch, an inbox row stuck at received | Callback and webhook redelivery |
| Events not arriving, dead outbox rows, dead letters | Outbox backlog and dead letters |
An admission refusal (bundle_unavailable, rule_bundle_refused), or a run failed with pins_changed or context_denied | A run refused for its pins or its rule bundle |
A governed step refused with token_budget_exhausted or reservation_replayed, or a reservation still reserved long after its step | A governed step refused for its token budget, or left a reservation open |
| A restore | After a restore |
Owner crash and failover
What it looks like. The process holding the lease was killed, lost its database, or hung. Loops stop; runs that were running sit until their own lease lapses; /readiness on the survivors still says secondary for up to one lease.
How the takeover works. The lease (caliber_execution_owner) expires by the database's clock, so a paused or skewed process cannot keep it. A secondary tries to acquire every CALIBER_EXECUTION_LEASE_SECONDS / 3 (default lease 30 s, minimum 3 s). When it wins, the fencing token grows by exactly one, it starts the loops and /readiness says owner. The takeover scenario (V14) asserts that it happens within twice the lease, SIGKILL included. An owner that cannot renew, or cannot reach the database, stops its own loops after two thirds of the lease and reports secondary: losing the lease fails closed.
Steps.
- Read the lease row (query above) and
/readinesson every replica. Notefencing_tokenandexpires_at. The process logs (caliber.execution_role) sayexecution-owner lease acquired (owner=... token=N)on a takeover andexecution-owner lease lost (...); stopping the owner-only loopson a loss; grep them to see a failover. - If the holder is dead and
expires_atis in the past or within one lease: wait one lease plus a tick and read again.fencing_tokenshould have grown by one and exactly one replica should sayowner. Do nothing else. - After the takeover, work left behind is picked up by the loops themselves, each by its own rule. The per-loop table is Recovery by stage in ADR 0002; the ones you will notice:
Left behind What happens When A workflow run runningrequeued ( error_codelease_recovered, eventworkflow.run.recovered) and run again from the beginning, unless its summary already carries a resume checkpoint (then from that same checkpoint); a run parked at an approval or wait is notrunningand is never recovered this waywhen its run lease lapses ( CALIBER_WORKFLOW_RUN_LEASE_SECONDS, 60 s)Webhooks accepted but not delivered become dead letters of kind shutdown; replay them (below)when their accept lease lapses (at least 60 s) Outbox rows claimed by the dead publisher delivered again by the new publisher; the consumer's inbox drops a repeat at lease expiry (30 s) A refinement job runningmarked failedby the janitor, not requeuedheartbeat older than CALIBER_JANITOR_STALE_THRESHOLD_SECONDS(300 s)A calibration job runningnothing, on purpose: abandon it or submit a new linked job see P4 A workspace import runningmoved to reconcile_required(not retryable; queue a new import job for the same content, which is safe by digest)after CALIBER_WORKSPACE_IMPORT_LEASE_SECONDS(300 s)An effect dispatchedunder the old leasebecomes abandoned; see the next section once the new owner holds a higher token
- A recovered run is not a safe run. It starts again from the beginning. Only webhook and API-request nodes go through the effect ledger: an effect of those nodes that it already claimed is not repeated (the ledger replays it, or reports the claim
indeterminate). Effects of other nodes (MCP tools, OpenAPI tools, knowledge builds, output buckets) are not ledgered and can happen again. Before you let a recovered run proceed, or retry it, read itsworkflow.run.recoveredevent and check the downstream for any non-ledgered effect it could already have made.
No owner after two leases. Every process is a secondary when the lease store is unreachable (the lease calls fail closed and /readiness reports the database), or when the loops fail to start after an acquisition (the error is logged by caliber.execution_role, the lease is released and the next tick tries again). Fix the cause (the database, the failing loop); do not try to force an owner.
Two replicas say owner. This must not persist. The loops are not yet fenced per transition, so after a lease loss the old owner may finish the transition it was in, bounded by CALIBER_SHUTDOWN_GRACE_SECONDS (30 s): read /readiness again after that long. If two replicas still both say owner, stop one and treat it as an incident: capture both readiness bodies and the lease row first. SQLite gives no fencing guarantee at all and the reference profile refuses it.
Clean restart. A deliberate shutdown stops the loops while it keeps renewing the lease, then releases it, so the successor starts without waiting for expiry. A rolling deploy therefore hands over cleanly; a SIGKILL costs one lease.
Never. Do not shorten the wait by writing the lease row, by restarting the survivors "to make one win", or by re-running the work the dead owner was doing.
A stuck or unknown effect
An effect is stuck when nobody has the final word on whether it reached the downstream. Two records exist and the view never mixes them (source and safe_actions on every row):
curl -s -H "Authorization: Bearer $CALIBER_TOKEN" \
"$CALIBER_BASE_URL/ajax-api/2.0/mlflow/caliber/system/effects?source=proposal&proposal_state=open&limit=100"
from caliber_sdk import CaliberClient
client = CaliberClient() # CALIBER_BASE_URL and CALIBER_TOKEN come from the environment
view = client.system.effects(source="proposal", proposal_state="unknown")
for row in view["proposals"]:
print(row["proposal_id"], row["state"], row["reason"], row["abandoned"], row["blocks_dependents"])
print(view["lease"]) # the stored execution-owner lease (also returned when source is "all"), or None
A proposal (source: effect_proposal)
States: proposed, approved, dispatched, committed, failed, unknown, reconciled. The open ones, which block what depends on them, are dispatched, unknown and reconciled.
| You see | It means | Do |
|---|---|---|
dispatched, abandoned: true | the lease that dispatched it was replaced; the attempt may have been sent | Nothing by hand. The new owner's next loop pass (within CALIBER_EFFECT_RECONCILER_INTERVAL_SECONDS, 15 s) records unknown (abandoned_dispatch) and asks the downstream by key; it keeps blocking its dependents until that settles |
dispatched, abandoned: false | the dispatcher's own attempt in flight, or its lease lapsed and nobody has taken over yet | Read lease in the same response: expired: true means failover has not completed, go to Owner crash. Otherwise wait: a dispatcher whose settle fails records unknown itself, and the loop moves a row that is still dispatched after CALIBER_EFFECT_IN_FLIGHT_MAX_SECONDS (see below) |
dispatched, abandoned: null | no recorded token or no lease to compare | Treat as unknown; never abandon it by hand |
unknown | no recorded outcome (a timeout after the send, an ambiguous answer, a failed settle, an abandoned or expired dispatch) | Wait for the loop (every 15 s) or a verified callback, or ask now with reconcile. It is never sent again. reason says why: ambiguous:<code>, receipt_unverified, settle_failed:<code or exception class>, abandoned_dispatch, in_flight_expired |
reconciled | the reconciler began settling it and has not finished | Wait; the next pass or the callback finishes it |
committed | a verified receipt exists | Do not repeat it. (The platform makes at most one local claim per effect and verifies a receipt; it does not promise exactly-once delivery by the downstream) |
failed | a definitive rejection, not sent, or proven absence | Final. A new run is a new effect |
failed, reason run_failed, run_cancelled, run_expired, run_completed or approval_rejected, no dispatched_at | the run ended before this proposal was dispatched, so it was settled in the transaction that ended the run (or by the owner's once-a-minute sweep for a run that ended earlier). It was never sent; its approval request is withdrawn | Nothing. To do the effect, start a new run. A dispatched or unknown proposal of the same run is not touched by this and stays the reconciler's |
How an unknown effect gets settled. Only the owner's reconciler asks, by the original logical key, through the connector's own lookup, at the base_url of the CALIBER_EFFECT_CALLBACK_CONNECTORS binding for that connector and project (for the generic http connector, at the lookup_url the operator listed for the effect's exact URL in CALIBER_EFFECT_HTTP_VERIFIERS). What comes back:
| The downstream says | Result |
|---|---|
| a stored request that is this proposal's effect | verified receipt, committed |
| 404 from a connector that proves absence final | failed (absence_proven) |
404 from any other connector (document-request and http included) | still unknown: delayed visibility or a request still in flight |
| 5xx, 401 or any other status | still unknown (detail http_<code>) |
| a 2xx whose body is not this proposal's effect (unreadable, or another request under the key) | still unknown, reported unverified |
| cannot be reached, or no binding for the connector and project | still unknown (lookup_failed, not_bound) |
A run that ended with a proposed effect. The run's end settles its never-dispatched proposals and withdraws its live approval requests in the same transaction (see the failed rows above), so a run that cannot be ended because that settlement fails (a database error) stays as it was and the end is retried: read the server log for the error class, fix the store, and the run ends normally. A run that ended before this existed is settled by the owner's sweep (once a minute, 50 runs per sweep, continuing after the last run of a full batch); a run the sweep cannot settle is logged by run id and error code or class, and the sweep goes on with the runs behind it. Until a proposal is settled the dispatcher refuses it (run_ended), so nothing is sent.
A dispatched row that does not clear. A row with abandoned: false and lease.expired: false was dispatched under the lease the owner still holds. If the dispatcher's settle fails while it keeps that lease (the store went away after the send, the receipt lookup raised), the dispatcher records unknown itself (settle_failed:<code>), so such a row does not stay dispatched. If it could not even do that (the store was still down, the thread died), the owner loop moves the row to unknown (in_flight_expired, audited as effect_in_flight_expired) once it has been dispatched for longer than CALIBER_EFFECT_IN_FLIGHT_MAX_SECONDS (900 s by default) and asks the downstream by key in the same pass. Neither rule sends anything. A row that is older than that bound and still dispatched means the loop is not running (the process is a secondary, or CALIBER_EFFECT_RECONCILER_ENABLED=false, or the loop is failing: its heartbeat row has kind effect_reconciler): check /readiness execution_role and the owner's logs. Do not resend. Capture the row (proposal_id, logical_key, owner_id, dispatch_token, dispatched_at) and the lease, ask the downstream by key, and escalate.
When to wait, and for how long. An unknown that survives a pass is not an error: a request that is still in flight, or a read that does not yet see its own write, looks exactly like a request that never arrived. Wait while the downstream's own people can still say it may land. The V07 scenario shows the case: a dispatcher killed before the send leaves the effect unknown, the reconciler's lookup finds nothing, and only when the request lands late from elsewhere does the next pass commit it, with the downstream counting one mutation throughout.
What you can do that is safe.
- Ask the downstream's owner whether the request exists, by the proposal's
logical_key(the idempotency key, in the view). That is evidence; keep it with the incident. - Ask the platform to ask the downstream now (admin scope, audited). The loop already does this every pass; this is for when you have just learned the request is visible and do not want to wait. It is the only action the view offers for a proposal (
safe_actions: ["reconcile"], on anunknownorreconciledrow and on adispatchedrow that isabandoned: true):curl -s -X POST -H "Authorization: Bearer $CALIBER_TOKEN" -H "Content-Type: application/json" \ -d '{"reason": "INC-4471: the downstream owner confirms the request is visible"}' \ "$CALIBER_BASE_URL/ajax-api/2.0/mlflow/caliber/system/effects/proposals/$PROPOSAL_ID/reconcile"The body is
reason(1 to 500 characters) and nothing else: any other key is400, because there is nothing an operator can assert. Readoutcomeandstatein the answer.committedmeans the downstream showed the request and the platform recorded a verified receipt.unknown(withhttp_404,http_5xx,unverified,lookup_failedornot_bound) means the evidence is not enough and nothing changed: a 404 is never read as "it did not happen".in_flightmeans the row is the dispatcher's own attempt and is still younger than the bound. Every request leaves oneeffect_reconcile_requestedaudit row (who, why, outcome, state afterwards) whether or not the proposal moved. It runs under the lease of the process that serves the request. A secondary answers409 not_execution_owner: ask the owner (/readinessshows which role a process has, andleasein the view names the owner). A lease taken over mid-request is409 lease_lostwith nothing recorded; a settled or never-dispatched proposal is409 not_reconcilable; more than 4 requests in flight in one process get429(retry shortly). A failed request is audited too, by error code or exception class only. - Attest a permanent absence when the downstream has its own evidence but no platform lookup can settle the proposal (admin scope, execution-owner lease, audited). Supply an opaque ticket, request-id or signed-statement reference and retain it with the incident:
curl -s -X POST -H "Authorization: Bearer $CALIBER_TOKEN" -H "Content-Type: application/json" \ -d '{"resolution":"failed","reason":"INC-4471: downstream owner attests absence","evidence_reference":"DS-INC-4471"}' \ "$CALIBER_BASE_URL/ajax-api/2.0/mlflow/caliber/system/effects/proposals/$PROPOSAL_ID/attest-failure"This exact body is the only accepted form. The only resolution is
failed: the action movesunknownthroughreconciledtofailed(orreconcileddirectly tofailed) using the existing owner-fenced CAS transitions. It cannot createcommitted; a verified downstream receipt remains the only path to that state. A successful request writes actor, reason, evidence reference, state before/after, owner and fencing token in oneeffect_attested_resolutionaudit row with the state move. It then useswake_parked_runs, so a run waiting on this proposal becomes eligible for the normal worker path. Missing evidence is400; a concurrent receipt/reconcile or terminal row is409, and the winning state is preserved. - Ask the connector to redeliver its receipt callback (see Callback and webhook redelivery). The platform asks the downstream itself before it records anything, so a callback can only confirm what the downstream confirms.
- Nothing else. Do not acquire the lease yourself to call the reconciler (see Reconciler).
An effect that stays unknown for good. A proposal becomes committed only with a receipt the platform read back from the downstream by key, and normal reconciliation fails it only when the connector proves absence final. A downstream that cannot yet show the request (a 404 is delayed visibility as far as anyone can tell) leaves the proposal unknown and its dependents blocked. If its owner instead provides durable evidence that the request was absent, use the attested-failure action above: it records that reference and moves the proposal through the existing unknown -> reconciled -> failed path. It never accepts a committed attestation. Do not edit or move the row with SQL, and do not resend the effect.
An http effect that ended unknown (#1055)
A governed webhook or API-request node is sent only to a URL the operator listed in CALIBER_EFFECT_HTTP_VERIFIERS, so every such proposal has a lookup by key and the reconciler settles it without sending again.
| You see | Do |
|---|---|
the run failed with HTTP effect did not commit: ambiguous:... or receipt_unverified, the proposal unknown | Nothing by hand. The loop asks the listed lookup_url by the proposal's logical_key every pass; the proposal becomes committed (with a receipt) when the downstream shows the request. Do not run the workflow again until it has settled: a new run is a new effect with a new key, and the downstream may already hold the first |
the proposal unknown for hours, reconcile answers unknown with detail http_404 | The downstream does not show the request: either it never arrived or its lookup is behind. Ask its owner by the logical_key; a late request still commits on the next pass. Nothing marks it failed on your word |
reconcile answers not_bound | The effect's URL is not (or no longer) listed for the project. Restore the entry in CALIBER_EFFECT_HTTP_VERIFIERS (the URL must match the proposal's resource exactly) and restart; then ask again |
reconcile answers lookup_failed | The lookup could not be made (down, refused by the egress policy, a timeout). Fix reachability; nothing changed |
reconcile answers unverified | The lookup answered, but the stored request is not this effect (another key, URL, method or body). Treat as an incident with the downstream's owner |
The failed run is not resumed by a settlement. A settled effect is exactly one effect (the downstream counted one mutation); whether to run the workflow again is a business decision made with the proposal in hand.
What is never safe. Re-sending the request; creating the same effect from a new run; editing the proposal row; deleting it; moving it with SQL. There is no operator action that fails an unknown proposal without the downstream's evidence, by design.
A legacy ledger claim (source: legacy_ledger)
The queued-run worker claims caliber_effect_ledger before an effectful node performs its effect. A claim that stays in_progress after a crash means the process died between the claim and the recorded outcome, or the request timed out after it may have left: whether it reached the remote system is unknown.
- List:
GET /caliber/system/effects(defaults tostatus=in_progress). Note theeffect_key,workflow_run_idandnode_id. - Decide at the remote system whether the effect happened. Do not infer it from CALIBER.
- Record the decision (admin scope, audited):
POST /caliber/system/effects/{effect_key}/resolve.curl -s -X POST -H "Authorization: Bearer $CALIBER_TOKEN" -H "Content-Type: application/json" \ -d '{"resolution": "skip", "reason": "request id 8841 exists at the downstream"}' \ "$CALIBER_BASE_URL/ajax-api/2.0/mlflow/caliber/system/effects/$EFFECT_KEY/resolve"skip(the effect did happen) marks the rowcompleted: a later attempt of the same run replays it and does not repeat it.retry(it did not) marks the rowfailed, which a later attempt of the same run may claim again. A row that is notin_progressis refused (400), and so is an unknown key and any other resolution. - The decision is on the row and in the audit log. It does not restart a run: see the next section.
Apply a proposal's key to the legacy resolve endpoint and it is refused (400) and changes nothing.
A gated, parked, or failed run
What it looks like. A proposal-gated run is waiting_effect, with error_code=effect_reconciliation, a current node, and a resume_checkpoint_id in its summary. The checkpoint kind is effect_reconciliation; it records the node inputs and each unresolved proposal's id, state, logical key and intent digest. The operator view lists the same run in parked_runs, including reason=effect_dependency_unresolved and resume_policy=same_run_same_occurrence. A legacy-claim refusal remains a terminal failure whose message names the resolve endpoint.
Why. Before every node, at the top of every retry attempt, the runtime checks the effects the node and everything it depends on asked for. While one is dispatched, unknown or reconciled, the node does not run and nothing absorbs the refusal: no fan-out item, loop iteration or error boundary turns it into a handled error. This is the guarantee, not a fault: no write that depends on an effect nobody can vouch for is made.
A parked run is not manually resumed. While waiting_effect, POST /caliber/workflow-runs/{run_id}/resume and retry are refused. The reconciler or a verified receipt callback is the only wake-up path. When every checkpointed proposal reaches committed or failed, the platform changes the same run to queued, emits workflow.run.effect_resumed, and the worker resumes from the checkpoint. The run id, logical key and intent digest remain unchanged, so no second logical occurrence or mutation is created. A run that is genuinely failed remains terminal: no transition leaves it, and retry creates a new run.
Steps.
- Find the run in
parked_runs(or find its proposal in the view above, using theworkflow_run_idfilter) and inspect its checkpoint reason and effect states. - Do not call
resumeorretrywhile it iswaiting_effect; settle each proposal by the reconciler or a verified callback. - Wait for
workflow.run.effect_resumedand the run to return toqueued. The worker then uses the stored checkpoint and preserves the original occurrence. - If the run is genuinely terminal
failed, settle the effect first and only then decide about a retry, with the owner of the downstream:- effect
committed(or legacyskip): the work is done. Do not retry the run; if later nodes must still run, that is a design question for the workflow owner, not a button. - effect
failedwith proof (or legacyretry): a retry is safe with respect to this effect. - effect still
unknown: do not retry. A retry would ask for the effect again.
- effect
- A run that lease recovery requeued runs again from the beginning. If an effect it claimed is still
in_progress(or a proposal of it is open), it endsfailedat that node; it needs no manual retry, and a manual retry does not help it (that is a new run, see above). Read itsworkflow.run.recoveredevent (GET /caliber/workflow-runs/{run_id}/events) and apply step 3 before anything else.
Never. Retry the run "to see whether it works now" while its effect is open.
A governed step refused for its token budget, or left a reservation open
What it looks like. A run failed with governed agent step token reservation refused: token_budget_exhausted (budget=B committed=C requested=R), or ... reservation_replayed (two resumers racing), or ... store_failed; or a row of caliber_step_token_reservations that stays reserved after its step should have ended.
-- what a run has counted: an open reservation counts at its whole ceiling, a final one at its charge
SELECT state, count(*) AS n, sum(coalesce(charged_tokens, reserved_tokens)) AS tokens
FROM caliber_step_token_reservations WHERE workflow_run_id = :run GROUP BY state;
-- open reservations past their deadline (the owner finalizes them after CALIBER_AGENT_RESERVATION_GRACE_SECONDS)
SELECT reservation_id, workflow_run_id, node_id, occurrence_id, attempt, reserved_tokens, deadline_at
FROM caliber_step_token_reservations WHERE state = 'reserved' AND deadline_at < now() ORDER BY deadline_at;
Why. A governed step reserves its max_tokens ceiling against the run's budget (CALIBER_AGENT_RUN_MAX_TOKENS) before its adapter is called, and is charged what it reported only when the platform believes it; every other result keeps the whole reservation. This is the guarantee, not a fault: a call whose outcome nobody knows stays charged.
Steps.
token_budget_exhausted: the run has spent or reserved its budget. Nothing was reserved by the refused step and its adapter was not called. RaiseCALIBER_AGENT_RUN_MAX_TOKENS(a restart applies it) and start a new run; do not edit or delete a reservation row (the database refuses both, and no operator action lowers a charge).reservation_replayed: this step (run, node, occurrence, attempt) already holds a reservation that this process did not create, so a provider call for it may already have spent. The platform does not call again on that strength. Only two resumers of one step racing for the same attempt meet it now: one reserves and calls the provider, the other is refused, and nothing needs fixing. A node's own retry and a resume after a crash are the next attempt (one past the highest the occurrence has reserved) and reserve afresh: the earlier reservation stays charged in full, so the run's budget adds up both calls, and a resume that does not fit the remaining budget is refused withtoken_budget_exhausted(step 1). A proposal already recorded for the occurrence short-circuits the step, so resuming it asks the model nothing and reserves nothing. A resume cannot tell a live earlier worker from a dead one: a worker that starts the same step while another's call is still in flight derives the next attempt and makes a second, concurrent provider call under its own reservation. Both are charged in full, the budget bounds the spend, and the occurrence still gets one proposal. Every crash also leaves its whole ceiling counted (nothing is released), so a step that keeps crashing uses up the run's budget one ceiling at a time until it is refused withtoken_budget_exhausted(step 1): fix what crashes, then raiseCALIBER_AGENT_RUN_MAX_TOKENSor start a new run.- A reservation still
reserved: its worker died or was cancelled. It is already counted in full. The execution owner's reconciler loop moves it toabandoned(still at its whole reservation) once its step's deadline plus the grace has passed; if it does not (caliber_worker_heartbeatsshows no liveeffect_reconciler, or the loop is turned off), the row stays open and keeps counting, which is safe. Start the loop by fixing the owner (see Owner crash and failover); do not update the row. A worker that returns after the owner abandoned its reservation cannot lower the charge, and an overrun it reports after that (past the step's deadline plus the grace) is not recorded. store_failed: the database could not take the reservation (or migration0133has not run). Nothing was reserved and the adapter was not called. Fix the database or run the migration, then retry.
Never. Delete or edit a reservation to "give the tokens back". The provider may have charged them.
Callback and webhook redelivery
The receipt callback (POST /caliber/effects/callbacks/receipt, signed, no session) is the one consumer of the inbound inbox (caliber_inbox_events, key (consumer, source, event_id); consumer effect-callback, the source a digest of the connector and project, the event id the X-Caliber-Delivery header). What each answer means for the sender:
| Answer | Meaning | The sender should |
|---|---|---|
200 status: duplicate | this delivery id was already consumed with this key; nothing applied | stop: it succeeded earlier |
200 status: already_committed | the proposal is committed (a new delivery id, or it lost a race to the commit) | stop |
200 status: committed with receipt_id | recorded now | stop |
202 status: unknown | the downstream holds nothing (yet) under the key, or something that is not this effect; nothing consumed | try again later with the same or a new delivery id |
202 status: in_flight | still dispatched: the dispatcher, or the reconciler once abandoned, owns it | try again later |
409 inbox_payload_mismatch | the same delivery id with a different key | send the new message under a new delivery id; never reuse an id |
409 with a reason code (receipt_conflict, stale_version, ...) | the commit was refused and rolled back whole, the reservation too | retry the same delivery |
409 proposal_failed, not_dispatched | the proposal is failed, or was never dispatched | do not retry; it is not waiting for a receipt |
502 lookup_failed, 503 busy | the downstream could not be asked (or four lookups for this connector and project are in flight) | retry |
404 no such proposal | not this connector's, not this project's, or no such key | check the key |
401 callback rejected | unknown connector or project, unreadable secret, bad signature or a timestamp more than 300 s off: one answer for all | check the binding, the secret and the clock |
A delivery answered 5xx, or never answered because the process died before the commit, left no reservation: the sender's retry is processed. A failed transaction is never treated as already processed.
An inbox row stuck at received. A reservation and its processed marker commit in one transaction, so a committed received row can only come from an apply that committed or rolled back the session it was handed (InboxContractError). Every later delivery of that id is then answered duplicate. Steps:
- List the rows (query above) and note the
consumer,source,event_id. - For
effect-callback, the proposal's own state is the truth: read it in the view bylogical_key. If it iscommitted, nothing is lost; if it isunknown, ask the connector to send the callback again under a new delivery id (a new id is a new inbox key, so it is processed and the platform asks the downstream again). - Do not edit or delete the row. Report it with the row and the proposal state: it indicates a defect in the consumer.
The GitHub webhook is not a consumer of this table. It has its own signed delivery inbox (caliber_workspace_source_events): a repeat delivery is 202 with duplicate: true and no second row, and a reused delivery id with different evidence gets the same generic 401 as any other rejection (deliberately not a 409). Nothing to recover; the sender's retry is safe.
Outbox backlog and dead letters
Business events (the outbox). Run events are written to caliber_event_outbox in the transaction of the transition that caused them, then delivered by OutboxPublisher, an owner-only loop. Delivery is at least once; consumers deduplicate on (consumer, event_id). Read the depth with the query above, or from Python:
import os
from sqlalchemy import create_engine
from sqlalchemy.orm import sessionmaker
from caliber.events.outbox import outbox_depth
factory = sessionmaker(create_engine(os.environ["CALIBER_DATABASE_URL"]))
with factory() as session:
# {"pending": ..., "delivered": ..., "dead": ..., "oldest_pending": ...}: the last is the creation time of the
# oldest row that is still pending, the lag of the slowest undelivered event
print(outbox_depth(session))
| You see | Cause | Do |
|---|---|---|
pending grows, oldest_pending is old, no owner | the publisher runs only on the lease holder | Owner crash and failover |
pending grows with an owner | a consumer keeps failing; last_error names the consumer and the exception class, never a message or payload | fix the consumer; rows retry with exponential backoff (cap 300 s) |
dead rows | a row ran out of CALIBER_EVENT_OUTBOX_MAX_ATTEMPTS (default 20), or every earlier handoff attempt never finished (abandoned: ...) | keep them: they are the record. There is no replay tool yet; report the rows with event_id and last_error |
Delivered rows are pruned after CALIBER_EVENT_OUTBOX_RETENTION_DAYS (7); dead rows are never pruned. The default registers no consumer, so a healthy default deployment shows pending near zero and no growth in dead.
Outbound webhooks (dead letters). An event the dispatcher could not deliver is recorded in caliber_webhook_dead_letters, with a kind: exhausted (the receiver is broken), overflow (CALIBER shed load), shutdown (accepted and still queued when the owner stopped or died) or accept_failed (the database could not record the acceptance, so the event was deliberately not sent).
GET /caliber/system/webhook-dead-letters(defaults tostatus=open).- Fix the receiver first. Delivery is at least once by design, so a receiver must tolerate a repeat.
POST /caliber/system/webhook-dead-letters/{dead_letter_id}/replay(operator). A replay that fails leaves the rowopenwith the reason; two concurrent replays are arbitrated by the database (the loser gets409).503means no dispatcher is configured or delivery is disabled.- For an event that must not be sent:
POST .../acknowledgewith a note. It marks the row handled; it deletes nothing.
Nothing redelivers a dead letter by itself, and a replay is a new send: do it only when the receiver is healthy.
A run refused for its pins or its rule bundle
A run admitted in the reference profile executes exactly what its manifest pinned, and fails closed when that is no longer true. Two different things happen, and they are told apart by where you see them. These are explained, with every code and its recovery, in Reference profile; the short version for the operator.
Refused at admission (no run is created; the HTTP 409 body carries only a message, not a code, so match the message text):
| The message | Recovery |
|---|---|
"this workflow version has no sealed deployment bundle", "failed its integrity check", or "unresolved dependencies" (internally bundle_unavailable) | compile and publish the version again |
starts rule_bundle_refused: (internally a manifest refusal) | restore the bundle file or update the pinned digest deliberately (path and digest together) |
A run that ended failed (the run has an error code and a summary):
| The run's error code | Recovery |
|---|---|
pins_changed, pins_mismatch, model_route_changed | the run stays failed; restore what changed or submit a new run |
context_denied, the summary naming rule_bundle_changed or rule_bundle_unavailable | the run stays failed even if you restore the file; resubmit |
authority_denied (grant_expired, grant_revoked, not_a_member) | submit a new run as someone who may |
The same rule as for effects applies: a refused run is not resumed, and a new run is a new run. For a run that had an effect in doubt, settle the effect first (A gated, parked, or failed run).
After a restore
Backup and restore are in Backup and recovery: back up the CALIBER database and the MLflow backend store together, restore the secret encryption key separately, run caliber-migrate against the restored database, then verify /readiness reports ready: true including the schema check, and run Reconcile releases on the Releases page. The effect, receipt, manifest, outbox and inbox tables live in the CALIBER database and are restored with it, back to the snapshot time. What that means for effects, which that page does not cover:
- Stop every replica before you restore.
- Start the restored deployment with
CALIBER_BACKGROUND_TASKS_ENABLED=false: no loop runs and every replica is asecondary(there is no lease to take), so nothing executes yet. - Compare the downstream with the runs and effects created after the snapshot time. An effect made after that point has no ledger or proposal row in the restored database, and a restored
queuedorrunningrun will perform it again. The restored lease row and everydispatch_tokenare from snapshot time too, so a restored token can be lower than tokens issued after it. - Only when that comparison is done, enable background tasks again.
Do not hand-edit rows to reconcile them with the downstream; use the sections above.
Related
- Reference profile: the lease, the outbox and inbox, effect proposals, the reconciler, the operator view and the receipt callback, with every code.
- ADR 0002: execution ownership: who may run each loop and what each loop leaves behind when its owner dies.
- Operations runbook: releases, queues, rollbacks and SLO incidents.
- Backup and recovery and Health and readiness.