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

Custom program error: 0x13a when uploading #1390

Closed 0x62 closed 2 years ago

0x62 commented 2 years ago

Describe the bug I'm trying to complete the upload step to deploy a candy machine and I get the below output:

Beginning the upload for 13 (png+json) pairs

started at: 1641316078902

wallet public key: 6qS6nsBoLjzrPWU52k2djg4trH5k4a8sbgNeJ7CQjJXE

Processing file: 0

initializing config

🚨 Transaction simulation failed: Error processing Instruction 1: custom program error: 0x13a
    Program 11111111111111111111111111111111 invoke [1]
    Program 11111111111111111111111111111111 success
    Program cndyAnrLdpjq1Ssp1z8xxDsB8dxe7u4HL5Nxi2K5WXZ invoke [1]
    Program log: Custom program error: 0x13a
    Program cndyAnrLdpjq1Ssp1z8xxDsB8dxe7u4HL5Nxi2K5WXZ consumed 6945 of 200000 compute units
    Program cndyAnrLdpjq1Ssp1z8xxDsB8dxe7u4HL5Nxi2K5WXZ failed: custom program error: 0x13a

I haven't been able to find any information about this error code online (at the time of posting literally zero results).

I've checked that the metadata is valid JSON, conforms to metaplex standards and that the corresponding image exists and is valid. I've also checked the symbol is unique and available (though I'm not sure if that is enforced by metaplex?).

Expected behavior The files are uploaded.

Desktop (please complete the following information):

Solseum commented 2 years ago

Candy machines V1 programs are already dead so anyone will be able to create a CM using v1.

There is the why is already closed and not tomorrow!

https://twitter.com/redacted_j/status/1478345311793954817?s=20

DramaCrypto commented 2 years ago

So candy machine 0.0.1 For this, we can't use anymore?

prashantcrypto commented 2 years ago

npx ts-node metaplex\js\packages\cli\src\candy-machine-v2-cli.ts upload -k keypair.json -e mainnet-beta -l debug -cp config-v2 assests setting the log value to: debug wallet public key: 5iEqGCAQ787BW6zi5GRJcwAAfdzqbAGmaWqAs49C4Phe program id from anchor cndy3Z4yapfJBmL3ShUp5exZKqR3z33thTzeNMm2gRZ Beginning the upload for 50 (img+json) pairs started at: 1641352755893 Size 50 { mediaExt: '.png', index: '0' } initializing candy machine Transaction simulation failed: Error processing Instruction 0: custom program error: 0x1 Program 11111111111111111111111111111111 invoke [1] Transfer: insufficient lamports 30888954, need 89554320 Program 11111111111111111111111111111111 failed: custom program error: 0x1 Translating error SendTransactionError: failed to send transaction: Transaction simulation failed: Error processing Instruction 0: custom program error: 0x1 at Connection.sendEncodedTransaction (F:\mehta\Metaplex yarn installed\metaplex\js\packages\cli\node_modules\@solana\web3.js\src\connection.ts:3553:13) at processTicksAndRejections (node:internal/process/task_queues:96:5) at async Connection.sendRawTransaction (F:\mehta\Metaplex yarn installed\metaplex\js\packages\cli\node_modules\@solana\web3.js\src\connection.ts:3513:20) at async sendAndConfirmRawTransaction (F:\mehta\Metaplex yarn installed\metaplex\js\packages\cli\node_modules\@solana\web3.js\src\util\send-and-confirm-raw-transaction.ts:27:21) at async Provider.send (F:\mehta\Metaplex yarn installed\metaplex\js\packages\cli\node_modules\@project-serum\anchor\src\provider.ts:114:18) at async Object.rpc [as initializeCandyMachine] (F:\mehta\Metaplex yarn installed\metaplex\js\packages\cli\node_modules\@project-serum\anchor\src\program\namespace\rpc.ts:19:23) at async createCandyMachineV2 (F:\mehta\Metaplex yarn installed\metaplex\js\packages\cli\src\helpers\accounts.ts:150:11) at async uploadV2 (F:\mehta\Metaplex yarn installed\metaplex\js\packages\cli\src\commands\upload.ts:133:21) at async Command. (F:\mehta\Metaplex yarn installed\metaplex\js\packages\cli\src\candy-machine-v2-cli.ts:183:7) { logs: [ 'Program 11111111111111111111111111111111 invoke [1]', 'Transfer: insufficient lamports 30888954, need 89554320', 'Program 11111111111111111111111111111111 failed: custom program error: 0x1' ] } Error deploying config to Solana network. SendTransactionError: failed to send transaction: Transaction simulation failed: Error processing Instruction 0: custom program error: 0x1 at Connection.sendEncodedTransaction (F:\mehta\Metaplex yarn installed\metaplex\js\packages\cli\node_modules\@solana\web3.js\src\connection.ts:3553:13) at processTicksAndRejections (node:internal/process/task_queues:96:5) at async Connection.sendRawTransaction (F:\mehta\Metaplex yarn installed\metaplex\js\packages\cli\node_modules\@solana\web3.js\src\connection.ts:3513:20) at async sendAndConfirmRawTransaction (F:\mehta\Metaplex yarn installed\metaplex\js\packages\cli\node_modules\@solana\web3.js\src\util\send-and-confirm-raw-transaction.ts:27:21) at async Provider.send (F:\mehta\Metaplex yarn installed\metaplex\js\packages\cli\node_modules\@project-serum\anchor\src\provider.ts:114:18) at async Object.rpc [as initializeCandyMachine] (F:\mehta\Metaplex yarn installed\metaplex\js\packages\cli\node_modules\@project-serum\anchor\src\program\namespace\rpc.ts:19:23) at async createCandyMachineV2 (F:\mehta\Metaplex yarn installed\metaplex\js\packages\cli\src\helpers\accounts.ts:150:11) at async uploadV2 (F:\mehta\Metaplex yarn installed\metaplex\js\packages\cli\src\commands\upload.ts:133:21) at async Command. (F:\mehta\Metaplex yarn installed\metaplex\js\packages\cli\src\candy-machine-v2-cli.ts:183:7) { logs: [ 'Program 11111111111111111111111111111111 invoke [1]', 'Transfer: insufficient lamports 30888954, need 89554320', 'Program 11111111111111111111111111111111 failed: custom program error: 0x1' ] } upload was not successful, please re-run. SendTransactionError: failed to send transaction: Transaction simulation failed: Error processing Instruction 0: custom program error: 0x1 at Connection.sendEncodedTransaction (F:\mehta\Metaplex yarn installed\metaplex\js\packages\cli\node_modules\@solana\web3.js\src\connection.ts:3553:13) at processTicksAndRejections (node:internal/process/task_queues:96:5) at async Connection.sendRawTransaction (F:\mehta\Metaplex yarn installed\metaplex\js\packages\cli\node_modules\@solana\web3.js\src\connection.ts:3513:20) at async sendAndConfirmRawTransaction (F:\mehta\Metaplex yarn installed\metaplex\js\packages\cli\node_modules\@solana\web3.js\src\util\send-and-confirm-raw-transaction.ts:27:21) at async Provider.send (F:\mehta\Metaplex yarn installed\metaplex\js\packages\cli\node_modules\@project-serum\anchor\src\provider.ts:114:18) at async Object.rpc [as initializeCandyMachine] (F:\mehta\Metaplex yarn installed\metaplex\js\packages\cli\node_modules\@project-serum\anchor\src\program\namespace\rpc.ts:19:23) at async createCandyMachineV2 (F:\mehta\Metaplex yarn installed\metaplex\js\packages\cli\src\helpers\accounts.ts:150:11) at async uploadV2 (F:\mehta\Metaplex yarn installed\metaplex\js\packages\cli\src\commands\upload.ts:133:21) at async Command. (F:\mehta\Metaplex yarn installed\metaplex\js\packages\cli\src\candy-machine-v2-cli.ts:183:7) { logs: [ 'Program 11111111111111111111111111111111 invoke [1]', 'Transfer: insufficient lamports 30888954, need 89554320', 'Program 11111111111111111111111111111111 failed: custom program error: 0x1' ] }

i have same problem when using v2

DramaCrypto commented 2 years ago

image image

DramaCrypto commented 2 years ago

Yeah, I also have issues when use candymachine v2

DramaCrypto commented 2 years ago

{ "name": "Dinodawg Kingdom #1", "description": "3,500 Dinodawgs pouncing onto the Solana blockchain.", "image": "0.png", "attributes": [ { "trait_type": "Backgrounds", "value": "Pastel Dark Green" }, { "trait_type": "Body", "value": "Mustard Spots" }, { "trait_type": "Wings", "value": "No Wings" }, { "trait_type": "Collars", "value": "Glowing Green" }, { "trait_type": "Mouth", "value": "Shark Teeth" }, { "trait_type": "Eyes", "value": "Scar" }, { "trait_type": "Accessories", "value": "Snake on Head Green" } ], "symbol": "DINODAWG", "seller_fee_basis_points": 0, "external_url": "https://dinodawgs.io", "properties": { "files": [ { "uri": "0.png", "type": "image/png" } ], "category": "image", "creators": [ { "address": "XXXXXXXXXXXXXXXXXXXXXXXXXXX", "share": 100 } ] }, "collection": { "name": "Dinodawg Kingdom", "family": "Dinodawg" } }

DramaCrypto commented 2 years ago

this is my json metadata, what's wrong?

DramaCrypto commented 2 years ago

image

prashantcrypto commented 2 years ago

this is my json metadata, what's wrong?

I can create json file for your nft and also can create candy machine with mint siye. Just for 2 sol. My discord shyaid#3516 If you are interested free to message me

piscu7 commented 2 years ago

I also have same issues

aaa

londonbridges13 commented 2 years ago

This solved it for me: https://docs.metaplex.com/candy-machine-v2/Configuration

Create a new file called config.json. In that file paste this (adjust for your collection): { "price": 1.0, "number": 10000, "gatekeeper": null, "solTreasuryAccount": "", "splTokenAccount": null, "splToken": null, "goLiveDate": "2 Jan 2022 00:00:00 GMT", "endSettings": null, "whitelistMintSettings": null, "hiddenSettings": null, "storage": "arweave", "ipfsInfuraProjectId": null, "ipfsInfuraSecret": null, "awsS3Bucket": null, "noRetainAuthority": false, "noMutable": false }

save the file and run the upload again. πŸ‘Œ

prashantcrypto commented 2 years ago

This solved it for me: https://docs.metaplex.com/candy-machine-v2/Configuration

Create a new file called config.json. In that file paste this (adjust for your collection): { "price": 1.0, "number": 10000, "gatekeeper": null, "solTreasuryAccount": "", "splTokenAccount": null, "splToken": null, "goLiveDate": "2 Jan 2022 00:00:00 GMT", "endSettings": null, "whitelistMintSettings": null, "hiddenSettings": null, "storage": "arweave", "ipfsInfuraProjectId": null, "ipfsInfuraSecret": null, "awsS3Bucket": null, "noRetainAuthority": false, "noMutable": false }

save the file and run the upload again. πŸ‘Œ

I have now error when start yarn . On localhost:3000 it show error

Raziel-Zavaleta commented 2 years ago

you need to use v2 of candy machine, v1 is no longer available

kingape111 commented 2 years ago

hey, did this ever get solved?

0x62 commented 2 years ago

This issue is resolved by deploying using Candy Machine v2 - https://docs.metaplex.com/candy-machine-v2/introduction

tuncatunc commented 2 years ago

I'm using v2 and still have these errs Upload assets

ts-node js/packages/cli/src/candy-machine-v2-cli.ts upload \
    -e devnet \
    -k ~/.config/solana/tunca-id.json \
    -cp config.json \
    -c example \
    ./assets

Verify Upload

ts-node js/packages/cli/src/candy-machine-v2-cli.ts verify_upload \
    -e devnet \
    -k ~/.config/solana/tunca-id.json \
    -c example

Mint Token

ts-node js/packages/cli/src/candy-machine-v2-cli.ts mint_one_token \
    -e devnet \
    -k ~/.config/solana/tunca-id.json \
    -c example
wallet public key: ErCrFDLa87WNki3Tn8mf1CPZjrGp9wv14FwdtTrXv6Xi
Rejected via websocket { InstructionError: [ 4, { Custom: 319 } ] }
Timeout Error caught {
  err: { InstructionError: [ 4, [Object] ] },
  slot: 106398033,
  confirmations: 0
}
/home/tunca/solana/metaplex/js/packages/cli/src/helpers/transactions.ts:136
            throw new Error(
                  ^
Error: Transaction failed: Custom program error: 0x13f
    at sendSignedTransaction (/home/tunca/solana/metaplex/js/packages/cli/src/helpers/transactions.ts:136:19)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at async sendTransactionWithRetryWithKeypair (/home/tunca/solana/metaplex/js/packages/cli/src/helpers/transactions.ts:59:26)
    at async mintV2 (/home/tunca/solana/metaplex/js/packages/cli/src/commands/mint.ts:344:5)
    at async Command.<anonymous> (/home/tunca/solana/metaplex/js/packages/cli/src/candy-machine-v2-cli.ts:716:16)

Solana config is

tunca@DESKTOP-N7ONO2Q:~/solana/metaplex$ solana config get
Config File: /home/tunca/.config/solana/cli/config.yml
RPC URL: https://api.devnet.solana.com
WebSocket URL: wss://api.devnet.solana.com/ (computed)
Keypair Path: /home/tunca/.config/solana/tunca-id.json
Commitment: confirmed
bradbitler commented 2 years ago

adding an additional 1 SOL to my wallet, even though it wasn't empty, for some reason resolved this same issue for me.

0xlazytron commented 2 years ago

I'm using v2 and still have these errs Upload assets

ts-node js/packages/cli/src/candy-machine-v2-cli.ts upload \
    -e devnet \
    -k ~/.config/solana/tunca-id.json \
    -cp config.json \
    -c example \
    ./assets

Verify Upload

ts-node js/packages/cli/src/candy-machine-v2-cli.ts verify_upload \
    -e devnet \
    -k ~/.config/solana/tunca-id.json \
    -c example

Mint Token

ts-node js/packages/cli/src/candy-machine-v2-cli.ts mint_one_token \
    -e devnet \
    -k ~/.config/solana/tunca-id.json \
    -c example
wallet public key: ErCrFDLa87WNki3Tn8mf1CPZjrGp9wv14FwdtTrXv6Xi
Rejected via websocket { InstructionError: [ 4, { Custom: 319 } ] }
Timeout Error caught {
  err: { InstructionError: [ 4, [Object] ] },
  slot: 106398033,
  confirmations: 0
}
/home/tunca/solana/metaplex/js/packages/cli/src/helpers/transactions.ts:136
            throw new Error(
                  ^
Error: Transaction failed: Custom program error: 0x13f
    at sendSignedTransaction (/home/tunca/solana/metaplex/js/packages/cli/src/helpers/transactions.ts:136:19)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at async sendTransactionWithRetryWithKeypair (/home/tunca/solana/metaplex/js/packages/cli/src/helpers/transactions.ts:59:26)
    at async mintV2 (/home/tunca/solana/metaplex/js/packages/cli/src/commands/mint.ts:344:5)
    at async Command.<anonymous> (/home/tunca/solana/metaplex/js/packages/cli/src/candy-machine-v2-cli.ts:716:16)

Solana config is

tunca@DESKTOP-N7ONO2Q:~/solana/metaplex$ solana config get
Config File: /home/tunca/.config/solana/cli/config.yml
RPC URL: https://api.devnet.solana.com
WebSocket URL: wss://api.devnet.solana.com/ (computed)
Keypair Path: /home/tunca/.config/solana/tunca-id.json
Commitment: confirmed

I Successfully Uploaded 20 .png files with CMv2 1- cd to /js/packages/cli/src 2- Run yarn install 3- Create new file named config.json in metaplex root 4- Copy the following code and past it in the config.json file { "price": 1.0, "number": 20, "gatekeeper": null, "solTreasuryAccount": "Your Treasury Address", "splTokenAccount": null, "splToken": null, "goLiveDate": "25 Dec 2021 00:00:00 GMT", "endSettings": null, "whitelistMintSettings": null, "hiddenSettings": null, "storage": "arweave", "ipfsInfuraProjectId": null, "ipfsInfuraSecret": null, "awsS3Bucket": null, "noRetainAuthority": false, "noMutable": false } 5 - Replace the solTreasuryAccountwith yours. 6- cd to /js/packages/cli/src 7- Specify the keypairs and the assets folder in the below command 8- ts-node candy-machine-v2-cli.ts upload -e devnet -k E:/fyp/config/devnet-test.json -l debug -c example E:/nft/scoby/metaplex/assets -cp E:/nft/scoby/metaplex/config.json

It will Upload the assetsaccording to your internet check the below video.

https://user-images.githubusercontent.com/59694837/148968213-73b48bcd-7d1c-4658-bde9-a14bdc3c4256.mp4

tuncatunc commented 2 years ago

Upgraded node typescript version to latest and it worked.

ghost commented 2 years ago

Upgraded node typescript version to latest and it worked.

Didn't work for me.

0xlazytron commented 2 years ago

Upgraded node typescript version to latest and it worked.

This issue is related to the Candymachine version...they have completely disabled it check this https://twitter.com/redacted_j/status/1478345311793954817?s=20 instead, we can use Candy Machine v2 - https://docs.metaplex.com/candy-machine-v2/introduction
check my thread and follow the steps to upload and verify your assets.

S1NJ commented 2 years ago

I Successfully Uploaded 20 .png files with CMv2 1- cd to /js/packages/cli/src 2- Run yarn install 3- Create new file named config.json in metaplex root 4- Copy the following code and past it in the config.json file { "price": 1.0, "number": 20, "gatekeeper": null, "solTreasuryAccount": "Your Treasury Address", "splTokenAccount": null, "splToken": null, "goLiveDate": "25 Dec 2021 00:00:00 GMT", "endSettings": null, "whitelistMintSettings": null, "hiddenSettings": null, "storage": "arweave", "ipfsInfuraProjectId": null, "ipfsInfuraSecret": null, "awsS3Bucket": null, "noRetainAuthority": false, "noMutable": false } 5 - Replace the solTreasuryAccountwith yours. 6- cd to /js/packages/cli/src 7- Specify the keypairs and the assets folder in the below command 8- ts-node candy-machine-v2-cli.ts upload -e devnet -k E:/fyp/config/devnet-test.json -l debug -c example E:/nft/scoby/metaplex/assets -cp E:/nft/scoby/metaplex/config.json

It will Upload the assetsaccording to your internet check the below video.

upload.mp4

What do mean by 'cd'? in 6- cd to /js/packages/cli/src.

KayaNFT commented 2 years ago

Was this somehow solved? I am still getting the error even after creating a config.json file

jeffpdotone commented 2 years ago

Anyone knows Custom program error: 0x177a?

dedjr commented 2 years ago

Anyone knows Custom program error: 0x177a?

error:

Program returned error: custom program error: 0x1783

sekoyo commented 2 years ago

adding an additional 1 SOL to my wallet, even though it wasn't empty, for some reason resolved this same issue for me.

Damn this fixed it for me πŸ‘Œ, had just under 1 SOL and the error didn't suggest anything