Frederic
Frederic

Reputation: 375

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 ?

Upvotes: 16

Views: 7156

Answers (3)

kevinrodriguez-io
kevinrodriguez-io

Reputation: 1382

You don't have to redeploy your program.

Using Solana CLI (>1.18) you can do:

$ solana program extend <PROGRAM_ID> <MORE_BYTES>

To allocate more bytes, then try again.

Upvotes: 21

Hadi Saleh
Hadi Saleh

Reputation: 157

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

Upvotes: 13

Jacob Creech
Jacob Creech

Reputation: 2107

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.

Upvotes: 11

Related Questions