X_IDEMPOTENCY_STATUS_UNKNOWN
Means
an idempotency record holds a status this build cannot read
Typical cause
x_idempotency.status holds a word this build has no branch for. The record was written by whatever build was deployed when the first attempt ran, which on a rolling deploy is not this one. Refused rather than cast: an unknown status fell past every branch of withIdempotency and answered { value: null, replayed: true } — "this already ran, here is its result" — for a record nobody could read
Fix
psql "$DATABASE_URL" -c "select key, status from x_idempotency where status not in ('in-flight', 'settled', 'failed')" — then drain the older processes