Getting Timeout Error[258] Unable to complete login process due to delay in prelogin response.

@umesh 0 Reputation points
2023-04-02T19:17:10.34+00:00

Restored a TFS Database in CUS region in Azure SQL VM. Not able to connect to database from Client machine which is an on-prem machine.

Getting the following error when using SQLCMD utility:

Sqlcmd: Error: Microsoft ODBC Driver 17 for SQL Server : TCP Provider: Timeout error [258]. .

Sqlcmd: Error: Microsoft ODBC Driver 17 for SQL Server : Login timeout expired.

Sqlcmd: Error: Microsoft ODBC Driver 17 for SQL Server : Unable to complete login process due to delay in prelogin response.

    • Firewall is working as expected, port 1433 is open to the Client connections.
    • Tried sqlcmd with -C also to accept the Certificate from server, still getting the same error.
    • Able to connect DB using SQLCMD / SSMS on the local server, not working from the client server.
  • telnet is working from client machine to server on port 1433
  • Ping is also working from client machine.
    • SQL Server version 2019
    • Resource Type - SQL virtual machine
  • "Allow remote connections to this server" is enabled

Information related to Azure SQL VM:

  • Resource type - SQL Virtual Machine
  • SQL Connectivity - Private (within Virtual Network)
  • Port - 1433
  • SQL Authentication: Enabled
  • AZURE AD AUTHENTICATION - Not available on Developer Edition
  • Public IP Address - No
  • Private IP Address - Yes

Any help is appreciated.

Thanks in advance.

SQL Server on Azure Virtual Machines
Azure SQL Database
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Erland Sommarskog 102.3K Reputation points
    2023-04-02T19:46:04.0166667+00:00

    What type of login are you trying to use? This error about "delay in prelogin response" often indicates that there is a problem in the connection to the AD if you are on on-prem and you are using Windows Authentication.

    Two things to test:

    1. Test logging in with SQL authentication. (Which does not require connection to other resources).
    2. Increase the login timeout with the -l option. (Default is 15 seconds).