tediousjs / tedious

Node TDS module for connecting to SQL Server databases.

Home Page:http://tediousjs.github.io/tedious/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Connection lost - read ECONNRESET at ConnectionManager.connect

Harshpanday opened this issue · comments

I am trying to populate my database using sequelize using a payload from a webhook.

but when I am trying to send this using postman, the whole payload is not going through only a part of it is, then I am getting the following error

ConnectionError [SequelizeConnectionError]: Connection lost - read ECONNRESET
    at ConnectionManager.connect (XXXX\node_modules\sequelize\lib\dialects\mssql\connection-manager.js:112:17)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async ConnectionManager._connect (XXXX\node_modules\sequelize\lib\dialects\abstract\connection-manager.js:222:24) {       
  parent: ConnectionError: Connection lost - read ECONNRESET
      at Connection.socketError (XXXX\node_modules\tedious\lib\connection.js:1408:26)
      at Socket.<anonymous>( XXXX\node_modules\tedious\lib\connection.js:1158:16)
      at Socket.emit (node:events:525:35)
      at emitErrorNT (node:internal/streams/destroy:151:8)
      at emitErrorCloseNT (node:internal/streams/destroy:116:3)
      at process.processTicksAndRejections (node:internal/process/task_queues:82:21) {
    code: 'ESOCKET',
    isTransient: undefined
  },
  original: ConnectionError: Connection lost - read ECONNRESET
      at Connection.socketError (XXXX\node_modules\tedious\lib\connection.js:1408:26)
      at Socket.<anonymous> (XXXX\node_modules\tedious\lib\connection.js:1158:16)
      at Socket.emit (node:events:525:35)
      at emitErrorNT (node:internal/streams/destroy:151:8)
      at emitErrorCloseNT (node:internal/streams/destroy:116:3)
      at process.processTicksAndRejections (node:internal/process/task_queues:82:21) {
    code: 'ESOCKET',
    isTransient: undefined
  }
}

I have tried all the fixes suggested in this thread https://github.com/tediousjs/tedious/issues/923 #923 but I am still getting the same error.

Software Versions:
Node : v18.16.0
mssql : v9.1.1
Sequelize : v6.31.1
Tedious: v16.1.0

Hi @Harshpanday, I saw you also post this under #923. Someone just post a suggestion: #923 (comment). Maybe also give this a try.

but when I am trying to send this using postman, the whole payload is not going through only a part of it is, then I am getting the following error

I am not that familiar with Sequelize. Are you saying that just use postman also gives you the same error or you are using postman with Sequelize reviewed this error?

By the way, just a thought. if your payload is giant, maybe the new package sizes that your have tried are still not big enough?

If possible, can you also provide your connection configuration and maybe a repro script, so I could try to reproduce this behavior, and investigate this a bit more. Thanks!

Hey @MichaelSun90, I am trying to send an HTTP post to my script, which uses sequelize to store data from the HTTP req into a database. I posted an issue here because in #923 people said that the error I am getting is related to tedious.

But it turns out, my local SQL server was the one causing this issue, I tried using Azure's SQL database and everything worked fine.

Hi @Harshpanday , glad to know that you got it figured out. I will close this one for know. If you have any further question, do not hesitate to open a new one or reopen this one.