Strange problem fetching tokens from contract in Mumbay chain

Dear Support,

I’m getting a strange issue when I try to fetch the Tokens from a contract I deployed in the Mumbai testnet.
First I have to say that this same procedure worked 2 weeks ago and but the same exact process is not working now.
I deploy a contract in remix which contains mp3 music, so after deploy, I get the contract address.
For instance :
0x805bb7aEC9acFC1319b05d72A0dcE6221bB38B06
This is the template code I used in Remix to mint the NFTs:

pragma solidity ^0.8.3;

import "github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/utils/Counters.sol";
import "github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/token/ERC721/extensions/ERC721URIStorage.sol";
import "github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/token/ERC721/ERC721.sol";


contract NFT is ERC721URIStorage {
    using Counters for Counters.Counter;
    Counters.Counter private _tokenIds;
    address public owner;


    constructor() ERC721("DecentraHits", "NFM") {
        owner = msg.sender;
        uint canciones = 12;
        for(uint j = 0; j < canciones; j++){
            
            createToken(string(abi.encodePacked(
            "https://ipfs.moralis.io:2053/ipfs/QmbbBJDhT5n31tHZ6ZdoFvPEwxPmbB1TArwpa6d8ssVd91/metadata/",Strings.toString(j),".json")));
            
        }
        
    }
    
    function createToken(string memory tokenURI) public returns (uint) {
        require(msg.sender == owner, "Only owner is allowed to createTokens");
        _tokenIds.increment();
        uint256 newItemId = _tokenIds.current();

        _mint(msg.sender, newItemId);
        _setTokenURI(newItemId, tokenURI);
        return newItemId;
    }
}

When I try to fetch the contract using Moralis, I see this in the console:

As you can see, the “metadata” is NULL, despite the fact that the Token URI is properly assigned.
Token URI:https://ipfs.moralis.io:2053/ipfs/QmTXtjyN7P1zptC2s9MhFtgpFd1dBgv9ame4CapGwFShAg/metadata/12.json

So when I try to get the metadata info using Moralis, I get errors, because there is no metadata assigned.

The strange thing is that I did the same procedure before to mint other mp3s and it worked.
Example:
0x400b1bCE49221d1C541ae391F3F174ed827952A6
With this contract, the metadata is fine:

What has changed in the last two weeks?

How can I fix this issue?

Any help is greatly appreaciated

Thanks!

Typically you can run the resyncMetadata API with the metadata flag option to try and resync it.

I have noticed the IPFS URL using the https://ipfs.moralis.io:2053 gateway; this is problematic right now, so you can use https://gateway.moralisipfs.com/ipfs/ instead. That is probably why metadata has not populated; try going to the token_uri directly to test it.

Thank you for your fast reply.
The token URI is accessible.
https://ipfs.moralis.io:2053/ipfs/QmTXtjyN7P1zptC2s9MhFtgpFd1dBgv9ame4CapGwFShAg/metadata/12.json

Should I change the moralis ipfs gateway anyways?

Also, if I go to Opensea to check, it display good:
https://testnets.opensea.io/assets/mumbai/0x805bb7aEC9acFC1319b05d72A0dcE6221bB38B06/1

You can change it yes. As it is already working, you can resync the metadata for this particular token, and fetch the token_uri to get the metadata manually.

I used the gateway that you suggested for minting new tokens in remix:
https://gateway.moralisipfs.com/ipfs/
But now the metadata is showing in some tokens and other dont show.

Also, despite the fact that I changed the gateway to
https://gateway.moralisipfs.com/ipfs/
the Token URI keeps showing
https://ipfs.moralis.io:2053

Why?

That means it hasn’t synced to the new gateway/token_uri yet. You can try a manual resync to get this to update. Have you run resyncMetadata on those empty metadata tokens?

I Will run resyncMetadata shortly.
If resyncMetadata is not executed,
Will it sync anyways?
How much time Will it take to sync if not run?

I believe this is the only way to resync with Moralis since it would be too expensive to manually check all the NFTs for any changed token_uris. And sometimes those token_uris can’t be accessed anyway.

In the meantime you can try using resyncMetadata.