dbcli / mssql-cli

A command-line client for SQL Server with auto-completion and syntax highlighting
BSD 3-Clause "New" or "Revised" License
1.35k stars 192 forks source link

type object 'ConnectionRequest' has no attribute 'owner_uri' #501

Closed sbreakey closed 3 years ago

sbreakey commented 3 years ago

Just installed mssql-cli for the first time, and I am seemingly unable to connect to my DB. Please note that sqlcmd DOES connect to the DB and I am able to query it. Also note, if I omit the --enable-sqltoolsservice-logging argument, the tool provides no output and seemingly hangs.

OS: MacOS Catalina 10.15.7 Python 2.7.16

~ mssql-cli -S 192.168.0.10 -U someuser -P somepass --enable-sqltoolsservice-logging

Unhandled Exception: System.NullReferenceException: Object reference not set to an instance of an object.
   at Microsoft.SqlTools.Utility.Logger.Close() in D:\a\1\s\src\Microsoft.SqlTools.Hosting\Utility\Logger.cs:line 79
   at Microsoft.SqlTools.ServiceLayer.Program.Main(String[] args) in D:\a\1\s\src\Microsoft.SqlTools.ServiceLayer\Program.cs:line 27
Traceback (most recent call last):
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/runpy.py", line 174, in _run_module_as_main
    "__main__", fname, loader, pkg_name)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/runpy.py", line 72, in _run_code
    exec code in run_globals
  File "/Library/Python/2.7/site-packages/mssqlcli/main.py", line 122, in <module>
    main()
  File "/Library/Python/2.7/site-packages/mssqlcli/main.py", line 115, in main
    run_cli_with(mssqlcli_options)
  File "/Library/Python/2.7/site-packages/mssqlcli/main.py", line 52, in run_cli_with
    mssqlcli.connect_to_database()
  File "/Library/Python/2.7/site-packages/mssqlcli/mssql_cli.py", line 278, in connect_to_database
    owner_uri, error_messages = self.mssqlcliclient_main.connect_to_database()
  File "/Library/Python/2.7/site-packages/mssqlcli/mssqlcliclient.py", line 91, in connect_to_database
    owner_uri, error_messages = self._execute_connection_request_with(connection_params)
  File "/Library/Python/2.7/site-packages/mssqlcli/mssqlcliclient.py", line 180, in _execute_connection_request_with
    response = connection_request.get_response()
  File "/Library/Python/2.7/site-packages/mssqlcli/jsonrpc/contracts/request.py", line 67, in get_response
    return self.response_error(error)
  File "/Library/Python/2.7/site-packages/mssqlcli/jsonrpc/contracts/connectionservice.py", line 22, in response_error
    u'ownerUri': cls.owner_uri,
AttributeError: type object 'ConnectionRequest' has no attribute 'owner_uri'
sbreakey commented 3 years ago

Running / installing from source works.

mingrw commented 3 years ago

how you solve the issue?

dmitry-mightydevops commented 3 years ago

Same issue :) Same question as @sbreakey

dmitry-mightydevops commented 3 years ago

@mingrw https://github.com/dotnet/core/issues/1930

So for me I'm running fedora, and

sudo dnf remove compat-openssl

fixed the issue

leonqli commented 2 years ago

I don't have root permission to remove compat-openssl.. Any other solution? Thanks!