{"record":{"id":"7504cbfdb63e39e3","repo":"nautechsystems/nautilus_trader","slug":"failed-to-commit-execution-intent-reservation-e","errorCode":null,"errorMessage":"Failed to commit execution intent reservation: {e}","messagePattern":"Failed to commit execution intent reservation: (.+?)","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"crates/adapters/blockchain/src/cache/database.rs","lineNumber":3384,"sourceCode":"        })?;\n\n        sqlx::query(\n            \"\n            INSERT INTO execution_transaction_transition (\n                intent_id, transition_key, to_status, block_number\n            ) VALUES ($1, 'prepared', 'prepared', $2)\n            \",\n        )\n        .bind(row.id)\n        .bind(created_block)\n        .execute(&mut *transaction)\n        .await\n        .map_err(|e| anyhow::anyhow!(\"Failed to record prepared execution intent: {e}\"))?;\n\n        transaction\n            .commit()\n            .await\n            .map_err(|e| anyhow::anyhow!(\"Failed to commit execution intent reservation: {e}\"))?;\n        Ok(row)\n    }\n\n    /// Assigns the signer nonce to a prepared execution intent.\n    ///\n    /// Repeating the same assignment is idempotent. A different nonce or non-prepared state\n    /// fails closed.\n    ///\n    /// # Errors\n    ///\n    /// Returns an error if the intent cannot own the nonce or persistence fails.\n    pub async fn assign_execution_intent_nonce(\n        &self,\n        intent_id: i64,\n        nonce: u64,\n    ) -> anyhow::Result<()> {\n        let nonce_db = i64::try_from(nonce)\n            .with_context(|| format!(\"Execution nonce {nonce} exceeds PostgreSQL BIGINT\"))?;","sourceCodeStart":3366,"sourceCodeEnd":3402,"githubUrl":"https://github.com/nautechsystems/nautilus_trader/blob/2114cf6f761429e0adb5ca9596fcd7b895b16011/crates/adapters/blockchain/src/cache/database.rs#L3366-L3402","documentation":"Thrown when COMMIT fails at the end of reserve_execution_intent, after both the intent row and its 'prepared' transition row were inserted. The transaction rolls back, so the signer slot and client_order_id are NOT reserved - the error means ownership was not acquired and nothing was signed on top of it.","triggerScenarios":"Connection reset at commit time; Postgres failover between the inserts and COMMIT; idle_in_transaction_session_timeout firing on a slow path.","commonSituations":"Unstable managed-database links; long pauses (GC, tracing) delaying commit past server timeouts.","solutions":["Re-run the reservation - the failed commit means the slot is still free","Raise idle_in_transaction_session_timeout on the server","Check Postgres logs for the commit-time failure cause if it recurs"],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":"match db.reserve_execution_intent(&intent).await {\n    Err(e) if e.to_string().contains(\"Failed to commit execution intent reservation\") => {\n        // commit failed and rolled back: safe to re-reserve the same client_order_id\n    }\n    other => other?,\n}","preventionTips":["Never sign or broadcast until reserve_execution_intent returns Ok - only then is ownership durable","Raise idle_in_transaction_session_timeout if reservation paths include slow calls","Reuse the same client_order_id when re-reserving so ownership stays coherent"],"tags":["rust","sqlx","postgresql","commit-failed","execution-intent"],"backgroundTag":"database-commit-failed","analyzedSha":"2114cf6f761429e0adb5ca9596fcd7b895b16011","analyzedAt":"2026-08-21T11:28:30.864Z","schemaVersion":2},"datasetVersion":"2026-08-22T04:17:13.399Z"}