Closed nikhilasrani closed 2 years ago
Hi there 👋 Thanks for raising this. I'll look into this asap. 🙂
I'm afraid I can reproduce this issue. Would you be able to provide a public repository with the minimum amount of code to reproduce this issue?
hey @lorisleiva, I figured out the problem. It's rather quite silly, I think the this error starting showing up when we had an empty wallet/ no Solana balance to fund the creation of the NFT.
Once I added some SOL to my wallet, it began working as expected. Thank you for your prompt response and support. I really appreciate it.
Closing this issue with this comment so that maybe it can help others who face the same issue.
@nikhilasrani Thanks for putting in your solution - it certainly helped me! I think the issue should remain open though as Failed to pack instruction data
doesn't really help metaplex developers know the cause of the issue is an insufficient balance. Likewise other Solana apps - SPL, web3, etc. - simply say insufficient balance
in this scenario.
Version is @metaplex-foundation/js@0.15.0
- will try and see if this occurs on a newer version but have some issues running 0.17 so far due to some http
polyfilling.
/home/mike/Code/portal/wallet/node_modules/@metaplex-foundation/js/src/plugins/rpcModule/RpcClient.ts:302
? new ParsedProgramError(program, resolvedError)
^
MetaplexError: TokenMetadataProgram > Failed to pack instruction data
>> Source: Program > TokenMetadataProgram [metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s]
>> Problem: The program [TokenMetadataProgram] at address [metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s] raised an error of code [1] that translates to "Failed to pack instruction data".
>> Solution: Check the error message provided by the program.
Caused By: InstructionPackError: Failed to pack instruction data
at parseProgramError (/home/mike/Code/portal/wallet/node_modules/@metaplex-foundation/js/src/plugins/rpcModule/RpcClient.ts:302:9)
at RpcClient.sendTransaction (/home/mike/Code/portal/wallet/node_modules/@metaplex-foundation/js/src/plugins/rpcModule/RpcClient.ts:87:18)
... 6 lines matching cause stack trace ...
at null.mintIdentityToken (/home/mike/Code/portal/wallet/src/backend/identity-tokens.ts:73:24)
at null.mintAndTransferIdentityToken (/home/mike/Code/portal/wallet/src/backend/identity-tokens.ts:103:25) {
key: 'metaplex.errors.program.parsed_program_error',
title: 'TokenMetadataProgram > Failed to pack instruction data',
problem: 'The program [TokenMetadataProgram] at address [metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s] raised an error of code [1] that translates to "Failed to pack instruction data".',
solution: 'Check the error message provided by the program.',
source: 'program',
sourceDetails: 'TokenMetadataProgram [metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s]',
cause: /home/mike/Code/portal/wallet/node_modules/@metaplex-foundation/js/src/plugins/nftModule/plugin.ts:70
cusper.errorFromProgramLogs(error.logs, false),
^
InstructionPackError: Failed to pack instruction data
at error (/home/mike/Code/portal/wallet/node_modules/@metaplex-foundation/js/src/plugins/nftModule/plugin.ts:70:16)
at parseProgramError (/home/mike/Code/portal/wallet/node_modules/@metaplex-foundation/js/src/plugins/rpcModule/RpcClient.ts:299:35)
at RpcClient.sendTransaction (/home/mike/Code/portal/wallet/node_modules/@metaplex-foundation/js/src/plugins/rpcModule/RpcClient.ts:87:18)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at RpcClient.sendAndConfirmTransaction (/home/mike/Code/portal/wallet/node_modules/@metaplex-foundation/js/src/plugins/rpcModule/RpcClient.ts:117:23)
at TransactionBuilder.sendAndConfirm (/home/mike/Code/portal/wallet/node_modules/@metaplex-foundation/js/src/utils/TransactionBuilder.ts:189:22)
at Object.handle (/home/mike/Code/portal/wallet/node_modules/@metaplex-foundation/js/src/plugins/nftModule/operations/createNft.ts:132:20)
at null.<anonymous> (/home/mike/Code/portal/wallet/node_modules/@metaplex-foundation/js/src/utils/Task.ts:82:23)
at Disposable.run (/home/mike/Code/portal/wallet/node_modules/@metaplex-foundation/js/src/utils/Disposable.ts:34:14)
at null.mintIdentityToken (/home/mike/Code/portal/wallet/src/backend/identity-tokens.ts:73:24) {
code: 1
},
logs: undefined,
program: {
name: 'TokenMetadataProgram',
address: PublicKey {
_bn: BN {
negative: 0,
words: [
66595142, 28602112,
64705691, 30173827,
22591596, 46215411,
30746614, 32576738,
28435409, 187417,
0
],
length: 10,
red: null
}
},
errorResolver: [Function: errorResolver],
gpaResolver: [Function: gpaResolver]
}
}
Hey folks, I'm getting an error when trying to run
const { nft } = await metaplex.nfts().create({ uri });
The upload metadata step works fine and produces a uri with metadata that is identical to the ones that were working with the create NFT step before.But when I run the above code, I get the following error
ParsedProgramError [MetaplexError]: TokenMetadataProgram > Failed to pack instruction data
The package versions I am using are
"@solana/web3.js": "^1.41.3", "@metaplex-foundation/js": "^0.11.5"