-
Notifications
You must be signed in to change notification settings - Fork 374
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Connection Timeout, Driver Crash on Windows #1140
Comments
Hi @elton182 in Windows, connection pooling is enabled by default. Did you change the default connection resiliency settings? Also, please check your network trace and compare to those in this support article |
No I didn't changed the connection resiliency, I didn't even know it existed until the problem arise. I get to write a simple code that generates de error:
With this code the error shows on the 393 count always, and if a do a simple reconnect, it works again. This is the error the above scripts throws.
|
Have you checked the support article in my first reply, @elton182 ? |
Hi @yitam I've checked with the system admin and he told me that both servers are Windows 2019 that already has the update that fix the issue. |
Hi @elton182 , please check SQL Server Error log and Windows event log as explained in this article. Do you set You might also try using connection resiliency by changing the default values for For example, something like this |
Any update @elton182 ?
Can you provide some examples of your queries? Do you connect and disconnect for each select, insert or update requests?
Does this disconnect before connecting again? |
@yitam I've used an script direct with PHP doing queries and the error doesnt come out. |
Ok thanks @elton182. Please keep us posted. |
@yitam I noticed that laravel uses PDO to connect to MSSQL, and on my tests with php direct I've used sqlsrv_connect. I think it may be something releated to PDO. |
@elton182 can you try the same with our pdo_sqlsrv directly? |
@yitam I confirmed my hypotheses. With the script below, which connects directly to the database with PHP throught PDO, it throws the error after 393 queries. It is basically the same script that I am using in the laravel example.
Error:
|
@yitam can I do anything else to test this? |
Hi @elton182 the repro script helps and let me do some investigation first. I'll get back to you on this. |
Hi @elton182 I can't reproduce this on my side. I've tried SQL Servers on premise and in the local network. I tested up to 3000 times. I've also tested connecting to Azure SQL Server, as shown below. Have you tried doing something similar using Management Studio? For example:
As I mentioned above, please provide SQL Server Error log, Windows event log, SQL Profiler trace and/or ODBC trace if possible. FYI, I copied and pasted one of the answers from this page: This problem can be caused by a lot of network issues including but not limited to:
|
@yitam I've tried on a sqlserver express on my localhost and it doesn't happens. I'll test direct on a sqlserver client like Managment Studio and others and get the logs you asked. |
Any update, @elton182 ? |
Hi @yitam. I've tried on the Managment Studio and it works normal. Today I've noticed a new error:
I'm still thinking this is related to the PDO driver somehow. |
Hi @elton182 please do check the logs as this is more like an issue with the server or network rather than the driver, as explained in this issue discussion. That said, please also check this forum and see if you find anything useful. |
Closing this due to inactivity, @elton182 . Please feel free to reopen this issue when you have logs and/or traces for us to investigate the problem. |
PHP Driver version or file name
php_pdo_sqlsrv-5.8.1-7.2-nts-vc15-x86
SQL Server version
Microsoft SQL Server 2017 (RTM) - 14.0.1000.169 (X64)
Aug 22 2017 17:04:49
Copyright (C) 2017 Microsoft Corporation
Standard Edition (64-bit) on Windows Server 2019 Standard 10.0 (Build 17763: ) (Hypervisor)
Client operating system
Windows server 2019 datacenter
PHP version
7.2.20
Microsoft ODBC Driver version
17.5.2.1
Problem description
It is like issue 678 or 762
The diference is tha I got a totally windows environment where after a lot of queries in a single request. After 30 or so find/insert/updates in sequence the conection closes at the driver level and it doesn't reconnect.
SQLSTATE[IMC06]: [Microsoft][ODBC Driver 17 for SQL Server]A conexão foi desfeita e a recuperação não é possível. A conexão está marcada pelo driver do cliente como não recuperável. Não houve nenhuma tentativa de restaurar a conexão. {"exception":"[object] (PDOException(code: IMC06): SQLSTATE[IMC06]: [Microsoft][ODBC Driver 17 for SQL Server]A conexão foi desfeita e a recuperação não é possível. A conexão está marcada pelo driver do cliente como não recuperável. Não houve nenhuma tentativa de restaurar a conexão.
The text was updated successfully, but these errors were encountered: