Skip to content
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

mssql: SQL Tools Service component could not start #17739

Open
sfannfcs opened this issue Jul 11, 2023 · 22 comments
Open

mssql: SQL Tools Service component could not start #17739

sfannfcs opened this issue Jul 11, 2023 · 22 comments

Comments

@sfannfcs
Copy link

  • MSSQL Extension Version:1.19.1
  • VSCode Version:1.79.2
  • OS Version:Windows 10

Steps to Reproduce:

1.Start VSC
2.

@sfannfcs
Copy link
Author

error messages we got:
[Info - 9:12:07 AM] Connection to server got closed. Server will restart.
[Info - 9:12:08 AM] Connection to server got closed. Server will restart.
[Info - 9:12:09 AM] Connection to server got closed. Server will restart.
[Info - 9:12:10 AM] Connection to server got closed. Server will restart.
[Error - 9:12:11 AM] Connection to server got closed. Server will not be restarted.

The AzureResourceProvider server crashed 5 times in the last 3 minutes. The server will not be restarted.

mssql: SQL Tools Service component could not start.

@mister0822
Copy link

I have this issue as well. Does anyone have any steps to help identify what is causing the SQL Tools Service to not start? The issue is not present on 1.12.0. The service works successfully. This error is displayed with every version after, including the current. I have not found any clues in the extension log files.

@cheenamalhotra
Copy link
Member

Can you wrap up extension logs by following below steps:

  • Enable verbose logs by setting: mssql.tracingLevel to All
  • Reload/Restart VS Code
  • Let extension load and STS component fail.
  • Run command: Developer: Open Logs Folder
  • Navigate to window (latest copy) > exthost
  • Copy 2 folders from here:
    • ms-mssql.mssql
    • output_logging_xxx (latest - clean up any unrelated logs from here if needed)

Upload the 2 folders here along with version info.

@mister0822
Copy link

mister0822 commented Jul 17, 2023

Thank you for the response. I have followed the listed steps. ms-mssql.mssql does not exist. Attached is the output_logging folder.
logs_7_17_2023.zip

Before I sent this, I let it upgrade to 1.19.1. VSCode is 1.80.0

@clouddots-ben
Copy link

I'm having a similar issue. I'm on Windows 11 and installed 1.19.1. but was unable to make a new connection and received error command 'mssql.addObjectExplorer' not found. I uninstalled/removed files from /.vscode/extensions removed the cache from roaming and restarted the machine. Same error. After some googling, I realized that the 64 bit installation of 1.19.1 didn't have the sqltoolsservice included. I tried manually added the service and then I tried installing the x84 version. It included the sqltoolsservice, but I still had the same error of command not found.

@damonripper
Copy link

Same issue. I see following in output window

Failed to load the dll from [c:\Users\dclark\.vscode\extensions\ms-mssql.mssql-1.19.1\sqltoolsservice\4.7.1.6\Windows\coreclr.dll], HRESULT: 0x800700C1
[Info  - 2:15:26 PM] Connection to server got closed. Server will restart.
Failed to load the dll from [c:\Users\dclark\.vscode\extensions\ms-mssql.mssql-1.19.1\sqltoolsservice\4.7.1.6\Windows\coreclr.dll], HRESULT: 0x800700C1
[Info  - 2:15:26 PM] Connection to server got closed. Server will restart.
Failed to load the dll from [c:\Users\dclark\.vscode\extensions\ms-mssql.mssql-1.19.1\sqltoolsservice\4.7.1.6\Windows\coreclr.dll], HRESULT: 0x800700C1
[Info  - 2:15:26 PM] Connection to server got closed. Server will restart.
Failed to load the dll from [c:\Users\dclark\.vscode\extensions\ms-mssql.mssql-1.19.1\sqltoolsservice\4.7.1.6\Windows\coreclr.dll], HRESULT: 0x800700C1
[Info  - 2:15:27 PM] Connection to server got closed. Server will restart.
Failed to load the dll from [c:\Users\dclark\.vscode\extensions\ms-mssql.mssql-1.19.1\sqltoolsservice\4.7.1.6\Windows\coreclr.dll], HRESULT: 0x800700C1
[Error - 2:15:27 PM] Connection to server got closed. Server will not be restarted.

@mister0822
Copy link

Read a thread where 1.18.0 might work better. Confirmed that 1.18.0 gives the same error as [sfannfcs] posted above.

@mister0822
Copy link

I see the tag needs more info. Just confirming if there is anything further I can do or provide. Thank you.

@mister0822
Copy link

Thanks @cheenamalhotra. We will re-test once the fix above is included in a new release.

@mister0822
Copy link

Tested on 1.20.1 and the same issue persists. Output includes:

[Info - 2:17:46 AM] Connection to server got closed. Server will restart.
[Info - 2:17:47 AM] Connection to server got closed. Server will restart.
[Info - 2:17:48 AM] Connection to server got closed. Server will restart.
[Info - 2:17:50 AM] Connection to server got closed. Server will restart.
[Error - 2:17:51 AM] Connection to server got closed. Server will not be restarted.

mssql: SQL Tools Service component could not start.

Source: SQL Server (mssql) (Extension)

@EdCallahan
Copy link

EdCallahan commented Aug 8, 2023

@mister0822 Do you have a proxy configured in your settings.json? If so, you could try and remove those lines; VSCode will rely on your OS proxy settings in most cases.

See:
#17772 (comment)
https://code.visualstudio.com/docs/setup/network#_proxy-server-support

Only thinking it might be proxy related since 1.20.1 was supposed to help you, and that was an attempted fix re proxy issues.

@sfannfcs
Copy link
Author

sfannfcs commented Aug 8, 2023

With mssql extension 1.20.1, I have tried all options of proxy support (on, off, fallback, override). exact same error I got:

[Info - 2:28:16 PM] Connection to server got closed. Server will restart.
[Info - 2:28:17 PM] Connection to server got closed. Server will restart.
[Info - 2:28:18 PM] Connection to server got closed. Server will restart.
[Info - 2:28:18 PM] Connection to server got closed. Server will restart.
[Error - 2:28:19 PM] Connection to server got closed. Server will not be restarted.

@cheenamalhotra
Copy link
Member

cheenamalhotra commented Aug 8, 2023

@sfannfcs

Does manual downloading help resolve the issue?

  1. Download https://github.com/Microsoft/sqltoolsservice/releases/download/4.8.1.2/microsoft.sqltools.servicelayer-win-x64-net7.0.zip
  2. Extract the content to C:\Users\<user>\.vscode\extensions\ms-mssql.mssql-1.20.1\sqltoolsservice\4.8.1.2\Windows
  3. Restart VS Code

@sfannfcs
Copy link
Author

sfannfcs commented Aug 9, 2023

@sfannfcs

Does manual downloading help resolve the issue?

  1. Download https://github.com/Microsoft/sqltoolsservice/releases/download/4.8.1.2/microsoft.sqltools.servicelayer-win-x64-net7.0.zip
  2. Extract the content to C:\Users\<user>\.vscode\extensions\ms-mssql.mssql-1.20.1\sqltoolsservice\4.8.1.2\Windows
  3. Restart VS Code

Thanks @cheenamalhotra,
the manual downloading didn't resolve the issue. I got the same error.

@damonripper
Copy link

Just wanted to report that I am no longer seeing the issue :)

@cheenamalhotra
Copy link
Member

Thanks @cheenamalhotra, the manual downloading didn't resolve the issue. I got the same error.

Couple of thing to try (in order):

  • Is there any background process running on the machine that's stopping this extension to load? Try cleaning out any SQLTools/NodeJS related processes if they are running at all.. and restart machine.
  • Have you tried updating VS Code to latest 1.80?
  • Can you try installing .NET runtime if this helps?
  • Try another machine/VM? I wonder if vscode cache is just in a bad state on your machine..

@mister0822
Copy link

@cheenamalhotra
I work with @sfannfcs and I am doing the same testing on a different VDI. All VDI machines have this issue. My laptop does not and all the versions of the extensions start properly. VS Code is 1.80. I don't see any processes conflicting, but starting to think this has to be the issue. I did not see any SQLTools/NodeJS related processes. I did try to install the .net runtime. I do see .NET errors in the windows application logs:

.NET runtime events with 1022 event ID, and the following event log message: Failed to CoCreate profiler.

This error appears over and over.

Thank you for your suggestions.

@cheenamalhotra
Copy link
Member

cheenamalhotra commented Aug 10, 2023

That's interesting! How are these VDI machines hosted and what installer are you using to install VS Code (User/System/Zip)?
I just tested on a Hyper-V virtual machine (Windows 10) with user installer - and it worked fine without any issues.

Not sure if this applies to you, here're one solution I found that can be tried: https://www.ibm.com/docs/en/tcamfma/6.3.0?topic=workarounds-net-data-collector-event-1022

@sfannfcs
Copy link
Author

@cheenamalhotra,
cc: @mister0822

Here is our VDI system info. I tried both VSC installers (user/system), both of them have the same issue.
VDI-Info

I checked my VDI event log and did find the .NET Runtime issue (Event ID 1022) as mentioned in your link. Here is the error message from the event log: 'NET Runtime version 4.0.30319.0 - Loading profiler failed during CoCreateInstance. Profiler CLSID: '{DA7CFC47-3E35-4c4e-B495-534F93B28683}'. HRESULT: 0x80070241. Process ID (decimal): 11616. Message ID: [0x2504].'

I will try the workaround solution.

@mister0822
Copy link

Any further information we can provide?

@mister0822
Copy link

Just checking if there is new information.

@Watertight-skaat
Copy link

Watertight-skaat commented Nov 15, 2023

I'm now currently getting this.
image
Logs.zip

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants