-
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
Irregular - Sqlcmd: Error: Microsoft ODBC Driver 13 for SQL Server : Login timeout expired. Only from linux #468
Comments
Hi @stefankaifer, this sounds like a network issue - the function that returns that particular error message reads TDS packets. Have you tried using wireshark or netcat to identify the problem? |
Hi @david-puglielli, sorry, but I can't explain that (network issue). Why?
Please see the Line No. 29314-29325. in the first lines are everything OK, but in the last not. Same ports. Why can I see the errors (No. 29322-29325) in Wireshark, if I've a network problem? I think, that the problem is on SQL-side, or not? Regards, Stefan |
You're getting RST responses, so the linux client is refusing packets from the server. My guess is a configuration issue on the client side. I would try running wireshark on the client. Also, does the problem happen if you try connecting with isql (from unixODBC) instead of sqlcmd? |
@stefankaifer Please run the bash script you wrote above using When a failure occurs, inspect the timestamps and look for any backward jumps. We suspect there is a bug in the way the ODBC driver calculates clock time - it may jump backwards occasionally, possibly right when sqlcmd disconnects. Please let us know if you observe this behaviour. |
@david-puglielli thanks! I'm capturing on the linux-client with tshark and I wrote a isql-script, too. Since yesterday there was no connection issue with isql, but with sqlcmd again! My isql-command: Here is a screenshot of the tshark-capture on the linux-client: Strace-command for the sqlcmd-script is running now:
I'm waiting for the next connection error... |
That will strace the /bin/bash, which won't log anything about sqlcmd. Instead, you should run strace on sqlcmd inside the script, and have the script exit the loop when sqlcmd fails. That way you will obtain the log of a failure only, and not spend huge amounts of disk space logging successful runs. |
Thanks, v-chojas. I've modified my script, but since two days I haven't any issues (==> no strace-log). It's very strange! |
Adding an odbc.ini file is not relevant to the problem I think. Please do keep us apprised of any further developments though! |
thanks, guys. I had the problem 2 or 3 times in the last days again. I've attached the strace-output. strace-2017-07-24-21-33-59.txt |
@stefankaifer I believe you are still using strace on bash, you must run it on sqlcmd inside the script. There doesn't seem to be anything unusual in the logs you have provided. |
@stefankaifer Have you had a chance to try strace on command as @david-puglielli suggested? |
@stefankaifer do you have any update on this? |
Hi guys, sorry for the late answer, but I had a lot of todos in the last weeks.
but I don't know, ho to do it right. Can someone modify my script, please?
|
You are running strace correctly - the problem is that the error happens only occasionally, so if you run strace only when an error occurs, the error will probably not occur again if you run the same command again under strace. What version of the ODBC driver are you using? I would suggest upgrading to version 17, available here. The bug that causes time to jump backwards has been fixed in version 17, so upgrading may solve your issue. |
@david-puglielli Thanks. I had version 13, now I've installed version 17 on my development system. I'm observing... |
Hi guys, I think, that with the current odbc-version (17) the problem is gone! I hadn't drops in the past 2 weeks. Stefan |
Glad we could help! You may also be interested to know, we will upload an updated ODBC driver 17 later this month as well. Closing the issue. |
@stefankaifer |
@jeff1985 I'm using no persistant connections. |
@david-puglielli I've tried upgrading to version 17 of the driver, but got:
Does that means that v17 is not supported with sqlsrv driver for PHP? or that is not finding the driver at all? Problem I'm getting is that after 2/3 minutes of the driver running correctly, I get timeout login for all of the connections (even if I try to reconnect again). Tried enabling pooling and increasing CPTimeout, but nothing helped. 😟 |
@pmartelletti Please try adding the Driver keyword to your connection string and specifying version 17, like this:
This will override the default ODBC driver version. |
@david-puglielli hmm.. I'm using:
how should I specify the version there? |
@david-puglielli sorry, just realised you were referring to the Changed it in all the locations that I could find:
to look something like this:
but still getting from PHP the following:
So seems like it's still trying to use the v13 of the driver. Any ideas? |
@david-puglielli is it possible that the PHP driver only works with the ODCB Driver 13, as per this list? Or that's just listing stable releases? https://docs.microsoft.com/en-us/sql/connect/php/system-requirements-for-the-php-sql-driver |
That page just lists stable releases. The latest preview (5.2.0-RC) supports ODBC 17. To use ODBC 17, instead of
in your PHP script. To make sure you are using a supported version of the drivers, run
from the command line and verify that |
Hi
I've a big problem with PHPSQLSRV, and SQLMCD on linux, too. We have irregular (mostly every 30-40 or X minutes) no connection to our SQL 2016 windows-server. This is the error message of sqlcmd:
I've created a BASH-script, that runs every 5 seconds SQLCMD:
I've created a POWERSHELL-Script, that runs on a Windows2012-server and on the SQL-Server:
This script runs every 5 seconds, too.
The irregular connection problems are only on the two linux-servers (same time are the problems!), not on the Windows2012-servers!
Linux-Webserver1 - 10.64.150.21, Ubuntu 16.04, msodbcsql 13.1.9.0-1, unixodbc 2.3.1-4.1, PHP7.1
Linux-Webserver2 - 10.64.150.22, Ubuntu 16.04, msodbcsql 13.1.9.0-1, unixodbc 2.3.1-4.1, PHP7.1
Windows-Webserver - 10.64.150.23, Windows 2012 R2, Powershell 5.0
SQLserver - 10.64.150.15, Windows 2012 R2, SQL 2016 Standard, Powershell 5.0
There are no activated firewalls on all of the servers. I'm connectiong over IP, not over DNS-name. All server are virtualized. We don't have any other connection problems or network problems. All the servers are in the same subnet. We have no problem by the connection from Windows-Webserver to the SQLserver, only between
Linux-Webserver1 -> SQLserver
and
Linux-Webserver2 -> SQLserver.
Please help me to solve problem.
Best regards
Stefan
The text was updated successfully, but these errors were encountered: