SonarLint not working in SystemWorkbench/ecplise with local eval server

I’m looking for some guidance on getting this to run, as the error does not really help me a lot.

SonarLint for Eclipse 5.9.0.31414 org.sonarlint.eclipse.feature.feature.group SonarSource
on
applicationXMI=org.eclipse.ui.workbench/LegacyIDE.e4xmi
awt.toolkit=sun.lwawt.macosx.LWCToolkit
eclipse.application=org.eclipse.ui.ide.workbench
eclipse.buildId=4.6.3.M20170301-0400
eclipse.commands=-os
macosx

Server is running 9.x.x.x. (installed 3 days ago)

SonarLint plugin installed via ecplise marketplace, then bound to a local server with a token. Upon starting an analysis this message comes up:

Error during execution of SonarLint analysis
org.sonarsource.sonarlint.core.client.api.exceptions.GlobalStorageUpdateRequiredException: Storage of server 'localhost_test' requires an update
	at org.sonarsource.sonarlint.core.ConnectedSonarLintEngineImpl.checkUpdateStatus(ConnectedSonarLintEngineImpl.java:227)
	at org.sonarsource.sonarlint.core.ConnectedSonarLintEngineImpl.withReadLock(ConnectedSonarLintEngineImpl.java:350)
	at org.sonarsource.sonarlint.core.ConnectedSonarLintEngineImpl.withReadLock(ConnectedSonarLintEngineImpl.java:342)
	at org.sonarsource.sonarlint.core.ConnectedSonarLintEngineImpl.analyze(ConnectedSonarLintEngineImpl.java:150)
	at org.sonarlint.eclipse.core.internal.engine.connected.ConnectedEngineFacade.lambda$13(ConnectedEngineFacade.java:361)
	at org.sonarlint.eclipse.core.internal.engine.connected.ConnectedEngineFacade.withEngine(ConnectedEngineFacade.java:154)
	at org.sonarlint.eclipse.core.internal.engine.connected.ConnectedEngineFacade.runAnalysis(ConnectedEngineFacade.java:360)
	at org.sonarlint.eclipse.core.internal.jobs.AnalyzeConnectedProjectJob.runAnalysis(AnalyzeConnectedProjectJob.java:70)
	at org.sonarlint.eclipse.core.internal.jobs.AnalyzeConnectedProjectJob.runAnalysis(AnalyzeConnectedProjectJob.java:1)
	at org.sonarlint.eclipse.core.internal.jobs.AbstractAnalyzeProjectJob.run(AbstractAnalyzeProjectJob.java:390)
	at org.sonarlint.eclipse.core.internal.jobs.AbstractAnalyzeProjectJob.runAnalysisAndUpdateMarkers(AbstractAnalyzeProjectJob.java:199)
	at org.sonarlint.eclipse.core.internal.jobs.AbstractAnalyzeProjectJob.doRun(AbstractAnalyzeProjectJob.java:161)
	at org.sonarlint.eclipse.core.internal.jobs.AbstractSonarProjectJob.run(AbstractSonarProjectJob.java:45)
	at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)

Hello, welcome to the community! And thank you for your question.

Usually, this means that you have to update your project’s binding to SonarQube:

  • Window > Show View > Other… > SonarLint > SonarLint Bindings
  • Right click on your server settings > Update All Project Bindings

With a server on localhost, this should take a few seconds to synchronize your analyzers and settings, and update SonarLint’s local storage.

If not, it would be great if you could send us a relevant extract of the SonarLint Console when calling the “Update All Project Bindings” action:

  • Window > Show View > Console
  • Select the SonarLint Console from the menu
    image
  • Enable “Verbose Output” and “Analysis logs” from the cogs menu
    image
  • Clear the console and trigger “Update All Project Bindings” again

I think this was very helpful… my guess is I need to (somehow) update my java version?

Starting SonarLint for Eclipse 5.9.0.31414
Starting SonarLint engine for connection 'localhost_test'...
Started security hotspot handler on port 64120
Unable to read server side exclusions. Check your binding.
org.sonarsource.sonarlint.core.client.api.exceptions.GlobalStorageUpdateRequiredException: Storage of server 'localhost_test' requires an update
	at org.sonarsource.sonarlint.core.ConnectedSonarLintEngineImpl.checkUpdateStatus(ConnectedSonarLintEngineImpl.java:227)
	at org.sonarsource.sonarlint.core.ConnectedSonarLintEngineImpl.withReadLock(ConnectedSonarLintEngineImpl.java:350)
	at org.sonarsource.sonarlint.core.ConnectedSonarLintEngineImpl.withReadLock(ConnectedSonarLintEngineImpl.java:342)
	at org.sonarsource.sonarlint.core.ConnectedSonarLintEngineImpl.getExcludedFiles(ConnectedSonarLintEngineImpl.java:238)
	at org.sonarlint.eclipse.core.internal.engine.connected.ConnectedEngineFacade.lambda$36(ConnectedEngineFacade.java:601)
	at org.sonarlint.eclipse.core.internal.engine.connected.ConnectedEngineFacade.withEngine(ConnectedEngineFacade.java:154)
	at org.sonarlint.eclipse.core.internal.engine.connected.ConnectedEngineFacade.getServerFileExclusions(ConnectedEngineFacade.java:601)
	at org.sonarlint.eclipse.core.internal.utils.FileExclusionsChecker.lambda$2(FileExclusionsChecker.java:76)
	at java.util.Optional.ifPresent(Optional.java:159)
	at org.sonarlint.eclipse.core.internal.utils.FileExclusionsChecker.filterExcludedFiles(FileExclusionsChecker.java:73)
	at org.sonarlint.eclipse.core.internal.utils.FileExclusionsChecker.isExcluded(FileExclusionsChecker.java:91)
	at org.sonarlint.eclipse.core.internal.jobs.AbstractAnalyzeProjectJob.lambda$2(AbstractAnalyzeProjectJob.java:124)
	at java.util.ArrayList.forEach(ArrayList.java:1255)
	at org.sonarlint.eclipse.core.internal.jobs.AbstractAnalyzeProjectJob.doRun(AbstractAnalyzeProjectJob.java:123)
	at org.sonarlint.eclipse.core.internal.jobs.AbstractSonarProjectJob.run(AbstractSonarProjectJob.java:45)
	at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)

SonarLint processing file /board_port.c...
Error during execution of SonarLint analysis
org.sonarsource.sonarlint.core.client.api.exceptions.GlobalStorageUpdateRequiredException: Storage of server 'localhost_test' requires an update
	at org.sonarsource.sonarlint.core.ConnectedSonarLintEngineImpl.checkUpdateStatus(ConnectedSonarLintEngineImpl.java:227)
	at org.sonarsource.sonarlint.core.ConnectedSonarLintEngineImpl.withReadLock(ConnectedSonarLintEngineImpl.java:350)
	at org.sonarsource.sonarlint.core.ConnectedSonarLintEngineImpl.withReadLock(ConnectedSonarLintEngineImpl.java:342)
	at org.sonarsource.sonarlint.core.ConnectedSonarLintEngineImpl.analyze(ConnectedSonarLintEngineImpl.java:150)
	at org.sonarlint.eclipse.core.internal.engine.connected.ConnectedEngineFacade.lambda$13(ConnectedEngineFacade.java:361)
	at org.sonarlint.eclipse.core.internal.engine.connected.ConnectedEngineFacade.withEngine(ConnectedEngineFacade.java:154)
	at org.sonarlint.eclipse.core.internal.engine.connected.ConnectedEngineFacade.runAnalysis(ConnectedEngineFacade.java:360)
	at org.sonarlint.eclipse.core.internal.jobs.AnalyzeConnectedProjectJob.runAnalysis(AnalyzeConnectedProjectJob.java:70)
	at org.sonarlint.eclipse.core.internal.jobs.AnalyzeConnectedProjectJob.runAnalysis(AnalyzeConnectedProjectJob.java:1)
	at org.sonarlint.eclipse.core.internal.jobs.AbstractAnalyzeProjectJob.run(AbstractAnalyzeProjectJob.java:390)
	at org.sonarlint.eclipse.core.internal.jobs.AbstractAnalyzeProjectJob.runAnalysisAndUpdateMarkers(AbstractAnalyzeProjectJob.java:199)
	at org.sonarlint.eclipse.core.internal.jobs.AbstractAnalyzeProjectJob.doRun(AbstractAnalyzeProjectJob.java:161)
	at org.sonarlint.eclipse.core.internal.jobs.AbstractSonarProjectJob.run(AbstractSonarProjectJob.java:45)
	at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)

Create : /Users/alexandernagel/.sonarlint/plugins
Plugin cache: /Users/alexandernagel/.sonarlint/plugins
Create : /Users/alexandernagel/.sonarlint/plugins/_tmp
GET 200 http://localhost:9000/api/system/status | response time=4ms
Downloaded server infos in 42ms
GET 200 http://localhost:9000/api/plugins/installed | response time=8ms
Downloaded plugin list in 15ms
GET 200 http://localhost:9000/api/settings/values.protobuf | response time=8ms
Downloaded settings in 53ms
Code analyzer 'csharp' is not compatible with SonarLint. Skip downloading it.
Code analyzer 'cssfamily' is not compatible with SonarLint. Skip downloading it.
Code analyzer 'flex' is not compatible with SonarLint. Skip downloading it.
Code analyzer 'go' is not compatible with SonarLint. Skip downloading it.
Code analyzer 'jacoco' is not compatible with SonarLint. Skip downloading it.
Code analyzer 'java' is not compatible with SonarLint. Skip downloading it.
Code analyzer 'swift' is not compatible with SonarLint. Skip downloading it.
Code analyzer 'vbnet' is not compatible with SonarLint. Skip downloading it.
Code analyzer 'security' is not compatible with SonarLint. Skip downloading it.
Code analyzer 'securitycsharpfrontend' is not compatible with SonarLint. Skip downloading it.
Code analyzer 'securityjsfrontend' is not compatible with SonarLint. Skip downloading it.
Code analyzer 'securityjavafrontend' is not compatible with SonarLint. Skip downloading it.
Code analyzer 'securityphpfrontend' is not compatible with SonarLint. Skip downloading it.
Code analyzer 'securitypythonfrontend' is not compatible with SonarLint. Skip downloading it.
GET 200 http://localhost:9000/api/rules/search.protobuf?f=repo,name,severity,lang,htmlDesc,htmlNote,internalKey,isTemplate,templateKey,actives&statuses=BETA,DEPRECATED,READY&types=CODE_SMELL,BUG,VULNERABILITY&severities=INFO&languages=abap,apex,c,cpp,cobol,web,js,kotlin,php,pli,plsql,py,rpg,ruby,scala,tsql,jsp,xml,xoo&p=1&ps=500 | response time=29ms
GET 200 http://localhost:9000/api/rules/search.protobuf?f=repo,name,severity,lang,htmlDesc,htmlNote,internalKey,isTemplate,templateKey,actives&statuses=BETA,DEPRECATED,READY&types=CODE_SMELL,BUG,VULNERABILITY&severities=MINOR&languages=abap,apex,c,cpp,cobol,web,js,kotlin,php,pli,plsql,py,rpg,ruby,scala,tsql,jsp,xml,xoo&p=1&ps=500 | response time=236ms
GET 200 http://localhost:9000/api/rules/search.protobuf?f=repo,name,severity,lang,htmlDesc,htmlNote,internalKey,isTemplate,templateKey,actives&statuses=BETA,DEPRECATED,READY&types=CODE_SMELL,BUG,VULNERABILITY&severities=MAJOR&languages=abap,apex,c,cpp,cobol,web,js,kotlin,php,pli,plsql,py,rpg,ruby,scala,tsql,jsp,xml,xoo&p=1&ps=500 | response time=248ms
GET 200 http://localhost:9000/api/rules/search.protobuf?f=repo,name,severity,lang,htmlDesc,htmlNote,internalKey,isTemplate,templateKey,actives&statuses=BETA,DEPRECATED,READY&types=CODE_SMELL,BUG,VULNERABILITY&severities=MAJOR&languages=abap,apex,c,cpp,cobol,web,js,kotlin,php,pli,plsql,py,rpg,ruby,scala,tsql,jsp,xml,xoo&p=2&ps=500 | response time=216ms
GET 200 http://localhost:9000/api/rules/search.protobuf?f=repo,name,severity,lang,htmlDesc,htmlNote,internalKey,isTemplate,templateKey,actives&statuses=BETA,DEPRECATED,READY&types=CODE_SMELL,BUG,VULNERABILITY&severities=CRITICAL&languages=abap,apex,c,cpp,cobol,web,js,kotlin,php,pli,plsql,py,rpg,ruby,scala,tsql,jsp,xml,xoo&p=1&ps=500 | response time=202ms
GET 200 http://localhost:9000/api/rules/search.protobuf?f=repo,name,severity,lang,htmlDesc,htmlNote,internalKey,isTemplate,templateKey,actives&statuses=BETA,DEPRECATED,READY&types=CODE_SMELL,BUG,VULNERABILITY&severities=BLOCKER&languages=abap,apex,c,cpp,cobol,web,js,kotlin,php,pli,plsql,py,rpg,ruby,scala,tsql,jsp,xml,xoo&p=1&ps=500 | response time=131ms
GET 200 http://localhost:9000/api/qualityprofiles/search.protobuf | response time=38ms
Downloaded quality profiles in 46ms
Page downloaded in 14ms
Create : /Users/lx/.sonarlint/plugins
Plugin cache: /Users/lx/.sonarlint/plugins
Create : /Users/lx/.sonarlint/plugins/_tmp
Load plugins
Load plugins (done) | time=21ms
Unable to start the SonarLint engine
java.lang.IllegalStateException: The plugin [license] does not support Java 1.8.0_151
	at org.sonarsource.sonarlint.core.plugin.PluginInstancesLoader.instantiatePluginClasses(PluginInstancesLoader.java:145)
	at org.sonarsource.sonarlint.core.plugin.PluginInstancesLoader.load(PluginInstancesLoader.java:75)
	at org.sonarsource.sonarlint.core.plugin.PluginRepository.start(PluginRepository.java:57)
	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:272)
	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:125)
	at org.sonarsource.sonarlint.core.ConnectedSonarLintEngineImpl.start(ConnectedSonarLintEngineImpl.java:119)
	at org.sonarsource.sonarlint.core.ConnectedSonarLintEngineImpl.lambda$update$2(ConnectedSonarLintEngineImpl.java:177)
	at org.sonarsource.sonarlint.core.ConnectedSonarLintEngineImpl.withRwLock(ConnectedSonarLintEngineImpl.java:333)
	at org.sonarsource.sonarlint.core.ConnectedSonarLintEngineImpl.update(ConnectedSonarLintEngineImpl.java:170)
	at org.sonarlint.eclipse.core.internal.engine.connected.ConnectedEngineFacade.lambda$15(ConnectedEngineFacade.java:387)
	at org.sonarlint.eclipse.core.internal.engine.connected.ConnectedEngineFacade.doWithEngine(ConnectedEngineFacade.java:164)
	at org.sonarlint.eclipse.core.internal.engine.connected.ConnectedEngineFacade.updateStorage(ConnectedEngineFacade.java:386)
	at org.sonarlint.eclipse.core.internal.jobs.ServerUpdateJob.run(ServerUpdateJob.java:50)
	at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)
Caused by: java.lang.UnsupportedClassVersionError: com/sonarsource/license/plugin/LicensePlugin has been compiled by a more recent version of the Java Runtime (class file version 55.0), this version of the Java Runtime only recognizes class file versions up to 52.0
	at java.lang.ClassLoader.defineClass1(Native Method)
	at java.lang.ClassLoader.defineClass(ClassLoader.java:763)
	at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
	at java.net.URLClassLoader.defineClass(URLClassLoader.java:467)
	at java.net.URLClassLoader.access$100(URLClassLoader.java:73)
	at java.net.URLClassLoader$1.run(URLClassLoader.java:368)
	at java.net.URLClassLoader$1.run(URLClassLoader.java:362)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.net.URLClassLoader.findClass(URLClassLoader.java:361)
	at org.sonar.classloader.ClassRealm.loadClassFromSelf(ClassRealm.java:125)
	at org.sonar.classloader.ParentFirstStrategy.loadClass(ParentFirstStrategy.java:37)
	at org.sonar.classloader.ClassRealm.loadClass(ClassRealm.java:87)
	at org.sonar.classloader.ClassRealm.loadClass(ClassRealm.java:76)
	at org.sonarsource.sonarlint.core.plugin.PluginInstancesLoader.instantiatePluginClasses(PluginInstancesLoader.java:143)
	... 26 more

GET 200 http://localhost:9000/api/developers/search_events?projects=iotventure_adat-firmware&from=2021-07-13T10%3A23%3A57%2B0200 | response time=9ms

Thank you for coming back with the additional details!

It seems that this dependency on the license plugin was overlooked in the work to move SonarQube’s scanner requirement from Java 8 to 11.

One possible workaround would be to use Java 11 to run SystemWorkbench, which you might have to install separately.

I am not familiar with how it is packaged for macOS, however there should be a file named eclipse.ini in the product’s folder (see e.g documentation here). Once you find the ini file, you should add the following lines at the beginning:

-vm
/<PATH_TO_JDK_11>/Contents/Home/bin/java
 ~/Downloads/sonarqube-9.0.0.45539  where java                                                                                                                      ✔  at 12:09:02 
/usr/bin/java
 ~/Downloads/sonarqube-9.0.0.45539  /usr/bin/java --version                                                                                                         ✔  at 12:09:09 
openjdk 11.0.10 2021-01-19
OpenJDK Runtime Environment (build 11.0.10+9)
OpenJDK 64-Bit Server VM (build 11.0.10+9, mixed mode)

I then added this path to /usr/bin/java to the ecplise.ini inside the app, still failing with the same information - next step is to actually do this on a linux-based machine as well =(

Hello,

It should work with a Java 11+ runtime, so maybe something else is at play. Would it be possible for you to share SystemWorkbench’s configuration? Something like:

Help > About > Installation Details > Configuration

If this pane contains too much private/confidential information, please feel free to send me a private message on this forum.

1 Like

Config, I suspect the ecplise.ini change I did wasn’t working or it needs more.

eclipse.info.log (606.3 KB)

Thank you for the configuration extract.

Indeed, it seems that the JRE in use is still the one embedded with SystemWorkbench, see lines 33-34 in the Eclipse info:

...
-vm
/Applications/Ac6/SystemWorkbench.app/Contents/MacOS/jre/Contents/Home/lib/jli/libjli.dylib
...

Could you please share the full eclipse.ini here? Maybe we can spot where the issue is.

Sure
eclipse.ini.log (756 Bytes)

Hello, thank you for the additional info.

I notice the following entry in the ini file:

-pluginCustomization
../Eclipse/configuration/st_pref.ini

Maybe some of the settings in st_pref.ini override the -vm argument above?

Little to add here:

org.eclipse.ui.ide/SAVE_ALL_BEFORE_BUILD=true
org.eclipse.cdt.core/indexer/indexUnusedHeadersWithDefaultLang=false

To add some information: on a windows machine under Win10, SystemWorkbench it also doesn’t work. Same message. Unfortunately we would need to find another way with the tools to check the plugin.

Hello, thanks for coming back.

This regression should be fixed in the next 9.x release, but this might take a few weeks to come.

In the meantime, may I suggest that you fall back to the latest LTS (8.9.1 as of writing this post)? It does not contain this regression about Java 11 vs Java 8, and the only drawback is that you’ll get analyzer versions from around the time it was released (mid-June).

Just asking to be sure: SonarQube LTS, or SonarLint? I installed the later via eclipse marketplace. Can this be triggered from SonarQube server?

Hello, this would be SonarQube 8.9.1 LTS: the issue you reported is caused by a regression introduced in SonarQube 9.0 that will be fixed in 9.1.

Unroll for the nitty-gritty details...

Starting with SonarQube 9.0, most components of SonarQube are now compiled with a target Java version of 11, while keeping compatibility with SonarLint’s connected mode which is still targeting Java 8 - for compatibility with, mainly, “old” Eclipse-based IDEs.

One component - specifically the one responsible for license management - was overlooked in this migration, hence the error you observe. This has been fixed for SonarQube 9.1, which AFAICT should be released mid-September.

Please note that although SonarQube and SonarLint share a common DNA, they are completely different products with separate release cycles.

For the time being, SonarLint does not have a concept of LTS :slight_smile: . Our compatibility policy is to fully support the last version of each target IDE and to keep compatibility with older versions for as long as technically possible, without resorting to separate builds/code bases. In the specific case of Eclipse, the earliest platform guaranteed (by integration tests) to work is Photon (released June 2018).