Could not connect (sequence) - ESOCKET
See original GitHub issueHi, 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:
- Created 3 years ago
- Comments:19 (8 by maintainers)
Top 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 >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

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!
No worries, happy to help 😄
The
SENT_TLSSSLNEGOTIATIONis 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 arequestwhile the driver is not yet connected to the server.