EXECUTION FAILURE in SonarLint for VSCode, unhelpful error message

We are using SonarLint in connected mode with a SonarQube server version 7.0 (build 36138). Here’s a list of the SonarQube plugins:

  • sonar-flex-plugin-2.3.jar
  • sonar-pitest-plugin-0.9.jar
  • sonar-csharp-plugin-
  • sonar-javascript-plugin-
  • sonar-java-plugin-
  • sonar-php-plugin-
  • sonar-python-plugin-
  • sonar-scm-git-plugin-
  • sonar-scm-svn-plugin-
  • sonar-typescript-plugin-
  • sonar-xml-plugin-

I am developing on VS Code version 1.37.1 on Ubuntu 18.04 LTS (VS Code says I’m running "Linux x64 4.15.0-58-generic). I am using version 1.10.0 of the SonarLint plugin, although I’ve experienced this exact same issue with versions 1.09.0 and 1.08.0.

I am able to connect to the server fine and update the SonarLint binding. The problem comes when trying to actually scanning files. I consistently get the following error:

INFO: ------------------------------------------------------------------------
INFO: Total time: 1.073s
INFO: Final Memory: 8M/188M
INFO: ------------------------------------------------------------------------
ERROR: Error executing SonarLint
ERROR: Unable to analyse file: /home/***file name redacted to protect the innocent***.js
ERROR: To see the full stack trace of the errors, re-run SonarLint with the -e switch.
ERROR: Re-run SonarLint using the -X switch to enable full debug logging.

I followed the instructions to enable SonarLint output for VS Code, here’s the output:

Analysis triggered on file:///***nothing to see here***.js with configuration: 
  baseDir: /home/***wouldn't you like to know***
  extraProperties: {}
  excludedRules: []
  includedRules: []
  inputFiles: [
    file:///home/***still not telling***.js (UTF-8) [js]

Available languages:
  * PHP => "php"
  * Python => "py"
  * TypeScript => "ts"
  * HTML => "web"
  * JSP => "jsp"
  * JavaScript => "js"
Start analysis
Declared extensions of language PHP were converted to php: **/*.php,**/*.php3,**/*.php4,**/*.php5,**/*.phtml,**/*.inc
Declared extensions of language Python were converted to py: **/*.py
Declared extensions of language TypeScript were converted to ts: **/*.ts,**/*.tsx
Declared extensions of language HTML were converted to web: **/*.html,**/*.xhtml,**/*.cshtml,**/*.vbhtml,**/*.aspx,**/*.ascx,**/*.rhtml,**/*.erb,**/*.shtm,**/*.shtml
Declared extensions of language JSP were converted to jsp: **/*.jsp,**/*.jspf,**/*.jspx
Declared extensions of language JavaScript were converted to js: **/*.js,**/*.jsx,**/*.vue
[Info  - 2:55:10 PM] Index files
Language of file 'file:///home/***something***.js' is set to 'js'
[Info  - 2:55:10 PM] 1 file indexed
'PHP sensor' skipped because there is no related file in current project
'Analyzer for "php.ini" files' skipped because there is no related file in current project
'Python Squid Sensor' skipped because there is no related file in current project
'Contextual SonarTS' skipped because there is no related file in current project
Execute Sensor: HTML
Execute Sensor: SonarJS
[Info  - 2:55:10 PM] 1 source files to be analyzed
[Info  - 2:55:10 PM] 1/1 source files have been analyzed
Execute Sensor: ESLint-based SonarJS
SonarJS eslint-bridge server is up, no need to start.
[Info  - 2:55:10 PM] 1 source files to be analyzed
Aug 22, 2019 2:55:10 PM org.eclipse.lsp4j.jsonrpc.RemoteEndpoint handleCancellation
WARNING: Unmatched cancel notification for request id 10
[Info  - 2:55:10 PM] 1/1 source files have been analyzed

I’ve looked around for instructions on how to “re-run SonarLint with the -e switch” or “Re-run SonarLint using the -X switch” but have come up empty. I would greatly appreciate some assistance on this issue, at the very least how to get a more meaningful stack trace.

Hi @as.adesa

Can you precise how you obtain the first log? Are you by chance using the deprecated sonarlint-cli tool?

The second log is the correct output for sonarlint-vscode, and show no errors.

That first log is as precise as I have, so if there’s a way to get a more precise version I’m not quite sure how to do it, hence my post.

I don’t believe I’m using the deprecated sonarlint-cli tool, is there a way to know for certain?

How do you trigger file scanning?

It’s done either automatically (when I open a file) or when I try to do it explicitly via F1 -> “SonarQube Inject: Analyze current project”.

This is definitely not a SonarLint feature. Have you installed a third party plugin? Like maybe https://marketplace.visualstudio.com/items?itemName=silverbulleters.sonarqube-inject

I suggest you remove it, it is not supported by SonarSource, and looks unmaintained.

1 Like

I didn’t even realize that’s what was happening, I must have installed that by mistake at some point. All is working now, thank you for your help!