{"record":{"id":"7e935c16c96357c6","repo":"nautechsystems/nautilus_trader","slug":"active-verified-action-intent-was-not-found","errorCode":null,"errorMessage":"Active verified-action intent was not found","messagePattern":"Active verified-action intent was not found","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/adapters/blockchain/src/cache/database.rs","lineNumber":6100,"sourceCode":"        anyhow::ensure!(\n            manifest_version == batch.manifest_version && manifest_digest == batch.manifest_digest,\n            \"Verified action manifest identity changed\"\n        );\n        let intent_nonce = sqlx::query_scalar::<_, Option<i64>>(\n            \"\n            SELECT nonce\n            FROM execution_intent\n            WHERE id = $1 AND chain_id = $2 AND wallet_address = $3 AND active\n            FOR UPDATE\n            \",\n        )\n        .bind(batch.intent_id)\n        .bind(chain_id)\n        .bind(batch.wallet_address)\n        .fetch_optional(&mut *transaction)\n        .await\n        .map_err(|e| anyhow::anyhow!(\"Failed to lock intent for verified action: {e}\"))?\n        .ok_or_else(|| anyhow::anyhow!(\"Active verified-action intent was not found\"))?;\n        anyhow::ensure!(\n            intent_nonce == Some(nonce),\n            \"Verified action nonce does not match the active intent\"\n        );\n        let attempt = sqlx::query_scalar::<_, i64>(\n            \"\n            SELECT COUNT(*)\n            FROM execution_verification_decision\n            WHERE intent_id = $1 AND decision_class = $2\n            \",\n        )\n        .bind(batch.intent_id)\n        .bind(batch.decision_class)\n        .fetch_one(&mut *transaction)\n        .await\n        .map_err(|e| anyhow::anyhow!(\"Failed to number verified action evidence: {e}\"))?;\n\n        for (index, decision) in batch.decisions.iter().enumerate() {","sourceCodeStart":6082,"sourceCodeEnd":6118,"githubUrl":"https://github.com/nautechsystems/nautilus_trader/blob/18893faf8b356be3320add8de2f861b0b647cf06/crates/adapters/blockchain/src/cache/database.rs#L6082-L6118","documentation":"Thrown when no active execution intent row matches the batch's intent_id, chain_id, and wallet_address. Verified actions may only be appended to an intent that exists and is still active; a missing row means the intent never existed, was already completed/finalized, or the identifying fields are wrong.","triggerScenarios":"Calling record_execution_verification_batch with an intent_id that is not present as an active intent for the given chain_id and wallet_address.","commonSituations":"Retrying after the intent already completed (double submission); referencing an intent from a different chain or wallet than it was created with; intent_id typo or ID from another environment's database; intent canceled/expired before the action was recorded.","solutions":["Confirm the intent exists and is active by querying it with the same intent_id, chain_id, and wallet_address.","Create the intent first (the intent-creation flow) before attempting to record a verified action against it.","Check whether the intent already completed — treat this as a duplicate submission rather than retrying.","Validate the wallet_address format/casing matches how the intent was stored."],"exampleFix":"// before: record action for possibly unknown intent\nrecord_execution_verification_batch(&db, &batch).await?;\n// after: check active intent first\nlet active = sqlx::query_scalar::<_, i64>(\"SELECT 1 FROM execution_intent WHERE intent_id = $1 AND chain_id = $2 AND wallet_address = $3 AND status = 'active'\")\n    .bind(&batch.intent_id).bind(chain_id).bind(batch.wallet_address).fetch_optional(&db).await?;\nanyhow::ensure!(active.is_some(), \"intent {} not active\", batch.intent_id);\nrecord_execution_verification_batch(&db, &batch).await?;","handlingStrategy":"validation","validationCode":"// Rust: confirm an active intent exists before recording the action\nlet active = sqlx::query_scalar::<_, i64>(\n    \"SELECT 1 FROM execution_intent WHERE intent_id = $1 AND chain_id = $2 AND wallet_address = $3 AND status = 'active'\")\n    .bind(&batch.intent_id).bind(chain_id).bind(batch.wallet_address)\n    .fetch_optional(&db).await?;\nif active.is_none() { return Err(anyhow::anyhow!(\"skip: intent {} not active\", batch.intent_id)); }","typeGuard":"fn normalize_wallet(addr: &str) -> String { addr.to_lowercase() }","tryCatchPattern":null,"preventionTips":["Track intent lifecycle locally; do not submit actions for completed/canceled intents.","Normalize wallet address casing at creation and lookup.","Include chain_id and wallet in intent IDs you log so mismatches are obvious."],"tags":["database","intent","not-found","rust"],"backgroundTag":"entity-not-found","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"}