FuelLabs/fuels-rs · error
MessageId could not be retrieved from tx receipts.
Error message
MessageId could not be retrieved from tx receipts.
What it means
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.
Source
Thrown at packages/fuels-accounts/src/account.rs:324
amount,
inputs,
tx_policies,
*consensus_parameters.base_asset_id(),
);
self.add_witnesses(&mut tb)?;
self.adjust_for_fee(&mut tb, amount.into())
.await
.context("failed to adjust inputs to cover for missing base asset")?;
let tx = tb.build(provider).await?;
let tx_id = tx.id(consensus_parameters.chain_id());
let tx_status = provider.send_transaction_and_await_commit(tx).await?;
let success = tx_status.take_success_checked(None)?;
let nonce = extract_message_nonce(&success.receipts)
.expect("MessageId could not be retrieved from tx receipts.");
Ok(WithdrawToBaseResponse {
tx_status: success,
tx_id,
nonce,
})
}
}
#[cfg(test)]
mod tests {
use std::str::FromStr;
use fuel_crypto::{Message, SecretKey, Signature};
use fuel_tx::{Address, ConsensusParameters, Output, Transaction as FuelTransaction};
use fuels_core::{
traits::Signer,
types::{DryRun, DryRunner, transaction::Transaction},View on GitHub (pinned to d9a250a518)
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
Example fix
// before
let res = account.withdraw_to_base(to, base_asset_id, amount).await?;
// panics with "MessageId could not be retrieved from tx receipts." if receipts lack a nonce
// after: confirm node/SDK pairing before withdrawing, and inspect receipts when it fails
let info = provider.node_info().await?;
println!("node fuel-core version: {}", info.node_version);
// cross-check against the fuels release-notes version table, upgrade fuels to match, then retry Defensive patterns
Strategy: validation
Validate before calling
// Before withdrawing, confirm the node reports a fuel-core version your fuels crate supports
let info = provider.node_info().await?;
println!("node fuel-core version: {}", info.node_version);
// cross-check against the fuels release-notes version table and upgrade fuels if needed Prevention
- 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
When it happens
Trigger: 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.
Common situations: 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.
Related errors
AI-assisted analysis of FuelLabs/fuels-rs@d9a250a518 (2026-08-16).
Data as JSON: /api/errors/02c21b5baa12cc26.
Report an issue: GitHub.