Jump to content

Lesson Learned #277: Failed to connect to xyz.database.windows.net:1433-Could not connect (sequence)


Recommended Posts

Guest Jose_Manuel_Jurado
Posted

We got an issue when our customer using Node.Js they got the following error message:

 

Failed to connect to xyz.database.windows.net:1433 - Could not connect (sequence)

at Connection.socketError (C:\...\tedious\lib\connection.js:1395:28)

at C:\...\tedious\lib\connection.js:1176:14

at processTicksAndRejections (node:internal/process/task_queues:78:11) {

code: 'ESOCKET', isTransient: undefined }

RequestError: Requests can only be made in the LoggedIn state, not the Connecting state

at Connection.makeRequest (C:\...\tedious\lib\connection.js:2204:24)

at Connection.execSql (C:\...\tedious\lib\connection.js:1734:10)

at executeStatement (C:\...\NodeJsVsCode\ConnectTest.js:104:16)

at Connection.<anonymous> (C:\....\NodeJsVsCode\ConnectTest.js:81:5)

at Connection.emit (node:events:390:28)

at Connection.emit (C:\...\tedious\lib\connection.js:1040:18)

at Connection.socketError (C:\...\tedious\lib\connection.js:1395:12)

at C:\....\tedious\lib\connection.js:1176:14

at processTicksAndRejections (node:internal/process/task_queues:78:11) {

code: 'EINVALIDSTATE', number: undefined, state: undefined, class: undefined, serverName: undefined, procName: undefined, lineNumber: undefined}

 

 

 

When we are connecting to Azure SQL Database we need to know that, depending on connectivity policy: proxy or redirect, we need to open as outbound (1433 for proxy) or (1433 and11000-12000 for redirect). See this link for more information.

 

 

 

Also, remember that the DNS needs to adjusted for this, when we are connecting using proxy we need to resolve the IP of our server, for example, xyz.database.windows.net, but, using redirect connection policy we are going to connect directely to the Azure SQL node that the name will be different and needs to be resolved - Lesson Learned #216: Hands-On-Labs: How redirect connection policy type works - Microsoft Community Hub

 

 

 

Enjoy!

 

Continue reading...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...