'Solana deploy "account data too small for instruction"
When i try to deploy a program with anchor (devnet or mainnet, same error), i get the following error : Deploying program failed: Error processing Instruction 0: account data too small for instruction.
I have no clue where this comes from.
The so file is around 331Ko, and apparently, the error shows up when i try to use "mpl-token-metadata" to get metadata of NFT
Any one has an idea how to correct that ?
Solution 1:[1]
When you deploy a program on Solana, the amount of space allocated for that program is 2x the original program size.
This is to ensure there is a good amount of space if you upgrade the program, up to 2x the original program size.
The program that you are deploying is exceeding this limit. You will have to get a new programId and deploy again.
Solution 2:[2]
Delete the target folder
Run anchor build, this will add a new keypair to target/deploy
run anchor keys list, this will give you the new program id
copy the id to the top of your lib.rs
run anchor build again
and anchor deploy
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Jacob Creech |
| Solution 2 | Hadi Saleh |
