{"record":{"id":"b2f119527e0f34e8","repo":"nautechsystems/nautilus_trader","slug":"failed-to-commit-verification-migration-e","errorCode":null,"errorMessage":"Failed to commit verification migration: {e}","messagePattern":"Failed to commit verification migration: (.+?)","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"crates/adapters/blockchain/src/cache/database.rs","lineNumber":4605,"sourceCode":"                .map_err(|e| anyhow::anyhow!(\"Failed to activate verification schema: {e}\"))?;\n        }\n        sqlx::query(\n            \"\n            INSERT INTO execution_schema_version (component, version)\n            VALUES ('evm_execution_verification', $1)\n            ON CONFLICT (component) DO UPDATE SET version = EXCLUDED.version\n            WHERE execution_schema_version.version <= EXCLUDED.version\n            \",\n        )\n        .bind(VERIFICATION_SCHEMA_VERSION)\n        .execute(&mut *transaction)\n        .await\n        .map_err(|e| anyhow::anyhow!(\"Failed to activate verification schema: {e}\"))?;\n\n        transaction\n            .commit()\n            .await\n            .map_err(|e| anyhow::anyhow!(\"Failed to commit verification migration: {e}\"))?;\n        Ok(())\n    }\n\n    /// Activates or resumes protected signed-transaction storage for this database.\n    pub(crate) async fn ensure_execution_payload_storage(\n        &self,\n        keys: &PayloadKeySet,\n    ) -> anyhow::Result<()> {\n        let marker = self.execution_payload_marker().await?;\n        match marker {\n            None => self.activate_execution_payload_storage(keys).await?,\n            Some(version) => anyhow::ensure!(\n                version == EXECUTION_PAYLOAD_PROTOCOL_VERSION,\n                \"Execution payload protection version {version} is newer than supported version {EXECUTION_PAYLOAD_PROTOCOL_VERSION}\"\n            ),\n        }\n\n        loop {","sourceCodeStart":4587,"sourceCodeEnd":4623,"githubUrl":"https://github.com/nautechsystems/nautilus_trader/blob/18893faf8b356be3320add8de2f861b0b647cf06/crates/adapters/blockchain/src/cache/database.rs#L4587-L4623","documentation":"Thrown when committing the transaction that installed the verification schema fails. All DDL and evidence inserts succeeded locally, but Postgres refused COMMIT — typically because the connection died, the transaction was aborted by another error, or a serialization/deadlock was detected at commit time.","triggerScenarios":"`transaction.commit()` at the end of `ensure_execution_verification_schema` returns an error: network disconnect between statement execution and commit, Postgres terminating the backend (idle-in-transaction timeout, admin cancel), or the transaction already aborted by a prior statement error not surfaced earlier.","commonSituations":"Long-running bootstrap exceeding `idle_in_transaction_session_timeout`; a failover or connection-pool eviction during startup; a concurrent process dropping a table that the transaction touched, causing commit-time conflict.","solutions":["Check Postgres logs for why the commit failed (backend termination, deadlock, timeout)","Increase `idle_in_transaction_session_timeout` or speed up bootstrap if migrations are slow","Retry the bootstrap — the migration is transactional so nothing was partially applied","Verify network stability between the node and Postgres"],"exampleFix":"// before: bootstrap killed by idle-in-transaction timeout\n// postgresql.conf: idle_in_transaction_session_timeout = '10s'\n// after\n// postgresql.conf: idle_in_transaction_session_timeout = '5min'","handlingStrategy":"retry","validationCode":"// pre-flight: confirm the connection is healthy and timeouts allow a long transaction\nsqlx::query(\"SELECT 1\").execute(&pool).await?;\n// ensure idle_in_transaction_session_timeout is generous\nlet t: Option<String> = sqlx::query_scalar(\"SHOW idle_in_transaction_session_timeout\").fetch_one(&pool).await?;","typeGuard":null,"tryCatchPattern":"for attempt in 0..3 {\n    match db.ensure_execution_verification_schema().await {\n        Err(e) if e.to_string().contains(\"Failed to commit verification migration\") && attempt < 2 => {\n            tokio::time::sleep(Duration::from_secs(2u64 << attempt)).await; continue; // transactional: safe to retry\n        }\n        other => { other?; break; }\n    }\n}","preventionTips":["Raise idle_in_transaction_session_timeout for migration transactions","Run migrations during stable network windows","Rely on transaction atomicity: on commit failure, simply retry from scratch","Alert on Postgres backend termination events"],"tags":["postgres","transaction","commit"],"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"}