{"record":{"id":"02c21b5baa12cc26","repo":"FuelLabs/fuels-rs","slug":"messageid-could-not-be-retrieved-from-tx-receipts","errorCode":null,"errorMessage":"MessageId could not be retrieved from tx receipts.","messagePattern":"MessageId could not be retrieved from tx receipts\\.","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/fuels-accounts/src/account.rs","lineNumber":324,"sourceCode":"            amount,\n            inputs,\n            tx_policies,\n            *consensus_parameters.base_asset_id(),\n        );\n\n        self.add_witnesses(&mut tb)?;\n        self.adjust_for_fee(&mut tb, amount.into())\n            .await\n            .context(\"failed to adjust inputs to cover for missing base asset\")?;\n\n        let tx = tb.build(provider).await?;\n        let tx_id = tx.id(consensus_parameters.chain_id());\n\n        let tx_status = provider.send_transaction_and_await_commit(tx).await?;\n        let success = tx_status.take_success_checked(None)?;\n\n        let nonce = extract_message_nonce(&success.receipts)\n            .expect(\"MessageId could not be retrieved from tx receipts.\");\n\n        Ok(WithdrawToBaseResponse {\n            tx_status: success,\n            tx_id,\n            nonce,\n        })\n    }\n}\n\n#[cfg(test)]\nmod tests {\n    use std::str::FromStr;\n\n    use fuel_crypto::{Message, SecretKey, Signature};\n    use fuel_tx::{Address, ConsensusParameters, Output, Transaction as FuelTransaction};\n    use fuels_core::{\n        traits::Signer,\n        types::{DryRun, DryRunner, transaction::Transaction},","sourceCodeStart":306,"sourceCodeEnd":342,"githubUrl":"https://github.com/FuelLabs/fuels-rs/blob/d9a250a51818dda64bfeb5ef7cc19cf27bdcd623/packages/fuels-accounts/src/account.rs#L306-L342","documentation":"Thrown by Account::withdraw_to_base after the withdrawal transaction has already been submitted and committed successfully. The SDK then calls extract_message_nonce (packages/fuels-accounts/src/accounts_utils.rs:16), which scans the success receipts for the first receipt carrying a nonce (the MessageId-spent receipt) to return in WithdrawToBaseResponse. The panic means the node returned a success status whose receipts contain no message-spending receipt, breaking the SDK's invariant that a successful message withdrawal emits a nonce receipt.","triggerScenarios":"Calling account.withdraw_to_base(to, base_asset_id, amount).await where send_transaction_and_await_commit and take_success_checked succeed, but the returned receipts contain no receipt with a nonce: typically a fuel-core node version whose receipt emission does not match what this fuels crate expects.","commonSituations":"Upgrading fuel-core while keeping an old fuels crate (or vice versa); running against a custom or mock node that does not emit MessageId receipts; node configurations that strip or filter receipts.","solutions":["Align the fuels crate version with the fuel-core node version (see the version table in the fuels-rs release notes / SDK book) and retry the withdrawal","Fetch receipts manually via provider.receipts(&tx_id) or the transaction status to confirm whether a MessageId-spent receipt is actually present, and inspect the success status","If versions are already paired and receipts are still missing, capture the tx id plus receipts and open an issue in the fuels-rs repository","As a workaround, build and submit the withdrawal with ScriptTransactionBuilder yourself so you control receipt parsing instead of relying on the nonce extraction"],"exampleFix":"// before\nlet res = account.withdraw_to_base(to, base_asset_id, amount).await?;\n// panics with \"MessageId could not be retrieved from tx receipts.\" if receipts lack a nonce\n\n// after: confirm node/SDK pairing before withdrawing, and inspect receipts when it fails\nlet info = provider.node_info().await?;\nprintln!(\"node fuel-core version: {}\", info.node_version);\n// cross-check against the fuels release-notes version table, upgrade fuels to match, then retry","handlingStrategy":"validation","validationCode":"// Before withdrawing, confirm the node reports a fuel-core version your fuels crate supports\nlet info = provider.node_info().await?;\nprintln!(\"node fuel-core version: {}\", info.node_version);\n// cross-check against the fuels release-notes version table and upgrade fuels if needed","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Pin fuels and fuel-core to a version pair from the SDK version table and upgrade them together","Keep an integration test covering withdraw_to_base in CI against the paired node so version drift is caught before production","After upgrading the node, re-run the full withdrawal flow on a test network first","Retain tx ids so receipts can be inspected when decoding failures appear"],"tags":["blockchain","transaction","panic","message-withdrawal"],"backgroundTag":null,"analyzedSha":"d9a250a51818dda64bfeb5ef7cc19cf27bdcd623","analyzedAt":"2026-08-16T09:49:30.618Z","schemaVersion":2},"datasetVersion":"2026-08-16T13:17:31.715Z"}