{"record":{"id":"46ae4958484bbef4","repo":"nautechsystems/nautilus_trader","slug":"failed-to-record-signed-transaction-transition-e","errorCode":null,"errorMessage":"Failed to record signed transaction transition: {e}","messagePattern":"Failed to record signed transaction transition: (.+?)","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"crates/adapters/blockchain/src/cache/database.rs","lineNumber":6735,"sourceCode":"        .bind(intent_id)\n        .execute(&mut *transaction)\n        .await\n        .map_err(|e| anyhow::anyhow!(\"Failed to mark execution intent signed: {e}\"))?;\n        sqlx::query(\n            \"\n            INSERT INTO execution_transaction_transition (\n                intent_id, transaction_hash_id, transition_key, from_status, to_status\n            ) VALUES ($1, $2, $3, $4, 'signed')\n            ON CONFLICT (intent_id, transition_key) DO NOTHING\n            \",\n        )\n        .bind(intent_id)\n        .bind(row.id)\n        .bind(format!(\"signed:{transaction_hash}\"))\n        .bind(current_status)\n        .execute(&mut *transaction)\n        .await\n        .map_err(|e| anyhow::anyhow!(\"Failed to record signed transaction transition: {e}\"))?;\n\n        transaction\n            .commit()\n            .await\n            .map_err(|e| anyhow::anyhow!(\"Failed to commit signed transaction: {e}\"))?;\n        Ok(row)\n    }\n\n    /// Records an idempotent transaction observation and advances its intent state.\n    ///\n    /// # Errors\n    ///\n    /// Returns an error if the transition is invalid, the hash is unknown, or persistence fails.\n    #[expect(\n        clippy::too_many_arguments,\n        reason = \"the parameters are the canonical receipt observation persisted atomically\"\n    )]\n    pub async fn record_execution_status(","sourceCodeStart":6717,"sourceCodeEnd":6753,"githubUrl":"https://github.com/nautechsystems/nautilus_trader/blob/18893faf8b356be3320add8de2f861b0b647cf06/crates/adapters/blockchain/src/cache/database.rs#L6717-L6753","documentation":"Recording the audit transition row in execution_transaction_transition (from the previous status to 'signed') failed with a database error. This is the idempotent history insert (ON CONFLICT DO NOTHING); the wrapped sqlx error indicates the append could not complete, rolling back the whole persistence transaction.","triggerScenarios":"The INSERT into execution_transaction_transition errored: connection failure, statement timeout, schema mismatch (missing columns/changed constraints after a partial migration), or a FK violation if the hash row id became invalid mid-transaction.","commonSituations":"Database schema drift where the transition table was altered or not migrated; transient connectivity loss late in the transaction; heavy contention on the transition table under bulk signing.","solutions":["Read the inner {e}; if it mentions missing columns/relations, run the pending schema migrations for execution_transaction_transition.","Retry the whole operation with backoff — the ON CONFLICT DO NOTHING makes the transition insert idempotent.","Verify database connectivity and pool health if failures are transient.","Confirm application and schema versions match (no partial migration) before restarting signing jobs."],"exampleFix":null,"handlingStrategy":"retry","validationCode":"// ensure the audit table exists and matches expected schema before signing batches\nsqlx::query(\"SELECT 1 FROM execution_transaction_transition LIMIT 1\").fetch_optional(&pool).await?\n    .ok_or_else(|| anyhow::anyhow!(\"execution_transaction_transition missing or empty schema\"))?;","typeGuard":null,"tryCatchPattern":"match db.add_execution_transaction(...).await {\n    Err(e) if e.to_string().contains(\"Failed to record signed transaction transition\") => {\n        run_pending_migrations(&pool).await?; // schema drift case\n        retry(2, || db.add_execution_transaction(...)).await?;\n    }\n    r => r?,\n}","preventionTips":["Run migrations as part of deployment before enabling signing workers","Keep application and schema versions in lockstep","Rely on ON CONFLICT DO NOTHING idempotency when retrying","Alert on transition-insert failures — they indicate schema or connectivity drift"],"tags":["database","audit","sql","transactions"],"backgroundTag":"database-write-failed","analyzedSha":"18893faf8b356be3320add8de2f861b0b647cf06","analyzedAt":"2026-09-08T20:49:34.690Z","contentChangedAt":"2026-09-08T20:49:34.690Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}