Instruction errors (runtime)

InvalidAccountData

Appears as invalid account data for instruction

Instruction

InvalidAccountData

“invalid account data for instruction”

One of the accounts passed has data the program cannot use for this instruction. One of the most common Solana errors.

Common causes

  • Passing an account of the wrong type, for example a wallet where a token account is expected.
  • Passing an uninitialised account where initialised data is required.
  • Passing a token account from the wrong token program (SPL Token vs Token-2022).
  • The account is owned by the right program but its data is corrupted or in an old layout.

How to fix it

  • Open each account on an explorer and confirm its owner and type match what the instruction expects.
  • Check the instruction index in the logs (Error processing Instruction N) to find which instruction failed.

Decode another error

Try: