question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Could not connect (sequence) - ESOCKET

See original GitHub issue

Hi, Im experimenting an error using mssql library for nodejs. I am using PoolConnection from mssql (and I also tried using tedious-pool-connection library). The app Im running simply connects to a SQL server db and executes some writing queries. Multiple queries at the same time, or in serial order, it doesn’t matter: I always get this kind of errors for some queries:

ConnectionError: Failed to connect to <DB_URL>:1433 - Could not connect (sequence)
    at Connection.<anonymous> (<PROJECT_DIR>/node_modules/mssql/lib/tedious/connection-pool.js:68:17)
    at Object.onceWrapper (events.js:421:26)
    at Connection.emit (events.js:314:20)
    at Connection.socketError (<PROJECT_DIR>/node_modules/mssql/node_modules/tedious/lib/connection.js:1290:12)
    at <PROJECT_DIR>/node_modules/mssql/node_modules/tedious/lib/connection.js:1116:21
    at SequentialConnectionStrategy.connect (<PROJECT_DIR>/node_modules/mssql/node_modules/tedious/lib/connector.js:87:14)
    at Socket.onError <PROJECT_DIR>/node_modules/mssql/node_modules/tedious/lib/connector.js:100:12)
    at Socket.emit (events.js:314:20)
    at emitErrorNT (internal/streams/destroy.js:92:8)
    at emitErrorAndCloseNT (internal/streams/destroy.js:60:3) {
  code: 'ESOCKET',
  originalError: ConnectionError: Failed to connect to <DB_URL>:1433 - Could not connect (sequence)
      at ConnectionError (<PROJECT_DIR>/node_modules/mssql/node_modules/tedious/lib/errors.js:13:12)
      at Connection.socketError (<PROJECT_DIR>/node_modules/mssql/node_modules/tedious/lib/connection.js:1290:56)
      at <PROJECT_DIR>/node_modules/mssql/node_modules/tedious/lib/connection.js:1116:21
      at SequentialConnectionStrategy.connect (/<PROJECT_DIR>/node_modules/mssql/node_modules/tedious/lib/connector.js:87:14)
      at Socket.onError (<PROJECT_DIR>/node_modules/mssql/node_modules/tedious/lib/connector.js:100:12)
      at Socket.emit (events.js:314:20)
      at emitErrorNT (internal/streams/destroy.js:92:8)
      at emitErrorAndCloseNT (internal/streams/destroy.js:60:3)
      at processTicksAndRejections (internal/process/task_queues.js:84:21) {
    code: 'ESOCKET'
  }
}

What could be causing this issue?

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:19 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
fedecacciacommented, Oct 20, 2020

Ok, I dont understand which is the reason for that, it all depends on how mssql library is hadling the connection internally. Will check with them. Thanks!

1reaction
IanChokScommented, Oct 20, 2020

No worries, happy to help 😄

The SENT_TLSSSLNEGOTIATION is the state of tedious when it’s trying to establish TLS/SSL connection to the server (in the pre-login stage). This can be thrown in various ways, but I’m guessing you’re trying to send a request while the driver is not yet connected to the server.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Could not connect (sequence) - ESOCKET #1121 - GitHub
Hi, Im experimenting an error using mssql library for nodejs. I am using PoolConnection from mssql. The app Im running simply connects to...
Read more >
Error connecting NodeJS and SQL Server - Could not connect ...
I got it!! Basically, for NodeJS get connection to SQLServer, the TCP/IP Protocol must be enabled for the MSSQLSERVER Instance, in the SQL ......
Read more >
Microsoft/mssql-developers - Gitter
Connecting to SQL Server 2000 , ConnectionError ESOCKET Socket error. ... Failed to connect to localhost:1433 - Could not connect (sequence)
Read more >
Could not connect (sequence) - ESOCKET - Bountysource
Hi, Im experimenting an error using mssql library for nodejs. I am using PoolConnection from mssql. The app Im running simply connects to...
Read more >
Acess SQL server Data in node js/Failed to connect ... - YouTube
This is the video to get SQL Server data using node.js and also in this video you will see the solution of below...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found