Custom program error

0x33

Appears in logs as custom program error: 0x3. Defined by 2 programs: SPL Token, System. Check which program failed in your logs.

Which one is yours?
The log line Program <id> failed: custom program error: 0x3 names the program that returned the code. Match that id to the program below. Anchor programs also print Error Code: … Error Number: … right above the failure.
SPL TokenTokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA

MintMismatch

“Account not associated with this Mint”

A token account passed to the instruction belongs to a different mint than the one you specified or than the other token account in the transfer.

Common causes

  • Transferring between token accounts of two different mints.
  • Deriving the associated token account with the wrong mint (for example USDC on devnet vs mainnet).

How to fix it

  • Fetch both token accounts and compare their mint fields. Both must match the mint in the instruction.
  • Derive ATAs with the exact mint and owner used on-chain.
System11111111111111111111111111111111

InvalidAccountDataLength

“cannot allocate account data of this length”

The requested account size is not allowed. Accounts cannot exceed 10 MiB (10,485,760 bytes).

Common causes

  • Passing a space larger than the maximum permitted account size.
  • Passing a negative or overflowed number through a buggy size calculation.

How to fix it

  • Keep space at or below 10,485,760 bytes. Large data usually belongs in multiple accounts.
  • Print the computed size before sending the transaction and sanity check it.

Decode another error

Try: