dbcli / mssql-cli

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

mssql-cli broken on latest Windows update--'The system cannot find the file specified.' #437

Closed G0erman closed 4 years ago

G0erman commented 4 years ago

I just connected to a server successful with some specific port:

mssql-cli -S server_name,port -U user -P password

But when I try to launch some query, I get the next message:

XXX> select 4+4;
Time: 0.451s
The system cannot find the file specified.

mssql-cli version: 0.18.1

altafub commented 4 years ago

I have the same issue on new servers.

master> select name from sys.databases Time: 0.555s The system cannot find the file specified.

I am using pip install command to install the utility. Tried to install 0.18.0 on the same machine. It uninstalled 0.18.1 first and installed the supplied version. But that doesn't seem to help.

jvillegas74 commented 4 years ago

I have the same issue. whatever I do I get "The system cannot find the file specified."

ellbosch commented 4 years ago

@G0erman, @altafub, and @jvillegas74: what machine is everyone on? How was mssql-cli installed?

jvillegas74 commented 4 years ago

This is Windows 10 (x64). Running on a Surface Pro 4. Aso the same on a Dell XPS 15.

I have installed Phyton and then $pip install mssql-cli

ellbosch commented 4 years ago

This is Windows 10 (x64). Running on a Surface Pro 4. Aso the same on a Dell XPS 15

Thanks. What version of Python are you using? And do you experience the same issue on 0.18.0?

You may install a prior version by calling python -m pip install mssql-cli==0.18.0.

jvillegas74 commented 4 years ago

just tried with 0.18.0 and the same as the latest 0.18.1

Using Phyton 3.8.2

ellbosch commented 4 years ago

Can you call mssql-cli --version and let me know what you get? Thanks @jvillegas74, I want to rule out that your machine isn't still installing an older version, which has happened before.

jvillegas74 commented 4 years ago

I have tried with 0.18.1 (latest) and 0.18.0 as well as 0.17.0 . All of them same output

Anyway here is the output

Installing collected packages: mssql-cli Attempting uninstall: mssql-cli Found existing installation: mssql-cli 0.17.0 Uninstalling mssql-cli-0.17.0: Successfully uninstalled mssql-cli-0.17.0 Successfully installed mssql-cli-0.18.0

C:\WINDOWS\system32>mssql-cli --version Version: 0.18.0

jvillegas74 commented 4 years ago

@ellbosch Any workaround you might recommend ?

ellbosch commented 4 years ago

Unfortunately I'm still unable to repro this issue. However—it would help a lot if you could post your log file here (and a clean set of logs too would be great!).

The logfile is located at %LOCALAPPDATA%\dbcli\mssqlcli\mssqlcli.

jvillegas74 commented 4 years ago

mssqlcli.log

Here is a clean log

ellbosch commented 4 years ago

Thanks @jvillegas74. Some more questions:

jvillegas74 commented 4 years ago

@ellbosch I have installed for first time. I am using standard command line CMD (as regular user and as Administrator) image

ellbosch commented 4 years ago

Thanks. Can you please return the output for which mssql-cli? Perhaps there's a path issue...

jvillegas74 commented 4 years ago

Probably image not a Pyton expert

ellbosch commented 4 years ago

Probably image not a Pyton expert

Sorry I meant where mssql-cli. My apologies!!

jvillegas74 commented 4 years ago

here image

ellbosch commented 4 years ago

Thanks @jvillegas74. This doesn't look like a path issue.

Are you able to query this database with another tool? I want to ensure this error message is exclusive to mssql-cli and not an issue with your SQL Server instance.

If you don't have another tool installed, I'd recommend Azure Data Studio.

jvillegas74 commented 4 years ago

yes. I can connect to my localhost running SQL 2019 using SQLCMD, ADS and SSMS with no problem

ellbosch commented 4 years ago

Hmmm... are you possibly using Windows Auth instead of SQL @jvillegas74?

jvillegas74 commented 4 years ago

same thing using SQL Auth image

jvillegas74 commented 4 years ago

No problems with SQLCMD image

ellbosch commented 4 years ago

I wish I could repro this :( I'm so sorry this is happening, thanks for all of your help @jvillegas74.

Let me know if you're unblocked by using a really old version, say 0.15.0. If that still doesn't work then there's a good chance we've had this bug since the beginning. I'll keep digging in the meantime.

jvillegas74 commented 4 years ago

Is not the day today ! . this is after installing 0.15.0 image

ellbosch commented 4 years ago

This info still helps in any case! Good to know this bug exists, thanks @jvillegas74.

altafub commented 4 years ago

We use Windows 2016 ami provided by AWS. And 0.18.1 doesn't work with ami released after 11th Feb. So this has to be a windows update thing. @ellbosch

ellbosch commented 4 years ago

We use Windows 2016 ami provided by AWS. And 0.18.1 doesn't work with ami released after 11th Feb. So this has to be a windows update thing. @ellbosch

Interesting... @altafub are you also using a localhost db like @jvillegas74?

ellbosch commented 4 years ago

Confirmed this is caused by latest Windows update—I'm now able to repro this.

jvillegas74 commented 4 years ago

I can add that I just installed on a new Win 2016 Server (Azure VM) and got the same error connecting to localhost and remote server

jvillegas74 commented 4 years ago

@ellbosch Please share here or by email when the fix is available. looking forward to talk and demo about mssql-cli in my next presentation

ellbosch commented 4 years ago

@ellbosch Please share here or by email when the fix is available. looking forward to talk and demo about mssql-cli in my next presentation

Will do @jvillegas74, fixing this bug is our top priority.

ellbosch commented 4 years ago

Looks like one of our dependencies is the culprit. I'll update the thread when new official bits are out.

ellbosch commented 4 years ago

The fix is out! @jvillegas74 @altafub thanks so much for your help :)

altafub commented 4 years ago

@ellbosch thanks a ton for the prompt response and fixing this. I can confirm this is working now.

jvillegas74 commented 4 years ago

Thanks @ellbosch for the quick response !! is working great now

jvillegas74 commented 4 years ago

thanks @ellbosch for the quick response. it works great !! which will be the right way to update ?

Alse the installation guide link from the doc is broken https://docs.microsoft.com/en-us/sql/tools/mssql-cli?view=sql-server-ver15

ellbosch commented 4 years ago

@jvillegas74 you may view installation docs here: https://github.com/dbcli/mssql-cli/tree/master/doc/installation

Thanks for letting us know about the docs!

ellbosch commented 4 years ago

The Microsoft Docs page is now fixed.