What the error means
AnchorError caused by account: <name>. Error Code: AccountOwnedByWrongProgram. Error Number: 3007. Error Message: The given account is owned by a different program than expected.
An account belongs to a different program than expected. The common case is a Token-2022 token passed where the original Token program is expected, or the reverse.
| Where it comes from | Anchor framework |
| Code | 3007 (0xbbf) |
How to fix it
- Check the token's program in an explorer: Token or Token-2022.
- Use an app or instruction that supports that token program.
- Make sure the associated token account was created under the same program as the mint.
If that is not it
- If the account does not exist at all, the error is 3012.
More fixes: how to decode any Solana error code and why Solana transactions fail.
Source
Error text and code from Anchor framework error codes (coral-xyz/anchor v0.30.1 lang/src/error.rs), read on 24 October 2026.
