SonarLint error fetching list of projects

Hi:

I have a problem when we try to connect to our sonarqube server, when I click in “Update bindings” this starts downloading info but when it’s in the phase “Fetching list of projects” raise the error “Failed to update binding for server configuration ‘Sonar_XXX’”.

Maybe is a timeout problem, because if I go to the URL “http://sonarqube_host/api/projects/index?format=json&subprojects=true” takes a lot of time in show the info.
But I don’t know where I can change the timeout in SonarLint :S

I use:

  • Intellij 2018.3.2
  • SonarLint v4.0.2.3009
  • Java 8
  • Sonarqube 5.6.7

Can you help me?

Thanks.
Regards,

The full stacktrace of error is:

2019-01-09 16:12:59,324 [1524119]   INFO - ntellij.tasks.ServerUpdateTask - Error updating from server 'Sonar_XXX' 
java.lang.NullPointerException
	at org.sonarsource.sonarlint.core.plugin.PluginLoader.basePluginKey(PluginLoader.java:171)
	at org.sonarsource.sonarlint.core.plugin.PluginLoader.defineClassloaders(PluginLoader.java:82)
	at org.sonarsource.sonarlint.core.plugin.PluginLoader.load(PluginLoader.java:69)
	at org.sonarsource.sonarlint.core.plugin.PluginRepository.start(PluginRepository.java:59)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.sonarsource.sonarlint.shaded.org.picocontainer.lifecycle.ReflectionLifecycleStrategy.invokeMethod(ReflectionLifecycleStrategy.java:110)
	at org.sonarsource.sonarlint.shaded.org.picocontainer.lifecycle.ReflectionLifecycleStrategy.start(ReflectionLifecycleStrategy.java:89)
	at org.sonarsource.sonarlint.core.container.ComponentContainer$1.start(ComponentContainer.java:279)
	at org.sonarsource.sonarlint.shaded.org.picocontainer.injectors.AbstractInjectionFactory$LifecycleAdapter.start(AbstractInjectionFactory.java:84)
	at org.sonarsource.sonarlint.shaded.org.picocontainer.behaviors.AbstractBehavior.start(AbstractBehavior.java:169)
	at org.sonarsource.sonarlint.shaded.org.picocontainer.behaviors.Stored$RealComponentLifecycle.start(Stored.java:132)
	at org.sonarsource.sonarlint.shaded.org.picocontainer.behaviors.Stored.start(Stored.java:110)
	at org.sonarsource.sonarlint.shaded.org.picocontainer.DefaultPicoContainer.potentiallyStartAdapter(DefaultPicoContainer.java:1016)
	at org.sonarsource.sonarlint.shaded.org.picocontainer.DefaultPicoContainer.startAdapters(DefaultPicoContainer.java:1009)
	at org.sonarsource.sonarlint.shaded.org.picocontainer.DefaultPicoContainer.start(DefaultPicoContainer.java:767)
	at org.sonarsource.sonarlint.core.container.ComponentContainer.startComponents(ComponentContainer.java:124)
	at org.sonarsource.sonarlint.core.ConnectedSonarLintEngineImpl.start(ConnectedSonarLintEngineImpl.java:118)
	at org.sonarsource.sonarlint.core.ConnectedSonarLintEngineImpl.lambda$update$2(ConnectedSonarLintEngineImpl.java:176)
	at org.sonarsource.sonarlint.core.ConnectedSonarLintEngineImpl.withRwLock(ConnectedSonarLintEngineImpl.java:325)
	at org.sonarsource.sonarlint.core.ConnectedSonarLintEngineImpl.update(ConnectedSonarLintEngineImpl.java:169)
	at org.sonarlint.intellij.tasks.ServerUpdateTask.run(ServerUpdateTask.java:97)
	at org.sonarlint.intellij.tasks.ServerUpdateTask$2.run(ServerUpdateTask.java:84)
	at com.intellij.openapi.progress.impl.CoreProgressManager$TaskRunnable.run(CoreProgressManager.java:727)
	at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$runProcess$2(CoreProgressManager.java:164)
	at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:582)
	at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:532)
	at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:87)
	at com.intellij.openapi.progress.impl.CoreProgressManager.runProcess(CoreProgressManager.java:151)
	at com.intellij.openapi.progress.impl.CoreProgressManager$4.run(CoreProgressManager.java:403)
	at com.intellij.openapi.application.impl.ApplicationImpl$1.run(ApplicationImpl.java:314)
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
	at java.lang.Thread.run(Thread.java:745)

Hi,

The stacktrace doesn’t relate at all with downloading project list, but about loading plugins. It seems one of the plugin declares a base plugin that is missing.
Could you please provide us the result of opening /deploy/plugins/index.txt in a browser.

++

Hi,

I thought that the problem was in “Fetching list of projects” because is the message that intellij is showing when the error appears.

The result of the http://sonarqube_hist/deploy/plugins/index.txt is:

bw6,sonar-bw6-plugin-1.4.3.1027.jar|cd19f76bc2497ae173db66d0d1a5dfc4
sonarIsbanwebplugin,sonarIsban-web-plugin-2.6.1.jar|c3b7360e5321028935f2d2dde3521033
l10nesexcentia,sonarqube-spanish-pack-plugin-2.1.jar|7665cbf01b5b9ff830af725e3ebf0713
Scalastyle,sonar-scalastyle-0.0.3-SNAPSHOT.jar|d88207b29db55cee3330e57424978063
css,sonar-css-plugin-4.11.jar|a622ccc78afb89a484861c8c1fceb6a3
jscustom,javascript-isban-rules-1.0-SNAPSHOT.jar|b21de7445437e0a91d472f3d44f1419a
pmd,sonar-pmd-plugin-2.6.jar|f6f655d89f546cccc0997e3d3817f6db
android,sonar-android-plugin-1.1.jar|7e6dbaff66586829e42034455ad0e5f4
scmsvn,sonar-scm-svn-plugin-1.3.jar|58c8c866070a317d412d700dfa0175b7
sonarIsbanyamlplugin,sonarIsban-yaml-plugin-2.7.1.jar|fd5fa74fe0c09a5dbe1ac8acf3ec61ee
plsql,sonar-plsql-plugin-3.0.1.1427.jar|db8817e909817b9725340ef6d258c2d0
javaProperties,sonar-jproperties-plugin-1.7.jar|2487e0c3fa8c91e64e415294bb15c702
csharp,sonar-csharp-plugin-6.5.0.3766.jar|e7d75a48b1b92bcb2e4fba5a10a6f829
java,sonar-java-plugin-4.14.0.11784.jar|85279b90870c408f37696a5f14e0c43f
ldap,sonar-ldap-plugin-2.2.0.608.jar|90da8f56fbbbb3624b8a3f6f1075860a
xml,sonar-xml-plugin-1.4.3.1027.jar|6403e34ad91f3c6a2a340b3209864e8c
rci,sonar-rci-plugin-1.0.1.jar|6dd7a2019f5ffce549846ecc3548c7f7
vbnet,sonar-vbnet-plugin-4.0.0.115.jar|1e22edda7e3887dc7f1e646f98867b74
checkstyle,checkstyle-sonar-plugin-3.7.jar|69d0b4d513b7d4da3daa5681161b1ce8
cpp,sonar-cfamily-plugin-4.14.0.9331.jar|d39e46ebea0e4def7f4ceb3520164429
cxx,sonar-cxx-plugin-0.9.7.jar|58086505165aa2d42bd69882206b75b6
issuesdensity,sonar-issues-density-plugin-1.0.jar|c95e48b3049e5c70ebd214e027736a96
javacustom,sonarIsban-java-plugin-1.4.jar|06488bcaccbffe8be8e7ff6ca1b328b8
fxcop,sonar-fxcop-plugin-1.2.jar|79fbf15f606ac6ca1f05674d8d92b2cb
rpg,sonar-rpg-plugin-2.1.0.736.jar|08de00275789413fae7edce144468671
javascript,sonar-javascript-plugin-3.2.0.5506.jar|3c43ca34b48e025530485308ddac54a2
sonarIsbancobolplugin,sonarIsban-cobol-plugin-4.0.jar|285fc76b38c6f1ee5e3578467a02acfc
findbugs,sonar-findbugs-plugin-3.6.0.jar|68b929085a8ec78de8394916655baddd
cobol,sonar-cobol-plugin-4.0.1.2609.jar|12374feacdf805c0a64946e43721cfbe
php,sonar-php-plugin-2.11.0.2485.jar|42606bbcf26b849ceb15e8b5fb476be5
isbanSecurity,sonarqube-isban-security-plugin-1.0-SNAPSHOT.jar|41e4fca43705589e343d2ab6af6d032b
isbansonarbuildbreakerplugin,isban-sonar-build-breaker-plugin-2.3-SNAPSHOT.jar|82084f5ac8b1ee2053ffb614861f83d9
governance,sonar-governance-plugin-1.2.1.1926.jar|1365d8ac8b01a0395732ca85a60226dc
sonarIsbanjsonplugin,sonarIsban-json-plugin-2.5.1.jar|4cce5646a922496941c5898056c5f131

Thanks.
Regards,

I think the problem come from outdated plugins. If you run again the update all project bindings command with verbose logs of the SonarLint console enabled, you should see things like:

Code analyzer ‘{}’ version ‘{}’ is not supported (minimal version is ‘{}’). Skip downloading it.

As the java plugin you have on your server is too old, it will not be loaded. Then your custom plugin javacustom (that I guess depends on sonarjava) will produce the stacktrace.
I will create a ticket to improve the behavior (not fail), but still you will have to update your plugins (and at the same time consider updating your server).

How can I run a sonarlint console to execute the project bindings command with verbose? and what is the command?

Thanks.

In the SonarLint panel -> Log tab -> Top right gear: check analysis logs + verbose output

You are right, the log shows messages like yours:

Code analyzer 'plsql' version '3.0.1.1427' is not supported (minimal version is '3.1'). Skip downloading it.
Code analyzer 'java' version '4.14.0.11784' is not supported (minimal version is '5.1'). Skip downloading it.
Code analyzer 'cpp' is not compatible with SonarLint. Skip downloading it.
Code analyzer 'rpg' version '2.1.0.736' is not supported (minimal version is '2.2'). Skip downloading it.
Code analyzer 'javascript' version '3.2.0.5506' is not supported (minimal version is '4.0'). Skip downloading it.
Code analyzer 'cobol' version '4.0.1.2609' is not supported (minimal version is '4.2'). Skip downloading it.
Code analyzer 'php' version '2.11.0.2485' is not supported (minimal version is '2.12'). Skip downloading it.

Also:

Load plugins
Code analyzer 'SonarBW6' is not compatible with SonarLint. Skip loading it.
Code analyzer 'isbanweb' is not compatible with SonarLint. Skip loading it.
Plugin [l10nesexcentia] defines 'l10nen' as base plugin. This metadata can be removed from manifest of l10n plugins since version 5.2.
Code analyzer 'L10n :: Spanish Pack (excentia)' is not compatible with SonarLint. Skip loading it.
Code analyzer 'Scalastyle' is not compatible with SonarLint. Skip loading it.
Code analyzer 'CSS / SCSS / Less' is not compatible with SonarLint. Skip loading it.
Code analyzer 'PMD' is not compatible with SonarLint. Skip loading it.
Code analyzer 'Android' is not compatible with SonarLint. Skip loading it.
Code analyzer 'SVN' is not compatible with SonarLint. Skip loading it.
Code analyzer 'isbanyaml' is not compatible with SonarLint. Skip loading it.
Code analyzer 'Java Properties' is not compatible with SonarLint. Skip loading it.
Code analyzer 'SonarC#' is not compatible with SonarLint. Skip loading it.
Code analyzer 'LDAP' is not compatible with SonarLint. Skip loading it.
Code analyzer 'SonarXML' is not compatible with SonarLint. Skip loading it.
Code analyzer 'Rules Compliance Index (RCI)' is not compatible with SonarLint. Skip loading it.
Code analyzer 'SonarVB' is not compatible with SonarLint. Skip loading it.
Code analyzer 'Checkstyle' is not compatible with SonarLint. Skip loading it.
Code analyzer 'C++ (Community)' is not compatible with SonarLint. Skip loading it.
Code analyzer 'Issues Density' is not compatible with SonarLint. Skip loading it.
Code analyzer 'FxCop' is not compatible with SonarLint. Skip loading it.
Code analyzer 'Custom Cobol Plugin' is not compatible with SonarLint. Skip loading it.
Code analyzer 'Findbugs' is not compatible with SonarLint. Skip loading it.
Code analyzer 'ISBAN Security' is not compatible with SonarLint. Skip loading it.
Code analyzer 'Build Breaker' is not compatible with SonarLint. Skip loading it.
Code analyzer 'Governance' is not compatible with SonarLint. Skip loading it.
Code analyzer 'isbanjson' is not compatible with SonarLint. Skip loading it.
Load plugins (done) | time=61ms

Finally, I have downloaded SonarQube Scanner CLI and I have been able to execute the scan from command line.