Error codes / Anchor framework
Anchor framework error codes
Codes 100 to 4100 are raised by the Anchor framework itself, not by the program's own logic, so they mean the same thing in every Anchor program.
- 100 · 0x64InstructionMissing
8-byte instruction discriminator not found.
- 101 · 0x65InstructionFallbackNotFound
Fallback handler not found for unrecognized instruction.
- 102 · 0x66InstructionDidNotDeserialize
The instruction data failed to deserialize into the expected arguments.
- 2000 · 0x7d0ConstraintMut
An account expected to be mutable was passed read-only.
- 2001 · 0x7d1ConstraintHasOne
A has_one constraint failed — a referenced account does not match the field stored on the state account.
- 2002 · 0x7d2ConstraintSigner
An account expected to sign did not.
- 2003 · 0x7d3ConstraintRaw
A raw constraint expression evaluated false.
- 2004 · 0x7d4ConstraintOwner
An account's owner does not match the constraint.
- 2005 · 0x7d5ConstraintRentExempt
The account is not rent-exempt.
- 2006 · 0x7d6ConstraintSeeds
PDA seeds do not match the expected derivation.
- 2007 · 0x7d7ConstraintExecutable
An account expected to be a program is not executable.
- 2009 · 0x7d9ConstraintAssociated
Associated account constraint failed.
- 2011 · 0x7dbConstraintClose
Close-target constraint failed.
- 2012 · 0x7dcConstraintAddress
An account address does not equal the expected constant address.
- 2013 · 0x7ddConstraintZero
The account is expected to be zeroed but has data.
- 2014 · 0x7deConstraintTokenMint
The token account's mint does not match.
- 2015 · 0x7dfConstraintTokenOwner
The token account's owner does not match.
- 2019 · 0x7e3ConstraintSpace
The account's size does not match the constraint.
- 3000 · 0xbb8AccountDiscriminatorAlreadySet
Init found the discriminator already set.
- 3001 · 0xbb9AccountDiscriminatorNotFound
No discriminator — the account was never initialized by this program.
- 3002 · 0xbbaAccountDiscriminatorMismatch
The account holds a different Anchor account type than expected.
- 3003 · 0xbbbAccountDidNotDeserialize
The account data failed to deserialize into the expected type.
- 3005 · 0xbbdAccountNotEnoughKeys
Fewer accounts supplied than the instruction context requires.
- 3006 · 0xbbeAccountNotMutable
An account that must be writable was passed read-only.
- 3007 · 0xbbfAccountOwnedByWrongProgram
The account is owned by a different program than expected.
- 3008 · 0xbc0InvalidProgramId
A program account has an unexpected ID.
- 3010 · 0xbc2AccountNotSigner
The account did not sign.
- 3011 · 0xbc3AccountNotSystemOwned
The account is not owned by the System Program.
- 3012 · 0xbc4AccountNotInitialized
The account has no data — it was never initialized by the expected program.
- 3014 · 0xbc6AccountNotAssociatedTokenAccount
The account is not the canonical ATA for the owner+mint.
- 4100 · 0x1004DeclaredProgramIdMismatch
The program's declare_id does not match its deployed address.