An exception occurred: <host:port>: [WinError 10054] An existing connection was forcibly closed by the remote host

Hi Everyone,

We are facing below issue while trying to load multiple documents (in JSON format) into MongoDB through python. This is as part of migrating data from Oracle to MongoDB.

From Oracle, JSONs are getting generated by using SQL and loading into JSON file by using python and next is to load into MongoDB using pymongo.

While doing so, even though let’s say we have 20 records in the JSON file to load, post loading 3-4 records, it is throwing below error:

An exception occurred: Host:Port: [WinError 10054] An existing connection was forcibly closed by the remote host (configured timeouts: connectTimeoutMS: 20000.0ms)

Please help us if anyone has faced the same before.