Need help to understand an error

Hello everyone. I got this error today and I am not sure of what caused it.
If anyone has some clue of where to start investigating, it would be great :slight_smile:

here is the error :

2022-11-23T03:29:27.173Z - MongoError: cannot infer query fields to set, path 'log_index' is matched twice
    at Function.create (/moralis-server/node_modules/mongodb/lib/core/error.js:57:12)
    at toError (/moralis-server/node_modules/mongodb/lib/utils.js:123:22)
    at /moralis-server/node_modules/mongodb/lib/operations/common_functions.js:379:39
    at handler (/moralis-server/node_modules/mongodb/lib/core/sdam/topology.js:942:24)
    at /moralis-server/node_modules/mongodb/lib/cmap/connection_pool.js:350:13
    at handleOperationResult (/moralis-server/node_modules/mongodb/lib/core/sdam/server.js:558:5)
    at MessageStream.messageHandler (/moralis-server/node_modules/mongodb/lib/cmap/connection.js:277:5)
    at MessageStream.emit (node:events:513:28)
    at MessageStream.emit (node:domain:489:12)
    at processIncomingData (/moralis-server/node_modules/mongodb/lib/cmap/message_stream.js:144:12)
    at MessageStream._write (/moralis-server/node_modules/mongodb/lib/cmap/message_stream.js:42:5)
    at writeOrBuffer (node:internal/streams/writable:391:12)
    at _write (node:internal/streams/writable:332:10)
    at MessageStream.Writable.write (node:internal/streams/writable:336:10)
    at Socket.ondata (node:internal/streams/readable:754:22)
    at Socket.emit (node:events:513:28)
    at Socket.emit (node:domain:489:12)
    at addChunk (node:internal/streams/readable:315:12)
    at readableAddChunk (node:internal/streams/readable:289:9)
    at Socket.Readable.push (node:internal/streams/readable:228:10)
    at TCP.onStreamRead (node:internal/stream_base_commons:190:23)
    at TCP.callbackTrampoline (node:internal/async_hooks:130:17)

Thanks :slight_smile:

What leads to this error? Can you give more info about your project. Is this a self-hosted server?

So its a bit my problem, I am not sure of what has lead to that error.

But here are a bit more details maybe :

  • the server is not self hosted, it is a pro plan
  • It has a bunch of syncs and database triggers responding to nfts mints (i log in the moralis db when the nft is minted are resolve a bunch of stuff)
  • We recently moved the project for another server and things were working fine there (never seen that error before) and the code hasnt changed since so I thought maybe this could be related (but the new server being new, i didnt expecting any db issue as it seem to be the case here)

I’ll be happy to provide any other information.

Right now, im curious about what cause those types of errors as it would be a good first lead (I havnt researched it a lot yet as I have a busy day but I’ll do that tomorrow).

I thought maybe its a common enough error :slight_smile:

What is your Moralis server URL? Another user had this error - does this error repeat? Is everything all working otherwise e.g. in your app?

I saw this type of error reported before, I don’t know the fix for it, it could be related to a query parameters from what I searched on google.