Query results differ from number of NFTs in Contract causing cursor bug

Hi All,

We found one of these around a month ago and it seems there is some remaining clean up to do. The previous ticket number was 102411 and currently we are finding a similar problem.

We have a client in production where we are reading NFT ownership and on a contract that previously had more nfts returned from Moralis but is now responding with a bad query result and less NFTs (no nfts were burned on contract so the number should not have decreased)
Error details below
Moralis Api Error: had a bad query result
Endpoint: https://deep-index.moralis.io/api/v2/nft/0x066f2d5ead7951f0d0038c19affd500b9f02c0e5/owners?cursor=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJjdXN0b21QYXJhbXMiOnsidG9rZW5BZGRyZXNzIjoiMHgwNjZmMmQ1ZWFkNzk1MWYwZDAwMzhjMTlhZmZkNTAwYjlmMDJjMGU1In0sImtleXMiOlsiMTY0MTU1NDYyNC4wNTc1OSIsIjE2NDE1NTQ2MjQuMDU4MTMiLCIxNjQxNTU0NjI0LjA1ODI5MiIsIjE2NDE1NTQ2MjQuMDU4MzM4IiwiMTY0MTU1NDYyNC4wNTgzMzgiLCIxNjQxNTU0NjI0LjA1ODM2IiwiMTY0MTU1NDYyNC4wNTgzNiIsIjE2NDE1NTQ2MjQuMDU4MzYiLCIxNjQxNTU0NjI0LjA1ODM4NSIsIjE2NDE1NTQ2MjQuMDU4NTMxIl0sIndoZXJlIjp7InRva2VuX2FkZHJlc3MiOiIweDA2NmYyZDVlYWQ3OTUxZjBkMDAzOGMxOWFmZmQ1MDBiOWYwMmMwZTUifSwibGltaXQiOjEwMCwib2Zmc2V0IjowLCJvcmRlciI6W10sInRvdGFsIjoxMzY4NCwicGFnZSI6MTM2LCJ0YWlsT2Zmc2V0Ijo5MSwiaWF0IjoxNjcxMDAwMzUzfQ.G2P5R7roQItZt-6LEMHIH6F2cZiWRHyAnPRt4zIwraM&chain=eth&format=decimal&limit=100&sort=token_id
Result: {“total”:13684,“page”:137,“page_size”:100,"# page results":85,"# accumulated results":13685,“cursor”:null}

Let me know what we can do. Last time Moralis had to intervene.

I will check tomorrow

1 Like

it looks like the right number is 13684

and it looks like I get the right results if I list the owners for that contract now

Are you reusing the cursors or are you using then only once?