Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

'yarn setup-dev' upload always fails. #6

Closed
fletchertyler914 opened this issue Sep 22, 2021 · 7 comments
Closed

'yarn setup-dev' upload always fails. #6

fletchertyler914 opened this issue Sep 22, 2021 · 7 comments

Comments

@fletchertyler914
Copy link
Contributor

When running yarn setup-dev after generating my sources, I get a loop of the same error. I have let this sit for several minutes and it always fails. I've ran it multiple times with the same process and I have never gotten it to work.

It seems like a Cloud Function is throwing an exception. Can we run this function locally instead, and is it open source?

upload was not successful, rerunning
Error uploading file 3 FetchError: invalid json response body at https://us-central1-principal-lane-200702.cloudfunctions.net/uploadFile4 reason: Unexpected token E in JSON at position 0
    at /snapshot/js/node_modules/node-fetch/lib/index.js:272:32
    at runMicrotasks (<anonymous>)
    at processTicksAndRejections (internal/process/task_queues.js:95:5) {
  type: 'invalid-json'
}
Transaction simulation failed: Error processing Instruction 0: Program failed to complete 
    Program cndyAnrLdpjq1Ssp1z8xxDsB8dxe7u4HL5Nxi2K5WXZ invoke [1]
    Program log: libstd rust_begin_panic
    Program log: panicked at 'range end index 971 out of range for slice of length 255', nft-candy-machine/src/lib.rs:318:18
    Program cndyAnrLdpjq1Ssp1z8xxDsB8dxe7u4HL5Nxi2K5WXZ consumed 200000 of 200000 compute units
    Program failed to complete: BPF program panicked
    Program cndyAnrLdpjq1Ssp1z8xxDsB8dxe7u4HL5Nxi2K5WXZ failed: Program failed to complete
saving config line 0-2 failed SendTransactionError: failed to send transaction: Transaction simulation failed: Error processing Instruction 0: Program failed to complete
    at Connection.sendEncodedTransaction (/snapshot/js/node_modules/@solana/web3.js/lib/index.cjs.js:4863:13)
    at runMicrotasks (<anonymous>)
    at processTicksAndRejections (internal/process/task_queues.js:95:5)
    at async Connection.sendRawTransaction (/snapshot/js/node_modules/@solana/web3.js/lib/index.cjs.js:4822:20)
    at async Object.sendAndConfirmRawTransaction (/snapshot/js/node_modules/@solana/web3.js/lib/index.cjs.js:6649:21)
    at async Provider.send (/snapshot/js/node_modules/@project-serum/anchor/dist/cjs/provider.js:84:22)
    at async Object.rpc [as addConfigLines] (/snapshot/js/node_modules/@project-serum/anchor/dist/cjs/program/namespace/rpc.js:11:31) {
  logs: [
    'Program cndyAnrLdpjq1Ssp1z8xxDsB8dxe7u4HL5Nxi2K5WXZ invoke [1]',
    'Program log: libstd rust_begin_panic',
    "Program log: panicked at 'range end index 971 out of range for slice of length 255', nft-candy-machine/src/lib.rs:318:18",
    'Program cndyAnrLdpjq1Ssp1z8xxDsB8dxe7u4HL5Nxi2K5WXZ consumed 200000 of 200000 compute units',
    'Program failed to complete: BPF program panicked',
    'Program cndyAnrLdpjq1Ssp1z8xxDsB8dxe7u4HL5Nxi2K5WXZ failed: Program failed to complete'
  ]
}
@fletchertyler914 fletchertyler914 changed the title yarn setup-dev, upload always fails. 'yarn setup-dev' upload always fails. Sep 22, 2021
@kevinfaveri
Copy link
Owner

kevinfaveri commented Sep 22, 2021

Hmm. This is the program business. It is not hardcoded in this repo (using cloud functions) so I assume it is something to ask Metaplex about it: https://github.com/metaplex-foundation/metaplex

But about the problem exactly, it seems like the JSON it is uploading to the candy machine is invalid... Can you share your code (as a fork or as a codesandbox) so I can, maybe, debug it?

@fletchertyler914
Copy link
Contributor Author

It does appear to be coming from the metaplex cloud function. I requested for this to be open sourced a while ago, but not sure if it ever was. I'll report back on this.

Meanwhile, here is a sample JSON file generated using the generate-nft-sources command:

  "name": "Moss Monster #1",
  "symbol": "COMPANY_NAME",
  "description": "COMPANY_NAME Season 1: Moss Monster #1",
  "seller_fee_basis_points": 500,
  "image": "moss-monster.png",
  "external_url": "https://COMPANY_NAME.com/",
  "attributes": [
    { "value": "1", "trait_type": "SEASON" },
    { "value": "MOSS MONSTER", "trait_type": "TYPE" }
  ],
  "collection": { "name": "COMPANY_NAME: Season 1", "family": "COMPANY_NAME" },
  "properties": {
    "files": [{ "uri": "moss-monster.png", "type": "image/png" }],
    "category": "image",
    "creators": [
      {
        "share": 100,
        "address": "ADDRESS_HERE"
      }
    ]
  }
}

The caps are redacted names, but everything else stays the same.

@kevinfaveri
Copy link
Owner

I'm increasingly feeling it is a bad decision from Metaplex to not open source their core programs. Not sure what is happening to you tho @fletchertyler914... But please share in this issue when you find a solution

@damionx7
Copy link

Did you solve it ? @fletchertyler914

@BabyDoodles99
Copy link

I am having a similar problem, it seems that the cloud function times out the second time I call it. This issue keeps happening. I can not upload more then one at a time.

@damionx7
Copy link

Hey @BabyDoodles99 Check this out metaplex-foundation/metaplex#494 (comment)

for anyone else wondering, BE SURE you're starting with a 0.png and 0.json file, that completely fixed it for me

@praveen0311
Copy link

When running yarn setup-dev after generating my sources, I get a loop of the same error. I have let this sit for several minutes and it always fails. I've ran it multiple times with the same process and I have never gotten it to work.

It seems like a Cloud Function is throwing an exception. Can we run this function locally instead, and is it open source?

upload was not successful, rerunning
Error uploading file 3 FetchError: invalid json response body at https://us-central1-principal-lane-200702.cloudfunctions.net/uploadFile4 reason: Unexpected token E in JSON at position 0
    at /snapshot/js/node_modules/node-fetch/lib/index.js:272:32
    at runMicrotasks (<anonymous>)
    at processTicksAndRejections (internal/process/task_queues.js:95:5) {
  type: 'invalid-json'
}
Transaction simulation failed: Error processing Instruction 0: Program failed to complete 
    Program cndyAnrLdpjq1Ssp1z8xxDsB8dxe7u4HL5Nxi2K5WXZ invoke [1]
    Program log: libstd rust_begin_panic
    Program log: panicked at 'range end index 971 out of range for slice of length 255', nft-candy-machine/src/lib.rs:318:18
    Program cndyAnrLdpjq1Ssp1z8xxDsB8dxe7u4HL5Nxi2K5WXZ consumed 200000 of 200000 compute units
    Program failed to complete: BPF program panicked
    Program cndyAnrLdpjq1Ssp1z8xxDsB8dxe7u4HL5Nxi2K5WXZ failed: Program failed to complete
saving config line 0-2 failed SendTransactionError: failed to send transaction: Transaction simulation failed: Error processing Instruction 0: Program failed to complete
    at Connection.sendEncodedTransaction (/snapshot/js/node_modules/@solana/web3.js/lib/index.cjs.js:4863:13)
    at runMicrotasks (<anonymous>)
    at processTicksAndRejections (internal/process/task_queues.js:95:5)
    at async Connection.sendRawTransaction (/snapshot/js/node_modules/@solana/web3.js/lib/index.cjs.js:4822:20)
    at async Object.sendAndConfirmRawTransaction (/snapshot/js/node_modules/@solana/web3.js/lib/index.cjs.js:6649:21)
    at async Provider.send (/snapshot/js/node_modules/@project-serum/anchor/dist/cjs/provider.js:84:22)
    at async Object.rpc [as addConfigLines] (/snapshot/js/node_modules/@project-serum/anchor/dist/cjs/program/namespace/rpc.js:11:31) {
  logs: [
    'Program cndyAnrLdpjq1Ssp1z8xxDsB8dxe7u4HL5Nxi2K5WXZ invoke [1]',
    'Program log: libstd rust_begin_panic',
    "Program log: panicked at 'range end index 971 out of range for slice of length 255', nft-candy-machine/src/lib.rs:318:18",
    'Program cndyAnrLdpjq1Ssp1z8xxDsB8dxe7u4HL5Nxi2K5WXZ consumed 200000 of 200000 compute units',
    'Program failed to complete: BPF program panicked',
    'Program cndyAnrLdpjq1Ssp1z8xxDsB8dxe7u4HL5Nxi2K5WXZ failed: Program failed to complete'
  ]
}

Were you able to fix this issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants