{"record":{"id":"791ea2375da06ade","repo":"nautechsystems/nautilus_trader","slug":"execution-verification-schema-version-installed-v","errorCode":null,"errorMessage":"Execution verification schema version {installed_version} is newer than supported version {VERIFICATION_SCHEMA_VERSION}","messagePattern":"Execution verification schema version (.+?) is newer than supported version (.+?)","errorType":"validation","errorClass":"anyhow::Error","httpStatus":null,"severity":"critical","filePath":"crates/adapters/blockchain/src/cache/database.rs","lineNumber":3999,"sourceCode":"        sqlx::query(\n            \"LOCK TABLE execution_intent, execution_transaction_hash, \\\n             execution_verification_nonce, execution_verified_finalized_header, \\\n             execution_verification_decision, execution_replacement_scan \\\n             IN ACCESS EXCLUSIVE MODE\",\n        )\n        .execute(&mut *transaction)\n        .await\n        .map_err(|e| anyhow::anyhow!(\"Failed to lock execution verification state: {e}\"))?;\n\n        let installed_version = sqlx::query_scalar::<_, i16>(\n            \"SELECT version FROM execution_schema_version \\\n             WHERE component = 'evm_execution_verification'\",\n        )\n        .fetch_optional(&mut *transaction)\n        .await\n        .map_err(|e| anyhow::anyhow!(\"Failed to read verification schema version: {e}\"))?;\n        if let Some(installed_version) = installed_version {\n            anyhow::ensure!(\n                installed_version <= VERIFICATION_SCHEMA_VERSION,\n                \"Execution verification schema version {installed_version} is newer than supported version {VERIFICATION_SCHEMA_VERSION}\"\n            );\n        }\n\n        let current = sqlx::query_as::<_, (String, String, i64, i64)>(\n            \"\n            SELECT manifest_version, manifest_digest, next_canonical_nonce, revision\n            FROM execution_verification_nonce\n            WHERE chain_id = $1 AND wallet_address = $2\n            FOR UPDATE\n            \",\n        )\n        .bind(chain_id)\n        .bind(bootstrap.wallet_address)\n        .fetch_optional(&mut *transaction)\n        .await\n        .map_err(|e| anyhow::anyhow!(\"Failed to read canonical nonce ledger: {e}\"))?;","sourceCodeStart":3981,"sourceCodeEnd":4017,"githubUrl":"https://github.com/nautechsystems/nautilus_trader/blob/18893faf8b356be3320add8de2f861b0b647cf06/crates/adapters/blockchain/src/cache/database.rs#L3981-L4017","documentation":"The installed schema version recorded in execution_schema_version exceeds the VERIFICATION_SCHEMA_VERSION compiled into this binary. The code refuses to bootstrap because an older binary must not touch a newer schema layout, which could corrupt data or violate its invariants.","triggerScenarios":"executing the bootstrap after the database was migrated by a newer application build: installed_version > VERIFICATION_SCHEMA_VERSION in execution_schema_version for component 'evm_execution_verification'.","commonSituations":"Rolling back a deployment to an older image/tag against a database already migrated forward; a canary or staging environment upgraded the shared database; rebuilding an old git commit against a current dev database.","solutions":["Deploy a build whose VERIFICATION_SCHEMA_VERSION is >= the installed version (roll forward, not back)","If rollback is intentional, restore a database snapshot taken before the newer migration","Do not hand-edit execution_schema_version; use the project's migration tooling","Pin the shared database to the same release channel as the binary"],"exampleFix":"// before: old binary against migrated DB\n// installed_version=3, VERIFICATION_SCHEMA_VERSION=2 -> error\n// after: roll forward to a binary supporting version 3\ngit checkout main && cargo build --release  # includes newest schema\n","handlingStrategy":"validation","validationCode":"let v: Option<i16> = sqlx::query_scalar(\n  \"SELECT version FROM execution_schema_version\n   WHERE component='evm_execution_verification'\")\n  .fetch_optional(&mut *conn).await?;\nif let Some(v) = v {\n    if v > VERIFICATION_SCHEMA_VERSION {\n        panic!(\"DB schema v{v} > binary-supported v{VERIFICATION_SCHEMA_VERSION}; roll forward\");\n    }\n}","typeGuard":null,"tryCatchPattern":"match bootstrap_verification(&mut tx).await {\n    Err(e) if e.to_string().contains(\"newer than supported version\") => {\n        error!(%e, \"database schema is ahead of this binary; refuse to start\");\n        std::process::exit(exitcode::CONFIGURATION); // fail fast, never downgrade-write\n    }\n    other => other,\n}","preventionTips":["Never roll back deployments without a matching DB snapshot/rollback plan","Keep schema version checks in a startup preflight that fails fast","Use migrations that only move forward; make binaries backward-compatible or refuse to start","Coordinate shared dev databases with the release that migrates them"],"tags":["database","schema","versioning","migration","downgrade"],"backgroundTag":"schema-validation-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"}