Skip to main content
ECONNRESET Error

ECONNRESET Error explained.

Praise Magidi avatar
Written by Praise Magidi
Updated over 2 weeks ago

Message

read ECONNRESET

Cause

The implementation of Synatic buffers are backed by MongoDB. A `read ECONNRESET` error typically means that the connection was forcibly closed by the remote host (in this case, the MongoDB server).

Common Causes:

  • Network instability

  • Firewall interruptions

  • MongoDB server restart

  • Connection timeout

  • Server overload

Resolution

This is an error at the infrastructure level, and while end users cannot directly prevent it, there are ways to minimise its impact.

Avoid long running queries on buffers

This error comes up when an existing connection to the database is terminated abruptly. Queries that are quick will typically not be affected because once a primary goes down, new connections will be instantiated to the new primary. If a query is long running it is more likely to be terminated unexpectedly because of its longstanding connection.

Batch buffer records

If you are streaming a large number records out of a buffer into a flow, the time you are connected to the buffer (and thus MongoDB) is affected directly by the time your flow takes to process those records. While the rest of the flow executes, your connection to MongoDB will remain in place so that it can stream more records out as necessary. In order to minimise the time you are connected to MongoDB, batch the records using a `Batch Records` step. This allows you to retrieve all records before processing them, which means the time you are connected to MongoDB is unaffected by how long the rest of the flow takes to execute. Note that batching records will increase memory usage significantly for a large number of records, so one will have to weigh the risk of the connection getting terminated (rare), vs higher memory usage.

Restart the flow

If safe to do so, you can restart the flow.

Error Detail

{
"error": {
"errorResponse": {
"errno": -104,
"code": "ECONNRESET",
"syscall": "read"
},
"errno": -104,
"code": "ECONNRESET",
"syscall": "read",
"writeErrors": [],
"result": {
"insertedCount": 0,
"matchedCount": 0,
"modifiedCount": 0,
"deletedCount": 0,
"upsertedCount": 0,
"upsertedIds": {},
"insertedIds": {
"0": "678a5a7XXXXXXXXXXXXXX"
}
}
},
"message": "read ECONNRESET",
"errorMessage": "read ECONNRESET",
"stepType": "Destination",
"stepName": "Buffer",
"statusCode": 500,
"stepId": "40d88a3XXXXXXXXXXX",
"mapStepId": "VlUgdtNmm",
"mapStepPath": "VlUgdtNmm",
"mapStepType": "Step",
"module": "Synatic"
}

Did this answer your question?