dbcli / dbcli/mssql-cli

Infinte loop on remote connection

Offen
#512 1 Kommentar 1 Reaktion 0 zugewiesene Personen Auf GitHub ansehen
Vorherrschende Sprache
Python
Sterne
1.4k
Forks
191
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beschreibung

Since I reinstalled my system to Debian 10 I can no longer connect to a remote `mssql` server.

When I try to connect to a remote server the process never ends (and utilizes 100% of one CPU thread). It produces following trace if killed by `^C`:
```
^CTraceback (most recent call last):
File "/usr/lib/python3.7/runpy.py", line 193, in _run_module_as_main
"__main__", mod_spec)
File "/usr/lib/python3.7/runpy.py", line 85, in _run_code
exec(code, run_globals)
File "/usr/local/lib/python3.7/dist-packages/mssqlcli/main.py", line 122, in
main()
File "/usr/local/lib/python3.7/dist-packages/mssqlcli/main.py", line 115, in main
run_cli_with(mssqlcli_options)
File "/usr/local/lib/python3.7/dist-packages/mssqlcli/main.py", line 52, in run_cli_with
mssqlcli.connect_to_database()
File "/usr/local/lib/python3.7/dist-packages/mssqlcli/mssql_cli.py", line 278, in connect_to_database
owner_uri, error_messages = self.mssqlcliclient_main.connect_to_database()
File "/usr/local/lib/python3.7/dist-packages/mssqlcli/mssqlcliclient.py", line 91, in connect_to_database
owner_uri, error_messages = self._execute_connection_request_with(connection_params)
File "/usr/local/lib/python3.7/dist-packages/mssqlcli/mssqlcliclient.py", line 188, in _execute_connection_request_with
time.sleep(time_wait_if_no_response)
KeyboardInterrupt
```
It seems infinite loop is in progress [here](https://github.com/dbcli/mssql-cli/blob/master/mssqlcli/mssqlcliclient.py#L188).

I tried mutliple versions of both `python3` and `python 2.7`, all with the same result.
Current versions:
* mssql-cli `1.0.0`
* Debian `10.9` (but the same occurred for `10.8` and `10.7` as well)
* Python `3.7.3` or `2.7.16` (again, the same occurred on all previously installed versions as well)
* Server version: `Microsoft SQL Server 2014 (SP2-GDR) (KB4019093) - 12.0.5207.0 (X64)`

I tried to install `mssql-cli` on the remote server and then I can connect normally. The same applies for local connections - these work OK as well.

The only specific I know of is that the remote server is only accessible via `PPTP` VPN. But this posed no problem before I reinstalled my system (it was Ubuntu 18.04).

Similarly I can connect to the remote database using all other means. For example, this simple script connects there OK as well:

```python
#!/usr/bin/python3
import pymssql
conn = pymssql.connect(
server='',
user='',
password='',
database='')
cursor = conn.cursor()
cursor.execute("""
SELECT id
FROM dbo.person
ORDER BY person.id DESC
;""")
row = cursor.fetchone()
i = 0
while row:
print(str(row[0]))
row = cursor.fetchone()
i += 1
if i > 50:
break
```
(This hints that neither the VPN nor particular OS or python versions are the cause of the problem IMHO)

I have searched the issues here (and using search engines) thoroughly but at no avail.

Please let me know if more debugging data have to be provided.

It is no april's fools joke :smiley:

Beitragsleitfaden

Für dieses Repository ist kein Beitragsleitfaden indexiert

Bewertung

Dieses Issue wurde noch nicht bewertet.

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.