Skip to content
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 #33156

Closed
elton182 opened this issue Jun 8, 2020 · 3 comments
Closed

Connection Timeout, Driver Crash on Windows #33156

elton182 opened this issue Jun 8, 2020 · 3 comments

Comments

@elton182
Copy link

elton182 commented Jun 8, 2020

  • Laravel Version: 5.8

  • PHP Version: 7.2.20

  • Database Driver & Version: SQL Server 2019

  • 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

Description:

I got this case where after a series of find/update/inserts on a SQLSRV database, the connection shutsdown, close or some other error.

After a series of tries, I found that if I do a simple DB::reconnect() after the error, the connection works again, so I don't know if is driver related issue or from the framework.

I opened this issue on the msphpsql too, but I think that maybe this problem insn't there. microsoft/msphpsql#1140

Some of the errors:

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.

Steps To Reproduce:

I get to write a simple code that generates de error:

 $n =0 ; while($n <=1000) { Transportadora::limit(1)->get(); echo $n . "\n" ; $n++; }

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.

Illuminate/Database/QueryException with message 'SQLSTATE[08S01]: [Microsoft][ODBC Driver 17 for SQL Server]Provedor TCP: An existing connection was forcibly closed by the remote host.
 (SQL: select top 1 * from [Transportadora])'
https://github.com/microsoft/msphpsql/issues/1140
@driesvints
Copy link
Member

Hey there,

Unfortunately we don't support this version anymore. Please check out our support policy on which versions we are currently supporting. Can you please try to upgrade to the latest version and see if your problem persists? We'll help you out and re-open this issue if so.

Thanks!

@elton182
Copy link
Author

elton182 commented Jun 9, 2020

I've updated the project to laravel 6.0 and the problem still happens.

I've tried a simple script in pure php and it didn't throw the error.

@driesvints
Copy link
Member

@elton182 this honestly looks like a network problem

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants