collectionsuploadsolanacandy-machine

Invalid mint owner during set_collection Candy Machine v2


i was trying to mint some nfts with candy machine but when i try to execute:

ts-node ~/metaplex/js/packages/cli/src/candy-machine-v2-cli.ts set_collection \
    -e devnet \
    -k ~/.config/solana/devnet.json \
    -c example \
    -m C2eGm8iQPnKVWxakyo8QhwJUvYrZHKF52DPQuAejpTWG

I got this error:

throw new Error(`Invalid mint owner: ${JSON.stringify(info.owner)}`);
            ^
Error: Invalid mint owner: "11111111111111111111111111111111"
    at Token.getMintInfo (/Users/btk-macmini-01/Desktop/repo/peppermint/docs/metaplex/js/node_modules/@solana/spl-token/client/token.js:731:13)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at async parseCollectionMintPubkey (/Users/btk-macmini-01/Desktop/repo/peppermint/docs/metaplex/js/packages/cli/src/helpers/various.ts:438:5)
    at async Command.<anonymous> (/Users/btk-macmini-01/Desktop/repo/peppermint/docs/metaplex/js/packages/cli/src/candy-machine-v2-cli.ts:941:34)

Someone knows why? I have tried putting a different address from the one with that i have created the candymachine and with I made the upload or also the same but the issue is the same, maybe there is something wrong with it or with other things?

This is an example of my json:

{
    "name": "#1",
    "description": "description",
    "external_url": "",
    "image": "0.png",
    "attributes": [
        {
            "trait_type": "Background Color Woman",
            "value": "Light Blue"
        },
        {
            "trait_type": "Background color man",
            "value": "Metal Grey"
        }
    ],
    "properties": {
        "files": [
            {
                "uri": "0.png",
                "type": "image/png"
            }
        ],
        "creators": [
            {
                "address": "GM1ByqbTfgRwXEQCLJ2N4bsA3P1WcuyL9kZT79gLqYuE",
                "share": 100
            }
        ]
    },
    "compiler": "https://the-nft-generator.com",
    "symbol": "Test",
    "collection": {
        "name": "test",
        "family": "test"
    }
}

If i upload without execute set_collections it works but with a different name of the collection from the one specified in the jsons file


Solution

  • set_collection is used to set the collection field to all the nfts inside a Candy machine that has not started the mint (0 minted NFTs). To set a collection you can pass any NFT (that is a masterEditionV2) that has the same updateAuthority as the wallet that you used to create ur CandyMachine.

    In this case you are trying to set a collection that uses this NFT (-m C2eGm8iQPnKVWxakyo8QhwJUvYrZHKF52DPQuAejpTWG), and you said that ur CM was created with the wallet that has pubkey GM1ByqbTfgRwXEQCLJ2N4bsA3P1WcuyL9kZT79gLqYuE. The NFT has updateAuthority 42NevAWA6A8m9prDvZRUYReQmhNC3NtSZQNFUppPJDRB and thats a completly different pubkey that the one that you used to create the Candy Machine.

    You can always use the collection webpage. This webpage allows you to create and mint a collection NFT with certain metadata, and also will migrate (change the onchain collections to the new created collection) the NFTs that you pass on the website and this can be updated at anytime with more NFTs. This website WILL NOT migrate unminted nfts from a candy machine.

    If you want to use set_collection make sure to provide, on the -m parameter, an NFT that has the same updateAuthority that ur Candy Machine. Also make sure that your Candy Machine has 0 minted NFTs.