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 not starting on latest VS Code Insider #718

Closed
MaximoTrinidad opened this issue Feb 23, 2017 · 50 comments
Closed
Assignees
Labels

Comments

@MaximoTrinidad
Copy link

  • MSSQL Extension Version: 0.2.1
  • VSCode Version: 1.10.0-insider 
  • OS Version: Windows 10 Pro Insider Preview Build 15007.rs_prerelease.170107-1846

Steps to Reproduce:

  1. Open VS Code in the SQL Script folder
  2. Error - mssql: SQL Tools Service component could not start.

FYI - This was working fine on previous VS Code Insider version. Now, it doesn't connect to my existing profiles.

vscodeinsidermssql_error_2017-02-23_14-29-00

@renkejr
Copy link

renkejr commented Feb 23, 2017

I am running into the same problem, with the same VS Code and extension versions on Windows 10 Pro, although I noticed it on the previous build as well.

@MaximoTrinidad
Copy link
Author

Yes! I upgraded this morning the VS Code-Insider and MSSQL extension stopped working.
:(

@kburtram
Copy link
Member

I'm seeing the same thing. I'll investigate now and see what we need to do to roll-out a fix.

@kburtram
Copy link
Member

It looks like the uri format of the textDocument/didOpen message has a breaking change where it is now prefixed with "git:/". Previously we where expecting this to be "file:/" and the new prefix isn't work with our file management code. We'll follow-up with VS Code team to find out if the change is intentional and if we need to take a fix on our side. The bold line in the payload below is causing the issue.

"textDocument/didOpen"

{ {
"textDocument": {
"uri": "git:/d%3A/xplat/test/test3.sql",
"languageId": "sql",
"version": 1,
"text": ""
} } }

@kburtram
Copy link
Member

Here is the exception detail of the crash in SqlToolsService. Basically System.Path.GetFullPath doesn't know how to resolve git:/ URIs.

{System.NotSupportedException: The given path's format is not supported.\r\n at System.IO.Path.GetFullPath(String path)}

System.IO.Path.GetFullPath(string path) (\Unknown Source:0)
Microsoft.SqlTools.ServiceLayer.Workspace.Workspace.ResolveFilePath(string filePath) (d:\xplat\sqltoolsservice\src\Microsoft.SqlTools.ServiceLayer\Workspace\Workspace.cs:112)
Microsoft.SqlTools.ServiceLayer.Workspace.Workspace.GetFileBuffer(string filePath, string initialBuffer) (d:\xplat\sqltoolsservice\src\Microsoft.SqlTools.ServiceLayer\Workspace\Workspace.cs:160)
Microsoft.SqlTools.ServiceLayer.Workspace.WorkspaceService<Microsoft.SqlTools.ServiceLayer.SqlContext.SqlToolsSettings>.HandleDidOpenTextDocumentNotification(Microsoft.SqlTools.ServiceLayer.Workspace.Contracts.DidOpenTextDocumentNotification openParams, Microsoft.SqlTools.ServiceLayer.Hosting.Protocol.EventContext eventContext) (d:\xplat\sqltoolsservice\src\Microsoft.SqlTools.ServiceLayer\Workspace\WorkspaceService.cs:248)
Microsoft.SqlTools.ServiceLayer.Hosting.Protocol.MessageDispatcher.SetEventHandler.AnonymousMethod__0(Microsoft.SqlTools.ServiceLayer.Hosting.Protocol.Contracts.Message eventMessage, Microsoft.SqlTools.ServiceLayer.Hosting.Protocol.MessageWriter messageWriter) (d:\xplat\sqltoolsservice\src\Microsoft.SqlTools.Hosting\Hosting\Protocol\MessageDispatcher.cs:176)
Microsoft.SqlTools.ServiceLayer.Hosting.Protocol.MessageDispatcher.DispatchMessage(Microsoft.SqlTools.ServiceLayer.Hosting.Protocol.Contracts.Message messageToDispatch, Microsoft.SqlTools.ServiceLayer.Hosting.Protocol.MessageWriter messageWriter)

@kburtram
Copy link
Member

I opened an issue with VS Code team to determine if this change is intentional. If it is then we'll include this in our upcoming 0.3.0 release.

@MaximoTrinidad
Copy link
Author

Thanks everyone for the quick attention. I had webinar yesterday where I was showing VS Code Insider working with MSSQL, Python, and PowerShell. Unfortunately the bug stop me from showing the T-SQL piece. But, eventually is going to get fix. Right!

Greatly Appreciate the efforts,

:)

@kburtram
Copy link
Member

There is a fix on our side to ignore the new git:/ events in our extensions service at microsoft/sqltoolsservice#254. I'll wait to hear back on if this intended design change before merging.

@kburtram kburtram self-assigned this Feb 24, 2017
@kevcunnane
Copy link
Contributor

@kburtram 's fix is merged and the tools service release is updated. Therefore re-downloading and uninstalling / reinstalling https://github.com/Microsoft/vscode-mssql/releases/download/v0.3.0/mssql-0.3.0.vsix should pull down a version with this fix.

I'll be updating the installers with an updated VSCode-MSSQL package shortly, or may just create a new 0.3.1 release to better capture this.

@kevcunnane
Copy link
Contributor

All binaries have been updated in the 0.3.0 candidate release. This now includes fixes for newline copy, this issue, and updated release notes

@MaximoTrinidad
Copy link
Author

@kburtram , @kevcunnane

That's AWESOME! I'm looking forward to the next release of insider to test the changes.

Thanks again,
:)

@MaximoTrinidad
Copy link
Author

OK! In my case, I proceed to download and install mssql-0.3.0.vsix.
It's working now.

Good job!!
:)

@kburtram
Copy link
Member

@MaximoTrinidad thanks for confirming!

@JudE2425
Copy link

JudE2425 commented Mar 3, 2017

I'm still having a problem with this. Running Ubuntu Trusty. I was super excited to use Code to connect to my Azure SQL server without having to remote to my Win10 machine. I get the error as soon as I open an SQL file. After clearing that I enter my server details and it just spins without ever connecting or giving me an error message.

Has it been fixed already? I don't mind being patient, I just wanted to make sure that my problem wasn't something else.

Thanks!

@MaximoTrinidad
Copy link
Author

MaximoTrinidad commented Mar 4, 2017

Hi @JudE2425

What's the extension version number? My issue the SQL Tools Service got corrected by manually installing mssql-0.3.0.vsix.

Hope this helps,
:)

@JudE2425
Copy link

JudE2425 commented Mar 4, 2017

strange. That's the extension number I have. I installed the azure extension pack, so I assume all of the dependencies came with it. Anyway, thanks for the heads up!

@MaximoTrinidad
Copy link
Author

Hey @JudE2425,

Hum! I'm curious!! Have you tried to using only the mssql extension (by itself) and see if it connect without the Azure Extension. There might be a chance these two extension may conflict each other.

:)

@JudE2425
Copy link

JudE2425 commented Mar 4, 2017

That's a great idea! So I tried it. I uninstalled all of my extensions and then installed the MSSQL extension only. I then clicked on an .sql file and the terminal/debugger window popped up on the bottom. It said it was downloading some files and right before it says it was successful, the little error message pops up at the top and says that it was unable to start.

@MaximoTrinidad
Copy link
Author

Does by any change... did you recreated the profiles before trying it? In my case I had to recreate my SQL profiles. I'm just saying! It did help in my case.
:)

@kevcunnane
Copy link
Contributor

@JudE2425 sorry to hear you're still having trouble.

Perhaps we could help debug this to understand why it's failing? Steps that should help:

  1. See if we get detailed log information: open user settings and add "mssql.logDebugInfo": true, so that we log as much as possible. Check out the SqlToolsService and MSSQL channels in the output window to see what information you get
  2. Execute the Toggle Developer Tools option to open the Chrome debugger, go to the Console tab and see if there are relevant error messages logged
  3. Advanced option if those doesn't give any useful information:
  • Clone this repository
  • Initialize and build:
    • in the root directory, run npm run install-packages to pull down dependencies
    • run gulp build to build everything
    • run code . to start VSCode
  • Hit F5 to launch the debugger
    • Add a breakpoint in serviceclient.ts, line 85 (the error function).
    • You should be able to see the actual, raw error message returned over the LanguageService channel

@kevcunnane
Copy link
Contributor

One more thing: could it be this issue https://github.com/Microsoft/vscode-mssql/wiki/windows10-universal-c-runtime-requirement? We need the Universal-C runtime to work on earlier versions of Windows. By any chance is that causing this problem for you?

@MaximoTrinidad
Copy link
Author

MaximoTrinidad commented Mar 4, 2017

Good point @kevcunnane!

I'm on the latest Windows 10 Insider build 15046. And VS Code Insider ver. 1.11.0.
:)

@JudE2425
Copy link

JudE2425 commented Mar 4, 2017

In reverse order, I'm running Ubuntu 14.04 in a chroot, so I sure hope it's not a windows issue :-P

Here is the output from SQL ToolsService:

[Error - 7:03:21 PM] Connection to server is erroring. Shutting down server.
[Error - 7:03:21 PM] Connection to server is erroring. Shutting down server.
[Error - 7:03:21 PM] Connection to server is erroring. Shutting down server.
Failed to load /home/zackskrip/.vscode/extensions/ms-mssql.mssql-0.3.0/sqltoolsservice/0.3.0.5/Ubuntu14/libcoreclr.so, error: libunwind.so.8: cannot open shared object file: No such file or directory
Failed to bind to CoreCLR at '/home/zackskrip/.vscode/extensions/ms-mssql.mssql-0.3.0/sqltoolsservice/0.3.0.5/Ubuntu14/libcoreclr.so'

Here is the output from the Developer Tools when I select an SQL file:

extensionHost.ts:282 [Extension Host] TypeError: Cannot read property 'dispose' of null
    at LanguageClient.cleanUp (/home/zackskrip/.vscode/extensions/ms-mssql.mssql-0.3.0/node_modules/vscode-languageclient/lib/main.js:647:30)
    at LanguageClient.stop (/home/zackskrip/.vscode/extensions/ms-mssql.mssql-0.3.0/node_modules/vscode-languageclient/lib/main.js:621:14)
    at LanguageClient.handleConnectionError (/home/zackskrip/.vscode/extensions/ms-mssql.mssql-0.3.0/node_modules/vscode-languageclient/lib/main.js:882:18)
    at errorHandler (/home/zackskrip/.vscode/extensions/ms-mssql.mssql-0.3.0/node_modules/vscode-languageclient/lib/main.js:744:19)
    at /home/zackskrip/.vscode/extensions/ms-mssql.mssql-0.3.0/node_modules/vscode-languageclient/lib/main.js:47:42
    at CallbackList.invoke (/home/zackskrip/.vscode/extensions/ms-mssql.mssql-0.3.0/node_modules/vscode-jsonrpc/lib/events.js:103:39)
    at Emitter.fire (/home/zackskrip/.vscode/extensions/ms-mssql.mssql-0.3.0/node_modules/vscode-jsonrpc/lib/events.js:167:36)
    at writeErrorHandler (/home/zackskrip/.vscode/extensions/ms-mssql.mssql-0.3.0/node_modules/vscode-jsonrpc/lib/main.js:113:22)
    at CallbackList.invoke (/home/zackskrip/.vscode/extensions/ms-mssql.mssql-0.3.0/node_modules/vscode-jsonrpc/lib/events.js:103:39)
    at Emitter.fire (/home/zackskrip/.vscode/extensions/ms-mssql.mssql-0.3.0/node_modules/vscode-jsonrpc/lib/events.js:167:36)
    at StreamMessageWriter.AbstractMessageWriter.fireError (/home/zackskrip/.vscode/extensions/ms-mssql.mssql-0.3.0/node_modules/vscode-jsonrpc/lib/messageWriter.js:28:27)
    at Socket.<anonymous> (/home/zackskrip/.vscode/extensions/ms-mssql.mssql-0.3.0/node_modules/vscode-jsonrpc/lib/messageWriter.js:60:67)
    at emitOne (events.js:96:13)
    at Socket.emit (events.js:188:7)
    at onwriteError (_stream_writable.js:319:10)
    at onwrite (_stream_writable.js:337:5)d.logExtensionHostMessage @ extensionHost.ts:282(anonymous function) @ extensionHost.ts:137emitTwo @ events.js:106emit @ events.js:191process.nextTick @ internal/child_process.js:744_combinedTickCallback @ internal/process/next_tick.js:67_tickCallback @ internal/process/next_tick.js:98
3messageService.ts:126 mssql: SQL Tools Service component could not start.e.doShow @ messageService.ts:126e.show @ messageService.ts:105(anonymous function) @ mainThreadMessageService.ts:64n.Class.derive._oncancel @ winjs.base.raw.js:1641t.showMessage @ mainThreadMessageService.ts:34t.$showMessage @ mainThreadMessageService.ts:28e.handle @ abstractThreadService.ts:34s @ ipcRemoteCom.ts:275f @ ipcRemoteCom.ts:231_combinedTickCallback @ internal/process/next_tick.js:67_tickCallback @ internal/process/next_tick.js:98```

Thanks so much for taking time out of your evening to help me. I really appreciate it.

Zack

@JudE2425
Copy link

JudE2425 commented Mar 4, 2017

Oh, there was one more message I forgot to paste in. I apologize.

messageService.ts:126 mssql: SQL Tools Service component could not start.e.doShow @ messageService.ts:126e.show @ messageService.ts:105(anonymous function) @ mainThreadMessageService.ts:64n.Class.derive._oncancel @ winjs.base.raw.js:1641t.showMessage @ mainThreadMessageService.ts:34t.$showMessage @ mainThreadMessageService.ts:28e.handle @ abstractThreadService.ts:34s @ ipcRemoteCom.ts:275f @ ipcRemoteCom.ts:231_combinedTickCallback @ internal/process/next_tick.js:67_tickCallback @ internal/process/next_tick.js:98
extensionHost.ts:282 [Extension Host] ApplicationInsights:Sender [Object]

This was also in the developer tools output.

@kevcunnane
Copy link
Contributor

So the issue is definitely this:

Failed to load /home/zackskrip/.vscode/extensions/ms-mssql.mssql-0.3.0/sqltoolsservice/0.3.0.5/Ubuntu14/libcoreclr.so, error: libunwind.so.8: cannot open shared object file: No such file or directory
Failed to bind to CoreCLR at '/home/zackskrip/.vscode/extensions/ms-mssql.mssql-0.3.0/sqltoolsservice/0.3.0.5/Ubuntu14/libcoreclr.so'

Does this file exist at the specified location? I just downloaded the Ubuntu 14 package we're using (https://github.com/Microsoft/sqltoolsservice/releases/download/v0.3.0.5/microsoft.sqltools.servicelayer-ubuntu14-x64-netcoreapp1.0.tar.gz), unpackage and verified it is there. Can you try re-downloading (delete the sqltoolsservice directory and restart VSCode) and see if it "just works"? If the file is there, I'm not sure what might be going wrong, will need to dig in a bit more

@kevcunnane
Copy link
Contributor

@MaximoTrinidad I think this is a VSCode Insiders build issue. I just updated to 1.11.0-insiders and after a few restarts, it now says my VSCode instance appears to be corrupt.If you can verify things still work OK on the standard VSCode install, I would recommend opening an issue against VSCode (https://github.com/Microsoft/vscode/issues). They are generally very good about fixing quickly.

@MaximoTrinidad
Copy link
Author

Thanks @kevcunnane! I will post this on the VS Code side.
:)

@MaximoTrinidad
Copy link
Author

MaximoTrinidad commented Mar 4, 2017

Hi @kevcunnane,

Just installed VS Code (not Insider) ver 1.10.0 in Linux Ubuntu 16.04.1 and all the extensions works fine including mssql.

:)

@Nekronek0
Copy link

Same errors here on Debian Stretch:
Failed to initialize CoreCLR, HRESULT: 0x80131500, corresponding to https://github.com/dotnet/cli/issues/2018.
Installing libicu52 solves the error

@thiagojedi
Copy link

Had the same issue in elementary OS 0.4

[Error - 7:03:21 PM] Connection to server is erroring. Shutting down server.
[Error - 7:03:21 PM] Connection to server is erroring. Shutting down server.
[Error - 7:03:21 PM] Connection to server is erroring. Shutting down server.
Failed to load /home/jedi/.vscode/extensions/ms-mssql.mssql-0.3.0/sqltoolsservice/0.3.0.5/Ubuntu16/libcoreclr.so, error: libunwind.so.8: cannot open shared object file: No such file or directory
Failed to bind to CoreCLR at '/home/jedi/.vscode/extensions/ms-mssql.mssql-0.3.0/sqltoolsservice/0.3.0.5/Ubuntu16/libcoreclr.so'

I figured that it wasn't the libcoreclr.so file that was missing, but the libunwind.so.8. So I installed the package libunwind8-dev and it's working fine now.

@MaximoTrinidad
Copy link
Author

Thanks @thiagoabreu! I will try this tonight when I get home.

By the way, I got side track on this one as the only problem still is with my Code Insider version on my main Linux system. I can't seem to uninstall the application.

Can some help (or explain) how to completely remove the application?

I tried everything I know. I tried the Ubuntu App, dpkg remove, and even search then "Move to Trash". Apparently, the application still stays loaded somewhere.

Every time I install, what I think is a refresh application, it comes back with all of my previously installed extensions. I think somehow the installation got corrupted as I'm able to successfully install on a clean Linux VM.

So, what are the proper way to uninstall to do a clean installation?

Thanks,
Max

@thiagojedi
Copy link

@MaximoTrinidad Have you tried to delete the ~/.vscode/ and ~/.vscode-insiders/ folders?

@dzsquared
Copy link
Contributor

I was having similar issues to @JudE2425 with the SQL tools service not starting in a chroot with Ubuntu 16 - the resolution was as @thiagoabreu suggested - installing libunwind8-dev.

sudo apt install libunwind8-dev

@kburtram
Copy link
Member

@kevcunnane could you please confirm if there is anything we can do for this issue in the upcoming release?

@kburtram kburtram assigned kevcunnane and unassigned kburtram Apr 24, 2017
@asmyers
Copy link

asmyers commented Apr 25, 2017

Also effects Ubuntu 17.04 Not sure if this is relevant but it appears to be downloading a tarball for Debian? It goes into the Debian directory under the extension but with 16.10 it was going into an Ubuntu16 directory.

Initializing SQL tools service for the mssql extension.
Note: mssql commands will be available after installing the service.


Platform: linux, x86_64, name=ubuntu, version=17.04 (Debian)

Installing SQL tools service to /home/icarus/.vscode/extensions/ms-mssql.mssql-0.3.0/sqltoolsservice/0.3.0.5/Debian.
Downloading https://download.microsoft.com/download/A/A/2/AA22B2D6-94D8-4C82-A388-D0246F567BBF/microsoft.sqltools.servicelayer-debian-x64-netcoreapp1.0.tar.gz
(24532 KB) .................... Done!
Installing ...
Done! 157 files unpacked.

SqlToolService output is

[Error - 2:15:21 PM] Connection to server is erroring. Shutting down server.
[Error - 2:15:21 PM] Connection to server is erroring. Shutting down server.
[Error - 2:15:21 PM] Connection to server is erroring. Shutting down server.
Failed to initialize CoreCLR, HRESULT: 0x80131500

@kburtram kburtram added this to the MSSQL GA Release milestone Apr 25, 2017
@kburtram
Copy link
Member

kburtram commented May 2, 2017

The Ubuntu 17.04 issue appears to be an issue with .Net Core 1.0. We're following up on how best to support this more recent distro, but we don't have a fix currently available.

I'm going to clear the GA milestone and we'll need to fix in the next release or hotfix. I'll add a comment to the known issue list.

@kburtram kburtram removed this from the MSSQL GA Release milestone May 2, 2017
@basabuber
Copy link

Just fyi, latest release .Net Core seems to work fine (for me) on Ubuntu 17.04.

@ed-alertedh
Copy link

ed-alertedh commented Jun 8, 2017

@basabuber Could you please share what versions of VS Code / vscode-mssql / dotnet core you're having success with?

I'm experiencing this issue on Ubuntu 17.04 with VS Code 1.12.2 / vscode-mssql / dotnet 2.0.0-preview2-006127

edit: It looks like there's a whole .net core runtime bundled in with sqltoolsservice! I'm assuming it was a decision made to ease the installation process, but it seems like it does make compatibility issues such as this one more likely...

@kburtram
Copy link
Member

kburtram commented Jun 8, 2017

@ed-alertedh @basabuber the current extension is built using .Net Core 1 which doesn't support Ubuntu 17.04. We'll be upgrading to .Net Core 2 in the next release.

I've posted an early test build based on .Net Core 2 at https://github.com/Microsoft/vscode-mssql/releases/tag/v1.0.0-alpha.10 that can be side-loaded into VS Code using the Install From VSIX option. The build has a couple known issues we'll be fixing in the next week or so, but should be mostly stable. It would be great if you can give it a try and let me know if you hit any issues.

@MaximoTrinidad
Copy link
Author

@kburtram,

That's Awesome!! I'll give it try when I get a chance and let you know if anything is going on.

Thanks,
:)

@mkurz
Copy link

mkurz commented Jun 8, 2017

@kburtram The alpha version with .Net Core 2 support finally works for me! Thank you! 👍 (I am using Ubuntu 16.10)

@asmyers
Copy link

asmyers commented Jun 8, 2017

@kburtram The alpha version also works for me on Ubuntu 17.04! Thanks! 👍

@ed-alertedh
Copy link

@kburtram Yep, that's working for me too, thanks!

As an aside, I'm still a little curious about the whole system of bundling a runtime with the sql service. Isn't the whole point of .NET that the code targets a certain framework and is decoupled from the runtime/host platform?

@gavincampbell
Copy link

Fixed for me too on Fedora 25, VS Code 1.13. Prior to taking the update I couldn't connect to a SQL instance in a local VM (with 1433 forwarded), even though sqlcmd could connect OK. I also got that "extension failed to load message >50% of the time when setting file type to SQL.

@kevcunnane
Copy link
Contributor

I'll close this out as this version is now supported in the latest full release.

@aliasadidev
Copy link

aliasadidev commented Nov 18, 2020

I've had the same issue in Ubuntu 20.04, I downloaded the latest version of SQLToolsService at download sqltoolsservice and then extracted the file to "/home/user/.vscode/extensions/ms-mssql.mssql-1.9.0/sqltoolsservice/1.9.0/Ubuntu16/"

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

No branches or pull requests