metaplex-foundation / sugar

Candy Machine Rust CLI.
Apache License 2.0
203 stars 116 forks source link

[Bug]: sugar deploy - Missing collection item in cache #469

Closed gschweger closed 7 months ago

gschweger commented 10 months ago

Issue description

I would like to mint an NFT without adding it to a collection.

  1. I added the 0.png and 0.json to the assets directory.
  2. Run sugar launch
  3. The sugar validate command sends a message about the missing collections files in assets folder and asks if I want to continue.
  4. Yes, I want to continue.
  5. Validation passes.
  6. sugar upload passes.
  7. sugar deploy fails with this error message: ๐Ÿ›‘ Error running command (re-run needed): Missing collection item in cache

Here is the generated cache.json:

{
  "program": {
    "candyMachine": "",
    "candyGuard": "",
    "candyMachineCreator": "",
    "collectionMint": ""
  },
  "items": {
    "0": {
      "name": "Number outside collection",
      "image_hash": "36ae5333e54b457cedcc6ec93a84970f05ed57452ca9745a0768ed40cd93e5fa",
      "image_link": "https:///bucket_name.s3.amazonaws.com/nft/0.png",
      "metadata_hash": "f844f1e2e7e6822ff132ec67153732bd6087ecbd67799d03903ab33c765a97d5",
      "metadata_link": "https://bucket_name.s3.amazonaws.com/nft/0.json",
      "onChain": false
    }
  }
}

Relevant log output

$ sugar launch --rpc-url https://api.devnet.solana.com/ --log-level info --strict assets/

Starting Sugar launch... ๐Ÿš€ 

>>> sugar validate

[1/1] ๐Ÿ—‚  Loading assets

+----------------------------------------------+
| โš ๏ธ  MISSING COLLECTION FILES IN ASSETS FOLDER |
+----------------------------------------------+
Check https://docs.metaplex.com/developer-tools/sugar/guides/preparing-assets for the collection file requirements if you want a collection to be set automatically.

โœ” Do you want to continue without automatically setting the candy machine collection? ยท yes

โ  
โ–ชโ–ชโ–ชโ–ชโ–ช Validating 1 metadata file(s)...

Validation complete, your metadata file(s) look good.

>>> sugar upload

[1/4] ๐Ÿ—‚  Loading assets
Found 1 asset pair(s), uploading files:
+--------------------+
| images    |      0 |
| metadata  |      0 |
+--------------------+

....no files need uploading, skipping remaining steps.

1/1 asset pair(s) uploaded.

>>> sugar deploy

๐Ÿ›‘ Error running command (re-run needed): Missing collection item in cache

Priority this issue should have

Low (slightly annoying)

samuelvanderwaal commented 10 months ago

The Candy Machine V3 smart contract enforces using collections for minting from it. You can either use Candy Machine V2 with Sugar v1.2.2, or if your use case is just minting a single NFT there are better tools for that such as Sol Tools V2 and Metaboss.

confusedeinstein commented 7 months ago

Hi were you able to fix this issue? I'm facing the same problem

gschweger commented 7 months ago

Hi @confusedeinstein , I started to use metaboss, as it was suggested for me in a previous comment. Metaboss was perfect for me.

I think, this issue could be closed