Solana error codes › Anchor Framework
Errors that the Anchor framework itself returns (codes 100 to 5999), for any program built with Anchor. Program-specific errors start at 6000.
The program received an instruction discriminator it does not recognise.
What to do: The client and the deployed program usually disagree: an outdated IDL or SDK, or the transaction is sent to the wrong program ID. Regenerate the client from the current IDL.
An account marked `mut` in the program was passed as read-only.
What to do: Mark that account as writable in the instruction (isWritable: true), or use the client generated from the program's IDL.
A custom `constraint = ...` check on one of the accounts returned false.
What to do: Read the program logs: Anchor prints the account name that failed. Check that account's state against the constraint in the program source.
A PDA passed to the instruction does not match the address derived from the seeds in the program.
What to do: Derive the PDA with exactly the same seeds, in the same order and encoding, and with the program ID of the program being called.
An account does not match the fixed address required by an `address = ...` constraint.
What to do: Pass the exact account the program expects (often a config, mint or program account).
The account has no data, so Anchor cannot read its 8-byte discriminator.
What to do: The account usually does not exist yet or was closed. Initialise it first, and check you are on the right cluster.
The account's 8-byte discriminator belongs to a different account type than the one the instruction expects.
What to do: Pass an account of the expected type. This also happens after a program changes its account layout and the client still uses an old address or IDL.
An account is owned by a different program than the one the instruction expects.
What to do: Check you passed the right address, for example a Token-2022 account where a classic SPL Token account is expected, or the reverse.
The program expected an account that is already initialised, but it is empty.
What to do: Create or initialise the account first (for example the associated token account or the program's state account), and check the cluster (mainnet or devnet).
| Hex | Code | Error |
|---|---|---|
| 0x64 | 100 | InstructionMissing 8 byte instruction identifier not provided |
| 0x65 | 101 | InstructionFallbackNotFound Fallback functions are not supported The program received an instruction discriminator it does not recognise. |
| 0x66 | 102 | InstructionDidNotDeserialize The program could not deserialize the given instruction |
| 0x67 | 103 | InstructionDidNotSerialize The program could not serialize the given instruction |
| 0x3e8 | 1000 | IdlInstructionStub The program was compiled without idl instructions |
| 0x3e9 | 1001 | IdlInstructionInvalidProgram Invalid program given to the IDL instruction |
| 0x3ea | 1002 | IdlAccountNotEmpty IDL account must be empty in order to resize |
| 0x5dc | 1500 | EventInstructionStub The program was compiled without `event-cpi` feature |
| 0x7d0 | 2000 | ConstraintMut A mut constraint was violated An account marked `mut` in the program was passed as read-only. |
| 0x7d1 | 2001 | ConstraintHasOne A has_one constraint was violated |
| 0x7d2 | 2002 | ConstraintSigner A signer constraint was violated The name points to a permission check: the wrong signer or owner account was passed. |
| 0x7d3 | 2003 | ConstraintRaw A raw constraint was violated A custom `constraint = ...` check on one of the accounts returned false. |
| 0x7d4 | 2004 | ConstraintOwner An owner constraint was violated |
| 0x7d5 | 2005 | ConstraintRentExempt A rent exemption constraint was violated |
| 0x7d6 | 2006 | ConstraintSeeds A seeds constraint was violated A PDA passed to the instruction does not match the address derived from the seeds in the program. |
| 0x7d7 | 2007 | ConstraintExecutable An executable constraint was violated |
| 0x7d8 | 2008 | ConstraintState Deprecated error, no longer used |
| 0x7d9 | 2009 | ConstraintAssociated An associated constraint was violated |
| 0x7da | 2010 | ConstraintAssociatedInit An associated init constraint was violated |
| 0x7db | 2011 | ConstraintClose A close constraint was violated |
| 0x7dc | 2012 | ConstraintAddress An address constraint was violated An account does not match the fixed address required by an `address = ...` constraint. |
| 0x7dd | 2013 | ConstraintZero Expected zero account discriminant |
| 0x7de | 2014 | ConstraintTokenMint A token mint constraint was violated |
| 0x7df | 2015 | ConstraintTokenOwner A token owner constraint was violated |
| 0x7e0 | 2016 | ConstraintMintMintAuthority A mint mint authority constraint was violated |
| 0x7e1 | 2017 | ConstraintMintFreezeAuthority A mint freeze authority constraint was violated |
| 0x7e2 | 2018 | ConstraintMintDecimals A mint decimals constraint was violated |
| 0x7e3 | 2019 | ConstraintSpace A space constraint was violated |
| 0x7e4 | 2020 | ConstraintAccountIsNone A required account for the constraint is None |
| 0x7e5 | 2021 | ConstraintTokenTokenProgram A token account token program constraint was violated |
| 0x7e6 | 2022 | ConstraintMintTokenProgram A mint token program constraint was violated |
| 0x7e7 | 2023 | ConstraintAssociatedTokenTokenProgram An associated token token program constraint was violated |
| 0x7e8 | 2024 | ConstraintMintGroupPointerExtension A mint group pointer extension constraint was violated |
| 0x7e9 | 2025 | ConstraintMintGroupPointerExtensionAuthority A mint group pointer extension authority constraint was violated |
| 0x7ea | 2026 | ConstraintMintGroupPointerExtensionGroupAddress A mint group pointer extension group address constraint was violated |
| 0x7eb | 2027 | ConstraintMintGroupMemberPointerExtension A mint group member pointer extension constraint was violated |
| 0x7ec | 2028 | ConstraintMintGroupMemberPointerExtensionAuthority A mint group member pointer extension authority constraint was violated |
| 0x7ed | 2029 | ConstraintMintGroupMemberPointerExtensionMemberAddress A mint group member pointer extension member address constraint was violated |
| 0x7ee | 2030 | ConstraintMintMetadataPointerExtension A mint metadata pointer extension constraint was violated |
| 0x7ef | 2031 | ConstraintMintMetadataPointerExtensionAuthority A mint metadata pointer extension authority constraint was violated |
| 0x7f0 | 2032 | ConstraintMintMetadataPointerExtensionMetadataAddress A mint metadata pointer extension metadata address constraint was violated |
| 0x7f1 | 2033 | ConstraintMintCloseAuthorityExtension A mint close authority extension constraint was violated |
| 0x7f2 | 2034 | ConstraintMintCloseAuthorityExtensionAuthority A mint close authority extension authority constraint was violated |
| 0x7f3 | 2035 | ConstraintMintPermanentDelegateExtension A mint permanent delegate extension constraint was violated |
| 0x7f4 | 2036 | ConstraintMintPermanentDelegateExtensionDelegate A mint permanent delegate extension delegate constraint was violated |
| 0x7f5 | 2037 | ConstraintMintTransferHookExtension A mint transfer hook extension constraint was violated |
| 0x7f6 | 2038 | ConstraintMintTransferHookExtensionAuthority A mint transfer hook extension authority constraint was violated |
| 0x7f7 | 2039 | ConstraintMintTransferHookExtensionProgramId A mint transfer hook extension program id constraint was violated |
| 0x9c4 | 2500 | RequireViolated A require expression was violated |
| 0x9c5 | 2501 | RequireEqViolated A require_eq expression was violated |
| 0x9c6 | 2502 | RequireKeysEqViolated A require_keys_eq expression was violated |
| 0x9c7 | 2503 | RequireNeqViolated A require_neq expression was violated |
| 0x9c8 | 2504 | RequireKeysNeqViolated A require_keys_neq expression was violated |
| 0x9c9 | 2505 | RequireGtViolated A require_gt expression was violated |
| 0x9ca | 2506 | RequireGteViolated A require_gte expression was violated |
| 0xbb8 | 3000 | AccountDiscriminatorAlreadySet The account discriminator was already set on this account |
| 0xbb9 | 3001 | AccountDiscriminatorNotFound No 8 byte discriminator was found on the account The account has no data, so Anchor cannot read its 8-byte discriminator. |
| 0xbba | 3002 | AccountDiscriminatorMismatch 8 byte discriminator did not match what was expected The account's 8-byte discriminator belongs to a different account type than the one the instruction expects. |
| 0xbbb | 3003 | AccountDidNotDeserialize Failed to deserialize the account |
| 0xbbc | 3004 | AccountDidNotSerialize Failed to serialize the account |
| 0xbbd | 3005 | AccountNotEnoughKeys Not enough account keys given to the instruction The name points to a balance check: an account holds less than the instruction needs. |
| 0xbbe | 3006 | AccountNotMutable The given account is not mutable |
| 0xbbf | 3007 | AccountOwnedByWrongProgram The given account is owned by a different program than expected An account is owned by a different program than the one the instruction expects. |
| 0xbc0 | 3008 | InvalidProgramId Program ID was not as expected |
| 0xbc1 | 3009 | InvalidProgramExecutable Program account is not executable |
| 0xbc2 | 3010 | AccountNotSigner The given account did not sign The name points to a permission check: the wrong signer or owner account was passed. |
| 0xbc3 | 3011 | AccountNotSystemOwned The given account is not owned by the system program |
| 0xbc4 | 3012 | AccountNotInitialized The program expected this account to be already initialized The program expected an account that is already initialised, but it is empty. |
| 0xbc5 | 3013 | AccountNotProgramData The given account is not a program data account |
| 0xbc6 | 3014 | AccountNotAssociatedTokenAccount The given account is not the associated token account |
| 0xbc7 | 3015 | AccountSysvarMismatch The given public key does not match the required sysvar |
| 0xbc8 | 3016 | AccountReallocExceedsLimit The account reallocation exceeds the MAX_PERMITTED_DATA_INCREASE limit |
| 0xbc9 | 3017 | AccountDuplicateReallocs The account was duplicated for more than one reallocation |
| 0x1004 | 4100 | DeclaredProgramIdMismatch The declared program id does not match the actual program id |
| 0x1005 | 4101 | Deprecated The API being used is deprecated and should no longer be used |
| 0x1006 | 4102 | ZeroCopyTypeMismatch The given account is not zero-copy initialized |
| 0x1388 | 5000 | TryingToInitPayerAsProgramAccount Trying to initialize the payer as a program account |
Free, no sign-up, nothing to connect. Works offline from a bundled list; we do not look anything up on-chain.
Swapping a token you do not know? A free Rugsight check shows mint and freeze authority, Token-2022 extensions, holder concentration and liquidity before you trade.
Source: solana-idls@1.2.1. Data: program error lists from published IDLs (solana-idls 1.2.1, MIT) and the System, SPL Token, Token-2022 and Associated Token Account source code, snapshot 2026-11-16. Programs can be upgraded and add or change errors; the failing program's current IDL is the final word.