msphpsql: Randomly getting error code 0x2746 on connect
PHP Driver version or file name
5.8.0
SQL Server version
2016 Enterprise SP2 2012 Enterprise SP4 (Availability Group)
Client operating system
RHEL 7.5
PHP version
PHP 7.2.27
Microsoft ODBC Driver version
msodbcsql17-17.5.1.1 Also occured with 17.4
Problem description
The connection randomly fails with error code 0x2746. An estimated 5% of connections fail, the rest succeeds. This problem started with the last wave of Windows updates, though we weren’t able to pinpoint the exact update.
Debug:
sqlsrv.LogSubsystems = -1
sqlsrv_connect: entering
sqlsrv_connect: SQLSTATE = 08001
sqlsrv_connect: error code = 10054
sqlsrv_connect: message = [Microsoft][ODBC Driver 17 for SQL Server]TCP Provider: Error code 0x2746
sqlsrv_connect: SQLSTATE = 08001
sqlsrv_connect: error code = 10054
sqlsrv_connect: message = [Microsoft][ODBC Driver 17 for SQL Server]Client unable to establish connection
sqlsrv_errors: entering
PHP_RSHUTDOWN for php_sqlsrv: entering
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Comments: 17 (4 by maintainers)
Related: https://support.microsoft.com/en-us/help/4557473/errors-when-applications-try-to-connect-to-sql-server-in-windows
Apparently this has been fixed in the latest Windows 10 and Windows Server 2016 updates.
Over the weekend we found the issue also exists with other encrypted connections to Windows systems so I suspect an underlying issue with different TLS versions. At least that’s what the Windows event log suggests.
I’ll update the issue when I get new information as soon as I can verify them.
You may get more relevant answers here -> https://social.msdn.microsoft.com/Forums/sqlserver/en-US/home
You realize I’m not with Microsoft but the issue creator, right? Besides, since this issue is related to cipher suites this would be the wrong place to address it anyway.
I don’t agree that it should be closed considering people are having the issue EVEN WITH the applicable cipher suites enabled. But hey - I guess that’s par for the MS course… Don’t try to replicate it in a lab or anything… Don’t engage or reach out to others who have experiences contrary to the proposed solution. Just close the issue… /unimpressed.
As of now it looks like the problem does not occur on Windows Server 2016 but only on 2012 R2. Maybe on older versions, too, but I cannot verify that.