{"action":"created","issue":{"url":"https://api.github.com/repos/Microsoft/msphpsql/issues/730","repository_url":"https://api.github.com/repos/Microsoft/msphpsql","labels_url":"https://api.github.com/repos/Microsoft/msphpsql/issues/730/labels{/name}","comments_url":"https://api.github.com/repos/Microsoft/msphpsql/issues/730/comments","events_url":"https://api.github.com/repos/Microsoft/msphpsql/issues/730/events","html_url":"https://github.com/Microsoft/msphpsql/issues/730","id":308856016,"number":730,"title":"Sporadic: SQLSTATE[HYT00]: [unixODBC][Microsoft][ODBC Driver 17 for SQL Server]Login timeout expired","user":{"login":"lukeify","id":5379845,"avatar_url":"https://avatars1.githubusercontent.com/u/5379845?v=4","gravatar_id":"","url":"https://api.github.com/users/lukeify","html_url":"https://github.com/lukeify","followers_url":"https://api.github.com/users/lukeify/followers","following_url":"https://api.github.com/users/lukeify/following{/other_user}","gists_url":"https://api.github.com/users/lukeify/gists{/gist_id}","starred_url":"https://api.github.com/users/lukeify/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lukeify/subscriptions","organizations_url":"https://api.github.com/users/lukeify/orgs","repos_url":"https://api.github.com/users/lukeify/repos","events_url":"https://api.github.com/users/lukeify/events{/privacy}","received_events_url":"https://api.github.com/users/lukeify/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":6,"created_at":"2018-03-27T07:44:50Z","updated_at":"2018-03-30T06:04:24Z","closed_at":null,"author_association":"NONE","body":"## Problem description\r\nI am aware of issue #679, however, that seems to relate to a persistent login timeout, whereas my login timeouts issue is only sporadic. Maybe 1 in 5 queries will result in the error present in the title, additionally, query results are often extremely slow; which makes even something like development an unliveable environment.\r\n\r\nI'm running Laravel 5.6 on a Homestead instance with a full provisioning configuration provided below. My post-provision file which should give an idea of the setup involved.\r\n\r\n```\r\n# https://docs.microsoft.com/en-us/sql/linux/quickstart-install-connect-ubuntu\r\n# https://askubuntu.com/questions/930712/installation-problems-with-ms-sql-server-for-linux/945957\r\n\r\n# Include bash configuration variables\r\n. /home/vagrant/code/configuration.sh\r\n\r\n# Add\r\ncurl https://packages.microsoft.com/keys/microsoft.asc --silent | sudo apt-key add -\r\nsudo add-apt-repository \"$(curl https://packages.microsoft.com/config/ubuntu/16.04/mssql-server-2017.list)\"\r\nsudo apt-get update -q\r\n\r\n# Downgrade OpenSSL to 1.0.2 for MSSQL\r\nsudo apt-get install -o Dpkg::Options::=\"--force-confnew\" openssl=1.0.2g-1ubuntu4.10 -y --allow-downgrades\r\nsudo apt-get install mssql-server -y\r\n\r\n# Setup MSSQL\r\nsudo MSSQL_PID=Express ACCEPT_EULA=Y MSSQL_SA_PASSWORD=\"$mssql_sa_pw\" /opt/mssql/bin/mssql-conf -n setup\r\n\r\n# Add MSSQL tooling\r\nsudo add-apt-repository \"$(curl https://packages.microsoft.com/config/ubuntu/16.04/prod.list)\"\r\nsudo ACCEPT_EULA=Y apt-get install -y mssql-tools unixodbc-dev\r\n\r\n# Add MSSQL tooling to our path\r\nsudo ln -s /opt/mssql-tools/bin/* /usr/local/bin\r\n\r\n# Create our database\r\nsqlcmd -S localhost -U SA -P \"$mssql_sa_pw\" -Q \"CREATE DATABASE $mssql_db_database\"\r\n\r\n# Follow configuration for PHP (from step 3, as above commands covered prior steps regardless)\r\n# https://github.com/Microsoft/msphpsql\r\nsudo pear config-set php_ini `php --ini | grep \"Loaded Configuration\" | sed -e \"s|.*:\\s*||\"` system\r\n\r\n# Install SQL Server PECL extensions\r\nsudo pecl install sqlsrv-5.2.0RC1\r\nsudo pecl install pdo_sqlsrv-5.2.0RC1\r\n\r\n# Include in configuration\r\necho \"extension=sqlsrv.so\" | sudo tee --append /etc/php/7.2/fpm/php.ini\r\necho \"extension=pdo_sqlsrv.so\" | sudo tee --append /etc/php/7.2/fpm/php.ini\r\n```\r\n\r\n## Driver version or file name\r\nNot sure how to find this. Tell me how and I will add.\r\n\r\n## SQL Server version\r\nNot sure how to find this. Tell me how and I will add.\r\n \r\n ## Client operating system\r\nUbuntu 16.04.4 LTS (GNU/Linux 4.4.0-116-generic x86_64)\r\n \r\n## PHP version\r\nPHP 7.2 / 5.2.0RC1 pdo-sqlsrv, 5.2.0 sqlsrv.\r\n\r\n## Microsoft ODBC Driver version\r\nODBC Driver 17 for SQL Server / `unixodbc` / `msodbcsql17` (version 17.0.1.1-1)\r\n\r\n ## Expected behavior and actual behaviour\r\n\r\nNo login timeouts. Instead, I get sporadic login timeouts as described above.\r\n\r\n ## Repro code\r\n\r\nSporadic, but even simple queries made by Eloquent  such as `SELECT * FROM `items`` can result in a failure. I don't use the `sqlcmd` command line tool all that often, so I cannot determine if this is a PDO driver issue."},"comment":{"url":"https://api.github.com/repos/Microsoft/msphpsql/issues/comments/377453536","html_url":"https://github.com/Microsoft/msphpsql/issues/730#issuecomment-377453536","issue_url":"https://api.github.com/repos/Microsoft/msphpsql/issues/730","id":377453536,"user":{"login":"david-puglielli","id":19806314,"avatar_url":"https://avatars1.githubusercontent.com/u/19806314?v=4","gravatar_id":"","url":"https://api.github.com/users/david-puglielli","html_url":"https://github.com/david-puglielli","followers_url":"https://api.github.com/users/david-puglielli/followers","following_url":"https://api.github.com/users/david-puglielli/following{/other_user}","gists_url":"https://api.github.com/users/david-puglielli/gists{/gist_id}","starred_url":"https://api.github.com/users/david-puglielli/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/david-puglielli/subscriptions","organizations_url":"https://api.github.com/users/david-puglielli/orgs","repos_url":"https://api.github.com/users/david-puglielli/repos","events_url":"https://api.github.com/users/david-puglielli/events{/privacy}","received_events_url":"https://api.github.com/users/david-puglielli/received_events","type":"User","site_admin":false},"created_at":"2018-03-30T06:04:24Z","updated_at":"2018-03-30T06:04:24Z","author_association":"MEMBER","body":"@luiz-luxfacta Could you clarify, does the problem happen intermittently, or does it happen whenever you try to connect? Do you get the same behaviour when connecting with sqlcmd?\r\n\r\n@ChrisBachi You are trying to connect to a named instance, so you need to specify the port number. Try\r\n```\r\n./sqlcmd -S myserver\\myinstance,1433 -U sa -P mypassword\r\n```\r\n1433 is the default port, replace it if appropriate for your configuration. For more information, see issues #442 and #470, and [this page](https://docs.microsoft.com/en-us/sql/connect/odbc/linux-mac/connection-string-keywords-and-data-source-names-dsns)."}}
{"actor":{"display_login":"david-puglielli"}}