How to use CorrelationID

I’m receiving InternalErrors from my Atlas DB when running sqlSetSchema.
I’ve been running the setSchema code happily for a few days, but this morning I’m getting this error for one particular schema.

{“level”:“debug”,“time”:1707215407093,“pid”:99078,“hostname”:“35921a6184e0”,“err”:{“type”:“MongoServerError”,“message”:“an internal error occurred, correlationID = 17b13f5e1e3513cbbc4680e9”,“stack”:“MongoServerError: an internal error occurred, correlationID = 17b13f5e1e3513cbbc4680e9\n at Connection.onMessage (/app/node_modules/mongodb/lib/cmap/connection.js:231:30)\n at MessageStream. (/app/node_modules/mongodb/lib/cmap/connection.js:61:60)\n at MessageStream.emit (node:events:518:28)\n at MessageStream.emit (node:domain:488:12)\n at processIncomingData (/app/node_modules/mongodb/lib/cmap/message_stream.js:125:16)\n at MessageStream._write (/app/node_modules/mongodb/lib/cmap/message_stream.js:33:9)\n at writeOrBuffer (node:internal/streams/writable:564:12)\n at _write (node:internal/streams/writable:493:10)\n at Writable.write (node:internal/streams/writable:502:10)\n at TLSSocket.ondata (node:internal/streams/readable:1007:22)”,“ok”:0,“code”:1,“codeName”:“InternalError”},“msg”:“an internal error occurred, correlationID = 17b13f5e1e3513cbbc4680e9”}

I assumed I could download the mongo server logs, and then search for the correlationID in order to find the problem. I don’t see a correlation ID in the logfiles…

Can anybody explain what the point of the correlationID is, and how I can use it to support my system?

Hello there - If you were successfully using the sqlSetSchema command, but now all of a sudden it is failing (or perhaps just failing for this one collection)- I think that could be an issue on our end and I can raise this with that team. The correlation ID will help them to track the code (uniquely) and pinpoint any issues. I am personally not well versed in the how and why of the correlationID, but I will ask and report back.

I was able to trace the problem, to using bsonType=[“objectid”, null] in a field in my schema
bsontype=[“objectid”] worked fine.

However, the correlationID continues to be a source of mystery. I downloaded the logs for my federated database and I could see internal server errors appearing in those logs, AND each line has a correlationID. but none of the correlationID’s that were appearing in my code Errors were found in the federated logs.

All that being said. Its is not great that an invalid schema field results in an internal Server error. rather than an actually explicit error.

@Data_Services Thanks for the feedback. I agree that an explicit error is always easier to troubleshoot. I will take this back to my team to see if they can improve this.