Instruction errors (runtime)

AccountDataTooSmall

Appears as account data too small for instruction

Instruction

AccountDataTooSmall

“account data too small for instruction”

An account's data buffer is smaller than the program requires.

Common causes

  • Allocating too little space for an account.
  • Using an account created by an older program version with a smaller struct.

How to fix it

  • Allocate the correct size. Anchor accounts need 8 bytes for the discriminator plus the struct size.

Decode another error

Try: