[SOLVED] Moralis is not fetching the name or image field from metadata

This seems to happen for NFTs that have a reveal event. Moralis gets the proper metadata before the reveal, but the metadata becomes outdated after the reveal. Even after calling reSyncMetadata on the token, it doesn’t correctly get all the fields from the metadata.

Token ID: 8802
Address: 0xed5af388653567af2f388e6224dc7c4b3241c544

The metadata is as follows:

{
  "name": "Azuki #8802",
  "image": "https://ikzttp.mypinata.cloud/ipfs/QmYDvPAXtiJg7s8JdRBSLWdgSphQdac8j1YuQNNxcGE1hg/8802.png",
  "attributes": [
    {
      "trait_type": "Type",
      "value": "Human"
    },
    {
      "trait_type": "Hair",
      "value": "Indigo Pixie"
    },
    {
      "trait_type": "Clothing",
      "value": "Red Hoodie"
    },
    {
      "trait_type": "Eyes",
      "value": "Closed"
    },
    {
      "trait_type": "Mouth",
      "value": "Relaxed"
    },
    {
      "trait_type": "Background",
      "value": "Off White B"
    }
  ]
}

Moralis only returns the attributes, not the image or name:

which chain is this?

Ethereum ⠀ ⠀ ⠀ ⠀ ⠀ ⠀ ⠀ ⠀ ⠀ ⠀ ⠀ ⠀ ⠀

let me check it out :raised_hands:

I just resync the metadata :raised_hands: looks like it works now

{
  "token_address": "0xed5af388653567af2f388e6224dc7c4b3241c544",
  "token_id": "8802",
  "block_number_minted": "13992217",
  "owner_of": "0xb578a715db500925ff6f1f62cbd0df6573fcc2c6",
  "block_number": "13993652",
  "amount": "1",
  "contract_type": "ERC721",
  "name": "Azuki",
  "symbol": "AZUKI",
  "token_uri": "https://ikzttp.mypinata.cloud/ipfs/QmQFkLSQysj94s5GvTHPyzTxrawwtjgiiYS2TBLgrvw8CW/8802",
  "metadata": "{\n  \"name\": \"Azuki #8802\",\n  \"image\": \"https://ikzttp.mypinata.cloud/ipfs/QmYDvPAXtiJg7s8JdRBSLWdgSphQdac8j1YuQNNxcGE1hg/8802.png\",\n  \"attributes\": [\n    {\n      \"trait_type\": \"Type\",\n      \"value\": \"Human\"\n    },\n    {\n      \"trait_type\": \"Hair\",\n      \"value\": \"Indigo Pixie\"\n    },\n    {\n      \"trait_type\": \"Clothing\",\n      \"value\": \"Red Hoodie\"\n    },\n    {\n      \"trait_type\": \"Eyes\",\n      \"value\": \"Closed\"\n    },\n    {\n      \"trait_type\": \"Mouth\",\n      \"value\": \"Relaxed\"\n    },\n    {\n      \"trait_type\": \"Background\",\n      \"value\": \"Off White B\"\n    }\n  ]\n}",
  "synced_at": "2022-02-05T11:15:28.578Z",
  "is_valid": 1,
  "syncing": 2,
  "frozen": 0
}

Any idea why it didn’t work when I resynced? When I did it, it updated the tokenURI to the latest one, but it wasn’t getting the name/image fields

did you make sure resync the metadata? coz I remember there’s two options: metadata and uri

you might not choose the metadata and it defaults to uri

It defaults to metadata, but I had selected uri because the description made it sound like it does both?

“The uri flag will request fetch the token_uri for an NFT and then fetch it’s metadata

1 Like

ohhh gotcha, I was talking about from the admin dashboard, but no if it’s uri then it’ll just resync the uri I believe, and if you choose metadata it’ll resync the metadata

I see, so the documentation is wrong then? I’ll have to call both to properly refresh the uri + metadata?

Hmmmm my bad, just re-read the docs, seems like it should’ve resync both, can you give me one of your token again and let me have a try to see whether resyncing uri really didn’t update both?

If this is the case, I will raise the issue to the devs

1 Like

I don’t have any other out-of-sync tokens, and the one in the OP has been synced correctly by you. Is there any way to test without paying gas?

hmmm kinda difficult, probably need to deploy one and change the URI but will be a bit too much, I think I’ll just keep my heads up of the potential issue, whenever someone try to resync then I’ll have it tested that time and see whether what you mentioned really doesn’t work as what the docs mentioned

Thanks for the feedback btw :raised_hands:

You could test it out on Rinkeby or another testnet, I forgot Moralis supported those networks

I can confirm it’s not working correctly neither as stated in the manual regarding choosing uri nor metadata. For me, some tokens in my collection were correctly resynced when using URI while a majority never synced. choosing metadata produces the same results.

Do you have any sample NFT that isn’t synced yet so I can test it out and verify?

yes I do, there are 333 tokens in this smart contract only four have re-synced properly

contract address: 0x462d73b9925c73abf030f814e71c363a34bc5aa3

token ids : 1-333

let me have it checked out :raised_hands:

btw which chain is this?

sorry about that its Polygon main net