alchemy-sdk-js
alchemy-sdk-js copied to clipboard
The nft endpoint is returning a token URI error even though the token URI is valid
On the goerli testnet, the nft endpoint is returning a token URI error even though the token URI is valid:
const { pageKey, ownedNfts } = await alchemy.nft.getNftsForOwner(
"0xE70989f0A6b50E3c8Ef6Df57e994E99AA79EbD27",
{ contractAddresses: [""0xe47463a0b8fd39286d7a72ca8e334795779e2f77""], }
);
Results in the following error:
"Contract returned a broken token uri, do not retry"
But the token URI is correct and valid so why is it giving me this error?
See correct data returned from the token URI: https://wrappedpunks.com:3000/api/punks/metadata/1
I'm experiencing the same thing, I also sometimes get: error: "IPFS gateway timed out"
specially right after minting an NFT and fetching right after, even though polyscan shows the transaction to be successful. I'm working on Mumbai testnet. I've also tried with axios directly to the endpoint https://polygon-mumbai.g.alchemy.com/nft/v2/
and get the same result.
@outdoteth Can you try calling alchemy.nft.refreshContract()
on the contracts with timed out gateways or parsing errors to try and refetch the metadata again? We try to ingest contracts regularly, but sometimes the ingestion can miss a contract if the gateways uri is down.
@thebrianchen That results in an error saying that only eth mainnet is supported (im on goerli)
If you have the token id, could you try refreshNftMetadata()
?
I'm experiencing the same thing, I also sometimes get:
error: "IPFS gateway timed out"
specially right after minting an NFT and fetching right after, even though polyscan shows the transaction to be successful. I'm working on Mumbai testnet. I've also tried with axios directly to the endpointhttps://polygon-mumbai.g.alchemy.com/nft/v2/
and get the same result.
Also experiencing this on trying to get all NFTs from an erc1155 contract. We use a locally run ipfs node and on the contract the uri is as follows: ipfs://[insert hash]. Sometimes I get all the tokens, sometimes a few and sometimes none. It differs per request.
Hi @outdoteth the NFT you reported above has a token uri with SSL certificate problems, so we can't retrieve the metadata at the uri https://wrappedpunks.com:3000/api/punks/metadata/1 SSL certificate problem: unable to get local issuer certificate)
@franzrecinos @LALauw the IPFS gateway time out error is expected to happen for new mints because IPFS is a decentralized file storage solution which has some initial latency by design. Only a very tiny fraction of nfts are affected by ipfs gateway timeouts according to our metrics. Should be resolvable by retries and using refreshNftMetadata.
the NFT you reported above has a token uri with SSL certificate problems
@niveda-krish The cert seems to be fine for me. Maybe I am misreading this though.


This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs