question

ItIsN3RD avatar image
0 Votes"
ItIsN3RD asked ItIsN3RD commented

ConnectionError: Connection lost - read ECONNRESET (Node.JS Error)

This is a node.js application im running on my local PC not on any azure service, However i am connecting to an azure mssql database. After like 45 minutes of my Node.js application running it keeps throwing this error:

events.js:292
throw er; // Unhandled 'error' event
^
ConnectionError: Connection lost - read ECONNRESET

azure-sql-database
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

AnuragSharma-MSFT avatar image
0 Votes"
AnuragSharma-MSFT answered ItIsN3RD commented

Hi @ItIsN3RD, looking at the nature of error, it looks its timeout issue in case of no activity. Please refer to similar thread posted:

  1. https://github.com/tediousjs/tedious/issues/923

  2. https://stackoverflow.com/questions/36423788/node-js-econnreset-error-when-running-on-azure

  3. https://github.com/microsoft/azure-devops-node-api/issues/292

Also, if you re-run the application, do you still get the error?

Meanwhile, is it possible for you to provide the code you are using?




· 3
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

@AnuragSharma-MSFT Thanks for the reply, however i think i figured out the issue. I bascially had a set interval that wrapped around the whole block of code so it kept making new connections then after a certain amount of time it would error out because those old connections were not being used. Because i now only wrapped the setinterval around the queryDatabase() and it seems to be working now.

0 Votes 0 ·

@AnuragSharma-MSFT My application ran fine for 4-5 hours which is alot better than normal usually i get the error around 35 minutes. I am still getting the error events.js:287
throw er; // Unhandled 'error' event
^
ConnectionError: Connection lost - read ECONNRESET

Im gonna upload my code in one second.

0 Votes 0 ·