I cannot deploy a program to devnet due to this error:
Deploying program failed: Error processing Instruction 0: account data too small for instruction .
The program is not large. It’s ~400 lines.
I commented out some code, and I’ve found that
spl_token::instruction::set_authority is the root cause.
The .so file is only ~164K. When commenting out that
spl_token::instruction::set_authority , the deployment works normally (and the .so size is ~140K)
How do I solve this issue? Thank you!
Hmm, I’m not exactly sure what would be causing this. You may want to try reaching out on Discord because there are more developers there who may have run into this before. Just be very wary of scammers on Discord.
Thank you @zicklag. I will ask in discord.
My current theory is that there is a limit to the .so size at ~150K.
Someone from discord helped me resolve it.
Basically when deploying an upgraded program, Solana will try to double the size of the account’s data.
If the upgraded program exceeds that, then the error will raise.
Using the --max-len argument doesn’t solve the problem. Not sure if there is a bug, or I misunderstand what the argument does.
At the end, I changed the program name in order to get the new program ID instead, and it works.
@t4n1n 's solution worked for me.
Changing the project name fixed the error
Changing name will be great or you can try to rebuild the solana project by deleting types folder that will help to get new program Id too