metaplex-foundation / js

A JavaScript SDK for interacting with Metaplex's programs
357 stars 182 forks source link

MetaplexError: printNewEdition > NotEnoughAccountKeys #303

Closed ninnjak closed 1 year ago

ninnjak commented 2 years ago

I'm running the printNewEdition command with minimum input. This works fine when testing on devnet. However on mainnet-beta I continue to get the error below NotEnoughAccountKeys. I'm using the latest version of the SDK v0.15.0.

const originalMint = new PublicKey("...");

const { nft: printedNft } = await metaplex
    .nfts()
    .printNewEdition({ originalMint: originalMint })
    .run();

Error log:

{
      "name": "MetaplexError",
      "key": "metaplex.errors.program.unknown_program_error",
      "title": "TokenMetadataProgram > Unknown Program Error",
      "problem": "The program [TokenMetadataProgram] at address [metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s] raised an error that is not recognized by the programs registered by the SDK.",
      "solution": "Unfortunately, you will need to check the unparsed error below to investigate what went wrong. To get more helpful error messages, ensure the program that failed is registered by the SDK and provides an \"errorResolver\" method.",
      "source": "program",
      "sourceDetails": "TokenMetadataProgram [metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s]",
      "cause": {
        "logs": [
          "Program 11111111111111111111111111111111 invoke [1]",
          "Program 11111111111111111111111111111111 success",
          "Program TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA invoke [1]",
          "Program log: Instruction: InitializeMint",
          "Program TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA consumed 2967 of 1000000 compute units",
          "Program TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA success",
          "Program ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL invoke [1]",
          "Program log: Create",
          "Program TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA invoke [2]",
          "Program log: Instruction: GetAccountDataSize",
          "Program TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA consumed 1622 of 991523 compute units",
          "Program return: TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA pQAAAAAAAAA=",
          "Program TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA success",
          "Program 11111111111111111111111111111111 invoke [2]",
          "Program 11111111111111111111111111111111 success",
          "Program log: Initialize the associated token account",
          "Program TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA invoke [2]",
          "Program log: Instruction: InitializeImmutableOwner",
          "Program log: Please upgrade to SPL Token 2022 for immutable owner support",
          "Program TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA consumed 1405 of 985033 compute units",
          "Program TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA success",
          "Program TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA invoke [2]",
          "Program log: Instruction: InitializeAccount3",
          "Program TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA consumed 4241 of 981153 compute units",
          "Program TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA success",
          "Program ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL consumed 20438 of 997033 compute units",
          "Program ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL success",
          "Program TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA invoke [1]",
          "Program log: Instruction: MintTo",
          "Program TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA consumed 4537 of 976595 compute units",
          "Program TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA success",
          "Program metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s invoke [1]",
          "Program log: Instruction: Mint New Edition from Master Edition Via Token",
          "Program log: Error: NotEnoughAccountKeys",
          "Program metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s consumed 4055 of 972058 compute units",
          "Program metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s failed: insufficient account keys for instruction"
        ]
      },
      "program": {
        "name": "TokenMetadataProgram",
        "address": "metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s"
      }
    }
ninnjak commented 2 years ago

I believe this maybe related to this issue: https://github.com/metaplex-foundation/metaplex-program-library/issues/755

ninnjak commented 2 years ago

Confirmed temporary workaround downgrading mpl-token-metadata is working for me on mainnet-beta.

{
  "dependencies": {
    "@metaplex-foundation/js": "0.15.0",
  },
  "resolutions": {
     "@metaplex-foundation/mpl-token-metadata": "2.2.4"
  }
}
bounce-yukkw commented 2 years ago

can you deposit over 0.1sol your wallet then try printNewEdition?

ninnjak commented 2 years ago

can you deposit over 0.1sol your wallet then try printNewEdition?

I have already tested with the above workaround with over 0.1 SOL in my wallet and printNewEdition works fine

lorisleiva commented 2 years ago

Thanks for raising this! I'll leave this open until v1.4 of Token Metadata is deployed to Mainnet.

dreamsea503 commented 2 years ago

Confirmed temporary workaround downgrading mpl-token-metadata is working for me on mainnet-beta.

{
  "dependencies": {
    "@metaplex-foundation/js": "0.15.0",
  },
  "resolutions": {
     "@metaplex-foundation/mpl-token-metadata": "2.2.4"
  }
}

I got the same issue, and I followed your suggestion. but still got this error.

lorisleiva commented 1 year ago

Closing this as this was an issue with version mismatch between the program and the client libraries which should now be fixed. Please raise another issue if the problem persists.