Home / Solana errors / 0x2

custom program error 0x2

0x2 is hexadecimal for 2. 3 programs in our catalogue can raise it, with 2 different meanings between them. Which one you hit is decided by the program ID in the log line — not by the number.

Paste your log and decode it

What 0x2 means, program by program

ProgramMeaning of 0x2 there
SPL Token
Toke…Q5DA
Invalid mint account
The mint account passed to a token instruction does not exist or is not a valid mint, so the token program rejected the instruction before anything moved.
Token-2022
Toke…Q5DA
Invalid mint account
The mint account passed to a token instruction does not exist or is not a valid mint, so the token program rejected the instruction before anything moved.
Raydium AMM v4
675k…1Mp8
Expected mint
A token account was passed where a mint account is required. The program checks the account's data shape and rejects a balance-holding account in a mint slot.

The same code in real logs

Every line below is a genuine failure message for 0x2 — same number, different owner:

The pubkey after Program is what decides the meaning. Match it against the table rather than guessing from the number.

How to tell which program raised yours

  1. Read the program ID. The log line reads Program <pubkey> failed: custom program error: 0x2. That pubkey is the owner of the error table — match it against the table above.
  2. No pubkey left in the log? The failed instruction still names its owner: token instructions (transfer, transferChecked, mintTo, burn) belong to a token program; swap, deposit and withdraw instructions belong to an AMM.
  3. Convert before you search. 0x2 and 2 are the same code; docs, RPC error objects and blog posts quote it in different bases, and searching the wrong one returns unrelated programs.

Where the wording cannot help you

SPL Token and Token-2022 both describe this code the same way. If your only clue is the message text, the program ID is the only thing that separates them.

Other codes with the same collision problem

The full picture — all 58 contested codes at once — is on the cross-program error code index.