metaplex-foundation / metaplex

A directory of what the Metaplex Foundation works on!
https://metaplex.com
Apache License 2.0
3.31k stars 6.27k forks source link

Unable to update v2 candy machine #1406

Closed emersonthis closed 2 years ago

emersonthis commented 2 years ago

Describe the bug The update_candy_machine throws an error: "TypeError: Cannot read property 'program' of undefined"

To Reproduce Steps to reproduce the behavior:

  1. Create a minimal config.json file as per the docs.
  2. Prepare and upload an asset (0.json & 0.png).
  3. Mint the token just to see that it's working?
  4. Change the endSettings in the config.json
  5. Run the update command:
$ ts-node js/packages/cli/src/candy-machine-v2-cli.ts update_candy_machine -e mainnet-beta -k ~/.config/solana/keypair.json -cp ./config.json -c test

Expected behavior The candy machine to update successfully without errors

Actual behavior This error:

wallet public key: xxxxxyyyyyzzzzz
(node:48426) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'program' of undefined
    at Command.<anonymous> (.../js/packages/cli/src/candy-machine-v2-cli.ts:618:53)
    at processTicksAndRejections (internal/process/task_queues.js:95:5)
(Use `node --trace-warnings ...` to show where the warning was created)
(node:48426) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:48426) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

Desktop (please complete the following information):

Additional context I have not tested whether or not this also happens when there are still tokens remaining to mint.

stegaBOB commented 2 years ago

This should be fixed in the release branch. Feel free to reopen if I am mistaken

alanhabib commented 2 years ago

This should be fixed in the release branch. Feel free to reopen if I am mistaken

It is still not fixed even though it's last version.

rxdpunk commented 2 years ago

I am still getting this error as well

ThugzLabs commented 2 years ago

I'm still getting the error... Please do you have any information on this issue ? I Need to upload a fix in my JSON metadatas and i can't update my candymachine after I saw my mistake in the name class attributes.

(node:70088) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'program' of undefined at Command.<anonymous> (C:\Users\Okaze\Documents\AmisCrypto\Solana\candy-machine\metaplex-foundation\metaplex\js\packages\cli\src\candy-machine-v2-cli.ts:745:53) at processTicksAndRejections (internal/process/task_queues.js:95:5) (Usenode --trace-warnings ...to show where the warning was created) (node:70088) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag--unhandled-rejections=strict(see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 2) (node:70088) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

Sevenrex commented 2 years ago

was this fixed? im also having the same problem

stegaBOB commented 2 years ago

For those that are still having this issue, make sure you include the --env option in your command. Looks like its targeting the wrong file. This specific issue was the -e mainnet-beta option still not working even when specified. It looks like the issues you guys are having is due to something else. Please try asking in our discord or opening a new issue if you don't find help there. Thanks

gforcexx commented 2 years ago

I'm having an issue with this too. Ive tried everything under the sun. PLEASE CAN SOMEONE HELP. I would so appreciate it.