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

Failed to load sql tools service #364

Closed
ellwoods opened this issue Nov 17, 2016 · 14 comments
Closed

Failed to load sql tools service #364

ellwoods opened this issue Nov 17, 2016 · 14 comments
Assignees
Labels
bug

Comments

@ellwoods
Copy link

@ellwoods ellwoods commented Nov 17, 2016

  • 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)

@kevcunnane
Copy link
Contributor

@kevcunnane kevcunnane commented Nov 17, 2016

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.
@ellwoods
Copy link
Author

@ellwoods ellwoods commented Nov 21, 2016

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

@kevcunnane
Copy link
Contributor

@kevcunnane kevcunnane commented Nov 21, 2016

@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.

@benrr101
Copy link
Contributor

@benrr101 benrr101 commented Nov 21, 2016

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.

@karuna
Copy link

@karuna karuna commented Nov 22, 2016

@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?

@rselbor
Copy link

@rselbor rselbor commented Nov 22, 2016

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".

@kevcunnane
Copy link
Contributor

@kevcunnane kevcunnane commented Nov 23, 2016

@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

@kevcunnane
Copy link
Contributor

@kevcunnane kevcunnane commented Nov 23, 2016

@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).

@kevcunnane
Copy link
Contributor

@kevcunnane kevcunnane commented Nov 23, 2016

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.

@kevcunnane kevcunnane closed this Nov 23, 2016
@riker09
Copy link

@riker09 riker09 commented Nov 25, 2016

@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]

@rselbor
Copy link

@rselbor rselbor commented Nov 25, 2016

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.

@kevcunnane
Copy link
Contributor

@kevcunnane kevcunnane commented Nov 26, 2016

@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.

@alainseys
Copy link

@alainseys alainseys commented Jan 16, 2020

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

@ch-rob
Copy link

@ch-rob ch-rob commented Mar 9, 2020

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

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

Successfully merging a pull request may close this issue.

None yet
9 participants