{"record":{"id":"ada2d5a2289f4bb4","repo":"nautechsystems/nautilus_trader","slug":"execution-payload-storage-is-not-ready","errorCode":null,"errorMessage":"Execution payload storage is not ready","messagePattern":"Execution payload storage is not ready","errorType":"validation","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"crates/adapters/blockchain/src/cache/database.rs","lineNumber":5072,"sourceCode":"    }\n\n    async fn validate_execution_payload_ready(&self, keys: &PayloadKeySet) -> anyhow::Result<()> {\n        let mut transaction = self\n            .pool\n            .begin()\n            .await\n            .context(\"failed to start execution payload validation\")?;\n        let state_row = sqlx::query(\n            \"SELECT deployment_id, protocol_version, operation, active_key_id \\\n             FROM execution_payload_state WHERE component = 'signed_transactions' FOR SHARE\",\n        )\n        .fetch_optional(&mut *transaction)\n        .await\n        .context(\"failed to lock execution payload state\")?\n        .ok_or_else(|| anyhow::anyhow!(\"Execution payload state is missing\"))?;\n        let state = execution_payload_state_from_row(&state_row)?;\n        validate_execution_payload_state(&state, keys)?;\n        anyhow::ensure!(\n            state.operation == \"ready\",\n            \"Execution payload storage is not ready\"\n        );\n        let (payload_fence, payload_constraint) =\n            sqlx::query_as::<_, (bool, bool)>(EXECUTION_PAYLOAD_INFRASTRUCTURE_QUERY)\n                .fetch_one(&mut *transaction)\n                .await\n                .context(\"failed to inspect execution payload protection infrastructure\")?;\n        anyhow::ensure!(\n            payload_fence && payload_constraint,\n            \"Execution payload storage is marked ready without its write fence or constraint\"\n        );\n        validate_execution_payload_key_inventory(&mut transaction, keys).await?;\n        transaction\n            .commit()\n            .await\n            .context(\"failed to complete execution payload validation\")?;\n        Ok(())","sourceCodeStart":5054,"sourceCodeEnd":5090,"githubUrl":"https://github.com/nautechsystems/nautilus_trader/blob/18893faf8b356be3320add8de2f861b0b647cf06/crates/adapters/blockchain/src/cache/database.rs#L5054-L5090","documentation":"The execution_payload_state row exists but its operation field is not 'ready', so the storage subsystem refuses to proceed. Operations go through states (e.g. migrating/preparing) and only a 'ready' state permits normal payload operations.","triggerScenarios":"Calling payload storage APIs while a migration or preparation is still in progress or was left incomplete; state row stuck in a non-ready operation value after a crashed migration.","commonSituations":"Concurrent access during a migration; a prior migration failed midway leaving operation unset; manually editing execution_payload_state.","solutions":["Wait for the in-flight migration/initialization to finish and retry","Re-run the migration to completion so operation becomes 'ready'","Inspect execution_payload_state.operation and repair via the proper init path if stuck","Avoid manual edits to the state table"],"exampleFix":null,"handlingStrategy":"retry","validationCode":"let op: (String,) = sqlx::query_as(\"SELECT operation FROM execution_payload_state WHERE component = 'signed_transactions'\").fetch_one(&mut conn).await?;\nif op.0 != \"ready\" { wait_until_ready_or_migrate(&mut conn).await?; }","typeGuard":null,"tryCatchPattern":"match storage.inspect(...).await {\n    Err(e) if e.to_string().contains(\"not ready\") => {\n        backoff(|| async { poll_state_ready(&conn).await }).await?;\n        storage.inspect(...).await\n    }\n    other => other,\n}","preventionTips":["Gate payload operations behind a readiness check at startup","Let migrations finish before accepting traffic","Never hand-edit the operation column","Alert on state stuck non-ready beyond a threshold"],"tags":["database","state","not-ready"],"backgroundTag":"invalid-state-transition","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"}