{"record":{"id":"6c774240e9160cc1","repo":"nautechsystems/nautilus_trader","slug":"legacy-execution-transaction-has-no-plaintext","errorCode":null,"errorMessage":"Legacy execution transaction {} has no plaintext","messagePattern":"Legacy execution transaction (.+?) has no plaintext","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"crates/adapters/blockchain/src/cache/database.rs","lineNumber":5252,"sourceCode":"                        )\n                    })?;\n                    let key_id = envelope_key_id(envelope)?;\n                    anyhow::ensure!(\n                        keys.contains_key(&key_id),\n                        \"Execution transaction {} requires an unavailable payload key\",\n                        hash.id\n                    );\n                    key_ids.insert(alloy::hex::encode(key_id));\n                    let context = payload_context(&intent, hash, deployment_id)?;\n                    keys.unseal(envelope, &context)?\n                } else {\n                    anyhow::ensure!(\n                        hash.sealed_transaction.is_none(),\n                        \"Legacy execution transaction {} contains an envelope\",\n                        hash.id\n                    );\n                    hash.raw_transaction.clone().ok_or_else(|| {\n                        anyhow::anyhow!(\"Legacy execution transaction {} has no plaintext\", hash.id)\n                    })?\n                };\n                authenticate_retained_payload(\n                    &raw_transaction,\n                    &intent,\n                    hash,\n                    deployment_id.as_deref().unwrap_or(\"\"),\n                )?;\n\n                if let Some(policy) = policy\n                    && retained_payload_requires_policy(&intent, hash, policy)?\n                {\n                    authenticate_payload(\n                        &raw_transaction,\n                        &intent,\n                        hash,\n                        policy,\n                        deployment_id.as_deref().unwrap_or(\"\"),","sourceCodeStart":5234,"sourceCodeEnd":5270,"githubUrl":"https://github.com/nautechsystems/nautilus_trader/blob/18893faf8b356be3320add8de2f861b0b647cf06/crates/adapters/blockchain/src/cache/database.rs#L5234-L5270","documentation":"In the legacy load path, a row has neither a sealed envelope (expected there) nor a plaintext raw transaction, so there is nothing to return. The loader converts the missing raw_transaction into this anyhow error naming the row id.","triggerScenarios":"Loading execution transactions without keys/deployment_id while a row's raw_transaction column is NULL (and sealed_transaction is also NULL, otherwise 2224 fires first).","commonSituations":"Rows whose payload was cleared after reclassification but not restored; a partially completed sealing migration deleted plaintext without writing envelopes; loading a truncated/partial backup.","solutions":["Restore the row's payload from a backup or re-derive it from the execution intent source.","If the row was migrated to sealed form, load with keys and deployment_id so the protected path is used.","Inspect the row: if sealed_transaction exists, switch to protected loading instead of expecting plaintext.","Check writer logs for a failed payload write when the row was created."],"exampleFix":"// Row missing payload in legacy mode\n{ id: \"0x123\", raw_transaction: null, sealed_transaction: null }\n// after restore\n{ id: \"0x123\", raw_transaction: \"0x02f8...\", sealed_transaction: null }","handlingStrategy":"validation","validationCode":"-- Rows with no payload at all\nSELECT id FROM execution_transactions\nWHERE raw_transaction IS NULL AND sealed_transaction IS NULL;","typeGuard":null,"tryCatchPattern":"let raw = match row.raw_transaction {\n    Some(bytes) => bytes,\n    None => return Err(anyhow!(\"row {} has no plaintext; restore or switch to protected load\", row.id)),\n};","preventionTips":["Never NULL payload columns without writing the replacement form in the same transaction.","Validate row completeness after any restore or migration.","Monitor row counts where both payload columns are NULL."],"tags":["database","missing-data","rust"],"backgroundTag":"empty-required-field","analyzedSha":"18893faf8b356be3320add8de2f861b0b647cf06","analyzedAt":"2026-09-08T20:49:34.690Z","contentChangedAt":"2026-09-08T20:49:34.690Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}