Vscode-mssql: Failed to load sql tools service

Created on 17 Nov 2016  路  14Comments  路  Source: microsoft/vscode-mssql

  • MSSQL Extension Version: 0.1.5
  • VSCode Version: 1.7.1
  • OS Version: Linux Mint 18

Steps to Reproduce:

  1. Install MSSQL
  2. Reload
    Installing SQL tools service message appears at the bottom of the application
    then ERROR mssql: Filed to load Sql Tools Service

The only logs I can find say -

[Extension Host] vscode-icons is active!
mssql: Failed to load Sql Tools Service
[Extension Host] rejected promise not handled within 1 second
spawn EACCES: Error: spawn EACCES
at exports._errnoException (util.js:1026:11)
at ChildProcess.spawn (internal/child_process.js:313:11)
at Object.exports.spawn (child_process.js:392:9)
at LanguageClient.createConnection (/home/steve/.vscode/extensions/ms-mssql.mssql-0.1.5/node_modules/vscode-languageclient/lib/main.js:824:32)
at LanguageClient.resolveConnection (/home/steve/.vscode/extensions/ms-mssql.mssql-0.1.5/node_modules/vscode-languageclient/lib/main.js:533:37)
at LanguageClient.start (/home/steve/.vscode/extensions/ms-mssql.mssql-0.1.5/node_modules/vscode-languageclient/lib/main.js:465:14)
at _server.getServerPath.then.serverPath (/home/steve/.vscode/extensions/ms-mssql.mssql-0.1.5/out/src/languageservice/serviceclient.js:146:46)

bug

All 14 comments

Thanks for raising this. This platform isn't handled in our platform list right now - we handle Linux Mint v14 and 16 but for v18 we need to add an additional check. We will work to fix in the next release and improve handling in this area.

Bug fix info:
Looking at https://github.com/OmniSharp/omnisharp-vscode/blob/5c6ccf55e8671f08c480bf5991ebd6a8580510ce/src/platform.ts, it seems that C# extension has added support for this since we last updated. To fix, we should:

  • Add matching support for all platforms as done by C# extension
  • Change the error handling to not default to Windows. Instead we should return unknown_distribution just like their extension and handle in a similar manner.

Many thanks for getting back to me, I was unsure which versions of Mint were supported. Is there some official documentation somewhere that I clearly missed?

thanks again

@ellwoods - Good point. I've created #393 to track the need for an official documentation page with supported distributions. At present we don't list this anywhere. We will work to get this updated so that there's clear guidance. I'm keeping this issue open to track the need to update our version mapping logic, since that would allow us to support v18.

Though, for what it's worth, this would only be a list of "officially supported/tested" distributions. There's a good chance that the extension will work on other distributions we haven't explicitly tested, or that to get it working on an "unsupported" distro is a simple process. Sort of a "your mileage may vary" if you run it outside our explicit list.

@kevcunnane will there be workaround for unsupported distributions? For example I have created a mssql-tools package for Arch linux, but it is in AUR (user contributed) repository and probably will never be in the core repository.

Maybe a configuration like an options to point to the path where sqlcmd and bcp installed is enough?

I had the same problem with:

MSSQL Extension Version: 0.1.5
VSCode Version: 1.7.1
OS Version: elementary OS 0.4 Loki

The problem was solved after change a case validation in the platform.js file, the ID for this OS is "elementary" and the validation string in the switch-case is "elementary OS".

@karuna - it seems you are referring to the mssql-tools commandline package rather than this extension? This forum is for the VSCode extension called "MSSQL", but I can help route you for questions. I'd recommend pinging https://twitter.com/tiger_vin on twitter and going from there, or even better raise this in the AMA - https://www.reddit.com/r/SQLServer/comments/5dijyg/ama_microsoft_sql_server_1118/?st=ivmy7r65&sh=3f3d1820.

We'll work to get good channels open for these tools too so that you can ask questions like this more easily

@rselbor - thanks! we took a community contribution to fix this, which we really appreciate.

We have a full fix to support Mint and other distributions in review right now, so this will appear in a nightly dev build soon (https://github.com/Microsoft/vscode-mssql/releases - this will list daily drops if you really need a fix).

Fixed by #400. I am going to close this issue out. Please feel free to open a new issue if you have related things to raise.

@rselbor Could you please provide a more detailed description on how you got this extension working on Elementary OS 0.4 Loki? I'm having difficulties getting it to load (mssql: Failed to load Sql Tools Service).

[EDIT]
Found it! I've searched the whole extension folder for a file platform.js and found this file: ~/.vscode/extensions/ms-mssql.mssql-0.1.5/out/src/models/platform.js. Around lines 69-85 you'll find this:

            case 'debian':
                return Platform.Debian;
            case 'ol':
                // Oracle Linux is binary compatible with CentOS
                return Platform.CentOS;
            case 'elementary OS':
                const eOSVersionId = getValue('VERSION_ID');
                if (eOSVersionId.startsWith('0.3')) {
                    // Elementary OS 0.3 Freya is binary compatible with Ubuntu 14.04
                    return Platform.Ubuntu14;
                }
                else if (eOSVersionId.startsWith('0.4')) {
                    // Elementary OS 0.4 Loki is binary compatible with Ubuntu 16.04
                    return Platform.Ubuntu16;
                }
            default:
                return Platform.Windows;

I've replaced it with this:

            case 'debian':
                return Platform.Debian;
            case 'ol':
                // Oracle Linux is binary compatible with CentOS
                return Platform.CentOS;
            case 'elementary':
            case 'elementary OS':
                const eOSVersionId = getValue('VERSION_ID');
                if (eOSVersionId.startsWith('0.3')) {
                    // Elementary OS 0.3 Freya is binary compatible with Ubuntu 14.04
                    return Platform.Ubuntu14;
                }
                else if (eOSVersionId.startsWith('0.4')) {
                    // Elementary OS 0.4 Loki is binary compatible with Ubuntu 16.04
                    return Platform.Ubuntu16;
                }
            default:
                return Platform.Windows;

[/EDIT]

Hello @riker09...

Yes, I modified this file (plataform.js) but, instead of add a new case I only changed de string validation.

        case 'ol':
            // Oracle Linux is binary compatible with CentOS
            return Platform.CentOS;
        case 'elementary':
            const eOSVersionId = getValue('VERSION_ID');
            if (eOSVersionId.startsWith('0.3')) {
                // Elementary OS 0.3 Freya is binary compatible with Ubuntu 14.04
                return Platform.Ubuntu14;
            }
            else if (eOSVersionId.startsWith('0.4')) {
                // Elementary OS 0.4 Loki is binary compatible with Ubuntu 16.04
                return Platform.Ubuntu16;
            }
        default:
            return Platform.Windows;

I think both cases would be run fine, but for me the code above is working.

@riker09, @rselbor - a quick note that our nightly builds are now available and include the fixes to support these new versions. The most recent is https://github.com/Microsoft/vscode-mssql/releases/tag/v0.1.5_3-alpha. You can install the mssql-0.1.5.vsix package to verify this is fixed officially, and if stuck we have offline-installable packages listed too which have the service backend for different platforms. This may help skip altering the .js yourself manually.

i had the same issue on ubuntu could fix this by running
sudo code --user-data-dir /home/alain
then i tried installing the plugin trough vs code now went succesfully exit the vscode admin session and did the same thing on regular user , this worked

Thanks @alainseys : This worked for me on Linux Mint 19.2

Was this page helpful?
0 / 5 - 0 ratings