What the error means
AnchorError caused by account: <name>. Error Code: AccountNotInitialized. Error Number: 3012. Error Message: The program expected this account to be already initialized.
The program expected an account to exist but it has not been created yet, such as a token account, pool position or user state account.
| Where it comes from | Anchor framework |
| Code | 3012 (0xbc4) |
How to fix it
- Create the missing account first, often an associated token account for the token you receive.
- Check you are on the right network; an account created on devnet does not exist on mainnet.
- Some protocols need an existing account with a balance before an action, for example a wrapped SOL account.
If that is not it
- If the account exists, 3007 (owned by wrong program) or 3003 (failed to deserialize) is more likely.
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.
