SQL Express connection timeout

Dejan Lazarevic 1 Reputation point
2022-01-03T14:22:54.18+00:00

HI,

I am trying to connect to SQL Express databases and I am running into a timeout error. SQL on Server 1 can't connect to SQL on Server 2 but SQL on Server 2 can connect to SQL on Server 1. The firewall is disabled on both servers. SQL on Server 1 can detect SQL on Server 2.

Error message :
"Connection Timeout Expired. The timeout period elapsed while attempting to consume the pre-login handshake acknowledgement. This could be because the pre-login handshake failed or the server was unable to respond back in time. The duration spent while attempting to connect to this server was - [Pre-Login] initialization=16504; handshake=0; (.Net SqlClient Data Provider)


For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft%20SQL%20Server&EvtSrc=MSSQLServer&EvtID=-2&LinkId=20476


Server Name: 10.75.30.10\SQLEXPRESS
Error Number: -2
Severity: 11
State: 0 "

SQL Server
SQL Server
A family of Microsoft relational database management and analysis systems for e-commerce, line-of-business, and data warehousing solutions.
13,670 questions
{count} votes

2 answers

Sort by: Most helpful
  1. Erland Sommarskog 110.3K Reputation points
    2022-01-03T22:49:04.997+00:00

    Are you able to connect to the SQL Server instance locally?

    The error you get is typically the one you get when you have run out of worker threads, but in that case, you should not able to connect locally either, I think.

    If you can connect locally, what does

    sp_configure 'user connections'
    

    report for the third and fourth columns? Anything but 0 is suspect!

    What about this one:

    SELECT * FROM sys.dm_os_wait_stats WHERE wait_type = 'THREADPOOL'
    

    What are the values on both instances?

    0 comments No comments

  2. YufeiShao-msft 7,116 Reputation points
    2022-01-04T02:45:43.237+00:00

    HI @Dejan Lazarevic ,

    There is a document on timeout expiration: Troubleshooting: Timeout Expired

    Please check if the TCP/IP port for the Database Engine instance is blocked by a firewall
    The client and server are not configured to use the same network protocol.
    The server name was typed incorrectly
    and so on

    Here are solutions to some of the typical errors mentioned above: How to solve “Connection Timeout Expired pre-login handshake SQL Server”

    -------------

    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.