[ERR] [Eclipse] Unable to start connected SonarLint engine : error extract rules metadata

Hi Community!

I manage support from few ABAP teams. From few days (or weeks) they are telling there is something broken. So I’m investigating about a problem about SonarLint on Eclipse. I have only found this article, so i tried something around…
java - SonarLint on eclipse : Unable to start standalone SonarLint engine - Stack Overflow

It’s appear there is something happening with embedded JRE 16 and SonarLint latest version from the Eclipse Marketplace.
How To bypass error : downgrade -vm option (eclipse.ini) from JRE embedded v16 to OpenJDK v11
At this night time, i haven’t validate this trick with others.

If someone have an idea, if there is something to do. :slight_smile:

IDE : Eclipse on Windows x86
Eclipse Version: 2021-06 (4.20.0)
Eclipse Build id: 20210612-2011

SonarLint version : SonarLint for Eclipse 7.4.0.46482 org.sonarlint.eclipse.feature
Sonarlint Connected mode with Sonarqube LTS 8.9

FULL LOGS:

Summary
GET 200 https://XXXXXXXXXXXX/sonar/api/components/show.protobuf?component=XXXX | response time=526ms
Downloaded project details in 561ms

GET 200 https://XXXXXXXXXXXX/sonar/api/system/status | response time=46ms
Downloaded server infos in 48ms
GET 200 https://XXXXXXXXXXXX/sonar/api/authentication/validate?format=json | response time=45ms
GET 200 https://XXXXXXXXXXXX/sonar/api/developers/search_events?projects=&from= | response time=42ms
GET 200 https://XXXXXXXXXXXX/sonar/api/system/status | response time=59ms
Downloaded server infos in 59ms
GET 200 https://XXXXXXXXXXXX/sonar/api/authentication/validate?format=json | response time=48ms
Starting SonarLint engine for connection 'XXXXXXXXXXXX'...
Found Secrets detection plugin: bundleentry://440.fwk1927891560/plugins/sonar-secrets-plugin-1.1.0.36766.jar
Found JS/TS detection plugin: bundleentry://440.fwk1927891560/plugins/sonar-javascript-plugin-9.1.0.17747.jar
Found HTML detection plugin: bundleentry://440.fwk1927891560/plugins/sonar-html-plugin-3.6.0.3106.jar
Plugin 'JavaScript/TypeScript/CSS Code Quality and Security' requires Node.js 12.22.0. Skip loading it.
Plugin 'JavaScript Custom Rules' dependency on 'javascript' is unsatisfied. Skip loading it.
Plugin 'ecocodephpcustom' embeds dependencies. This will be deprecated soon. Plugin should be updated.
Plugin 'javacustom' embeds dependencies. This will be deprecated soon. Plugin should be updated.
Plugin 'rpg' embeds dependencies. This will be deprecated soon. Plugin should be updated.
Plugin 'secrets' embeds dependencies. This will be deprecated soon. Plugin should be updated.
Plugin 'phpcustom' embeds dependencies. This will be deprecated soon. Plugin should be updated.
Plugin 'cobol' embeds dependencies. This will be deprecated soon. Plugin should be updated.
Plugin 'ecodejavacustom' embeds dependencies. This will be deprecated soon. Plugin should be updated.
Loaded 21 plugins
  * Python Code Quality and Security 3.4.1.8066 (python)
  * Ecocode PHP Custom Rules 1.0.0-SNAPSHOT (ecocodephpcustom)
  * Java Custom Rules 1.0-SNAPSHOT (javacustom)
  * Kotlin Code Quality and Security 1.8.3.2219 (kotlin)
  * RPG Code Quality 2.5.1.2575 (rpg)
  * PL/I Code Quality and Security 1.11.1.2727 (pli)
  * T-SQL Code Quality and Security 1.5.1.4340 (tsql)
  * Sonar Secrets Plugin for SonarQube 1.1.0.36766 (secrets)
  * Apex Code Quality and Security 1.8.3.2219 (sonarapex)
  * PL/SQL Code Quality and Security 3.6.1.3873 (plsql)
  * Ruby Code Quality and Security 1.8.3.2219 (ruby)
  * Scala Code Quality and Security 1.8.3.2219 (sonarscala)
  * License for SonarLint 8.9.1.44547 (license)
  * PHP Custom Rules 1.0-SNAPSHOT (phpcustom)
  * Java Code Quality and Security 6.15.1.26025 (java)
  * COBOL Code Quality 4.6.2.4876 (cobol)
  * HTML Code Quality and Security 3.6.0.3106 (web)
  * XML Code Quality and Security 2.2.0.2973 (xml)
  * PHP Code Quality and Security 3.17.0.7439 (php)
  * Ecoconception Web / Les 115 bonnes pratiques 1.0.0-SNAPSHOT (ecodejavacustom)
  * ABAP Code Quality and Security 3.9.1.3127 (abap)
Unable to start connected SonarLint engine
java.lang.IllegalStateException: Unable to extract rules metadata
	at org.sonarsource.sonarlint.core.rule.extractor.RulesDefinitionExtractor.extractRules(RulesDefinitionExtractor.java:40)
	at org.sonarsource.sonarlint.core.AbstractSonarLintEngine.loadPluginMetadata(AbstractSonarLintEngine.java:77)
	at org.sonarsource.sonarlint.core.ConnectedSonarLintEngineImpl.loadAnalysisContext(ConnectedSonarLintEngineImpl.java:171)
	at org.sonarsource.sonarlint.core.ConnectedSonarLintEngineImpl.start(ConnectedSonarLintEngineImpl.java:163)
	at org.sonarsource.sonarlint.core.ConnectedSonarLintEngineImpl.<init>(ConnectedSonarLintEngineImpl.java:153)
	at org.sonarlint.eclipse.core.internal.engine.connected.ConnectedEngineFacade.getOrCreateEngine(ConnectedEngineFacade.java:146)
	at org.sonarlint.eclipse.core.internal.engine.connected.ConnectedEngineFacade.doWithEngine(ConnectedEngineFacade.java:207)
	at org.sonarlint.eclipse.core.internal.engine.connected.ConnectedEngineFacade.updateStorage(ConnectedEngineFacade.java:374)
	at org.sonarlint.eclipse.core.internal.jobs.ServerUpdateJob.run(ServerUpdateJob.java:45)
	at org.eclipse.core.internal.jobs.Worker.run(Worker.java:63)
Caused by: java.lang.IllegalStateException: Unable to load component class org.sonarsource.sonarlint.core.rule.extractor.RuleDefinitionsLoader
	at org.sonarsource.sonarlint.core.plugin.commons.pico.ComponentContainer$ExtendedDefaultPicoContainer.getComponent(ComponentContainer.java:57)
	at org.sonarsource.sonarlint.shaded.org.picocontainer.DefaultPicoContainer.getComponent(DefaultPicoContainer.java:678)
	at org.sonarsource.sonarlint.core.plugin.commons.pico.ComponentContainer.getComponentByType(ComponentContainer.java:249)
	at org.sonarsource.sonarlint.core.rule.extractor.RulesDefinitionExtractorContainer.doAfterStart(RulesDefinitionExtractorContainer.java:79)
	at org.sonarsource.sonarlint.core.plugin.commons.pico.ComponentContainer.startComponents(ComponentContainer.java:119)
	at org.sonarsource.sonarlint.core.plugin.commons.pico.ComponentContainer.execute(ComponentContainer.java:104)
	at org.sonarsource.sonarlint.core.rule.extractor.RulesDefinitionExtractor.extractRules(RulesDefinitionExtractor.java:37)
	... 9 more
Caused by: java.lang.NullPointerException: Cannot invoke "javax.script.ScriptEngine.eval(String)" because the return value of "javax.script.ScriptEngineManager.getEngineByName(String)" is null
	at org.sonarsource.analyzer.commons.JsonParser.<init>(JsonParser.java:36)
	at org.sonarsource.analyzer.commons.ProfileDefinitionReader.loadActiveKeysFromJsonProfile(ProfileDefinitionReader.java:59)
	at org.sonarsource.analyzer.commons.RuleMetadataLoader.<init>(RuleMetadataLoader.java:60)
	at org.sonar.plugins.php.PHPRulesDefinition.define(PHPRulesDefinition.java:37)
	at org.sonarsource.sonarlint.core.rule.extractor.RuleDefinitionsLoader.<init>(RuleDefinitionsLoader.java:38)
	at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
	at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:78)
	at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
	at java.base/java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:499)
	at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:480)
	at org.sonarsource.sonarlint.shaded.org.picocontainer.injectors.AbstractInjector.newInstance(AbstractInjector.java:145)
	at org.sonarsource.sonarlint.shaded.org.picocontainer.injectors.ConstructorInjector$1.run(ConstructorInjector.java:342)
	at org.sonarsource.sonarlint.shaded.org.picocontainer.injectors.AbstractInjector$ThreadLocalCyclicDependencyGuard.observe(AbstractInjector.java:270)
	at org.sonarsource.sonarlint.shaded.org.picocontainer.injectors.ConstructorInjector.getComponentInstance(ConstructorInjector.java:364)
	at org.sonarsource.sonarlint.shaded.org.picocontainer.injectors.AbstractInjectionFactory$LifecycleAdapter.getComponentInstance(AbstractInjectionFactory.java:56)
	at org.sonarsource.sonarlint.shaded.org.picocontainer.behaviors.AbstractBehavior.getComponentInstance(AbstractBehavior.java:64)
	at org.sonarsource.sonarlint.shaded.org.picocontainer.behaviors.Stored.getComponentInstance(Stored.java:91)
	at org.sonarsource.sonarlint.shaded.org.picocontainer.DefaultPicoContainer.getInstance(DefaultPicoContainer.java:699)
	at org.sonarsource.sonarlint.shaded.org.picocontainer.DefaultPicoContainer.getComponent(DefaultPicoContainer.java:647)
	at org.sonarsource.sonarlint.core.plugin.commons.pico.ComponentContainer$ExtendedDefaultPicoContainer.getComponent(ComponentContainer.java:55)
	... 15 more

Hey there.

It looks like you’ve coded some custom PHP rules – does the issue persist if this plugin is not installed?

Thanks for you support!

Different plugins weren’t updating for 1 year. So it was the good direction to investigate.
So after a lot of try/errors installations with a vanilla Eclipse and a Sonarqube Server, i found my shoe’s stone.
It was complex. The suppression on the server is not enough to test the new configuration. I have to create on Eclipse a new Sonarqube connection Binding with an other ID, like a timestamps ID to make isolated test because references to the plugin persist somewhere.

I may have to look guideline to updating each custom plugins.

Hello Louis,

If you modify some plugins on the server, you normally don’t need to re-create the connection in Eclipse, you can update the binding on the project. You can do this in the SonarLint Bindings view, right click on the connection and click Update All Project Bindings.

As the problem seems related to a 3rd party plugin, I will close this thread. Feel free to open a new one if you need more specific details

Hi Damien,
I have verify your expected behaviour and it’s not the case.

  • Done a Binding connection with broken plugin ( PHP Custom Rules 1.0-SNAPSHOT (phpcustom)) Sonarqube Server
    → Log “Unable to start connected SonarLint engine”
  • Suppressed the broken plugin custom from Sonarqube Server
  • Clicked “Update all projects Bindings”
    → Log “Unable to start connected SonarLint engine”
Log : Unable to start connected SonarLint engine

Starting SonarLint engine for connection ‘XXXXXXXX_20220516_1406’…
Found Secrets detection plugin: bundleentry://470.fwk1718753357/plugins/sonar-secrets-plugin-1.1.0.36766.jar
Found JS/TS detection plugin: bundleentry://470.fwk1718753357/plugins/sonar-javascript-plugin-9.1.0.17747.jar
Found HTML detection plugin: bundleentry://470.fwk1718753357/plugins/sonar-html-plugin-3.6.0.3106.jar
Plugin ‘ecocodephpcustom’ embeds dependencies. This will be deprecated soon. Plugin should be updated.
Plugin ‘rpg’ embeds dependencies. This will be deprecated soon. Plugin should be updated.
Plugin ‘secrets’ embeds dependencies. This will be deprecated soon. Plugin should be updated.
Plugin ‘phpcustom’ embeds dependencies. This will be deprecated soon. Plugin should be updated.
Plugin ‘cobol’ embeds dependencies. This will be deprecated soon. Plugin should be updated.
Plugin ‘ecodejavacustom’ embeds dependencies. This will be deprecated soon. Plugin should be updated.
Loaded 21 plugins

  • Python Code Quality and Security 3.4.1.8066 (python)
  • Ecocode PHP Custom Rules 1.0.0-SNAPSHOT (ecocodephpcustom)
  • Kotlin Code Quality and Security 1.8.3.2219 (kotlin)
  • RPG Code Quality 2.5.1.2575 (rpg)
  • PL/I Code Quality and Security 1.11.1.2727 (pli)
  • T-SQL Code Quality and Security 1.5.1.4340 (tsql)
  • Apex Code Quality and Security 1.8.3.2219 (sonarapex)
  • Sonar Secrets Plugin for SonarQube 1.1.0.36766 (secrets)
  • JavaScript/TypeScript/CSS Code Quality and Security 9.1.0.17747 (javascript)
  • Ruby Code Quality and Security 1.8.3.2219 (ruby)
  • PL/SQL Code Quality and Security 3.6.1.3873 (plsql)
  • Scala Code Quality and Security 1.8.3.2219 (sonarscala)
  • License for SonarLint 8.9.1.44547 (license)
  • PHP Custom Rules 1.0-SNAPSHOT (phpcustom)
  • Java Code Quality and Security 6.15.1.26025 (java)
  • COBOL Code Quality 4.6.2.4876 (cobol)
  • HTML Code Quality and Security 3.6.0.3106 (web)
  • XML Code Quality and Security 2.2.0.2973 (xml)
  • PHP Code Quality and Security 3.17.0.7439 (php)
  • Ecoconception Web / Les 115 bonnes pratiques 1.0.0-SNAPSHOT (ecodejavacustom)
  • ABAP Code Quality and Security 3.9.1.3127 (abap)
    Unable to start connected SonarLint engine
    java.lang.IllegalStateException: Unable to extract rules metadata
    at org.sonarsource.sonarlint.core.rule.extractor.RulesDefinitionExtractor.extractRules(RulesDefinitionExtractor.java:40)
    at org.sonarsource.sonarlint.core.AbstractSonarLintEngine.loadPluginMetadata(AbstractSonarLintEngine.java:77)
    at org.sonarsource.sonarlint.core.ConnectedSonarLintEngineImpl.loadAnalysisContext(ConnectedSonarLintEngineImpl.java:171)
    at org.sonarsource.sonarlint.core.ConnectedSonarLintEngineImpl.start(ConnectedSonarLintEngineImpl.java:163)
    at org.sonarsource.sonarlint.core.ConnectedSonarLintEngineImpl.(ConnectedSonarLintEngineImpl.java:153)
    at org.sonarlint.eclipse.core.internal.engine.connected.ConnectedEngineFacade.getOrCreateEngine(ConnectedEngineFacade.java:146)
    at org.sonarlint.eclipse.core.internal.engine.connected.ConnectedEngineFacade.doWithEngine(ConnectedEngineFacade.java:207)
    at org.sonarlint.eclipse.core.internal.engine.connected.ConnectedEngineFacade.sync(ConnectedEngineFacade.java:655)
    at org.sonarlint.eclipse.core.internal.jobs.ServerUpdateJob.run(ServerUpdateJob.java:70)
    at org.eclipse.core.internal.jobs.Worker.run(Worker.java:63)
    Caused by: java.lang.IllegalStateException: Unable to load component class org.sonarsource.sonarlint.core.rule.extractor.RuleDefinitionsLoader
    at org.sonarsource.sonarlint.core.plugin.commons.pico.ComponentContainer$ExtendedDefaultPicoContainer.getComponent(ComponentContainer.java:57)
    at org.sonarsource.sonarlint.shaded.org.picocontainer.DefaultPicoContainer.getComponent(DefaultPicoContainer.java:678)
    at org.sonarsource.sonarlint.core.plugin.commons.pico.ComponentContainer.getComponentByType(ComponentContainer.java:249)
    at org.sonarsource.sonarlint.core.rule.extractor.RulesDefinitionExtractorContainer.doAfterStart(RulesDefinitionExtractorContainer.java:79)
    at org.sonarsource.sonarlint.core.plugin.commons.pico.ComponentContainer.startComponents(ComponentContainer.java:119)
    at org.sonarsource.sonarlint.core.plugin.commons.pico.ComponentContainer.execute(ComponentContainer.java:104)
    at org.sonarsource.sonarlint.core.rule.extractor.RulesDefinitionExtractor.extractRules(RulesDefinitionExtractor.java:37)
    … 9 more
    Caused by: java.lang.NullPointerException: Cannot invoke “javax.script.ScriptEngine.eval(String)” because the return value of “javax.script.ScriptEngineManager.getEngineByName(String)” is null
    at org.sonarsource.analyzer.commons.JsonParser.(JsonParser.java:36)
    at org.sonarsource.analyzer.commons.RuleMetadataLoader.(RuleMetadataLoader.java:65)
    at org.sonarsource.analyzer.commons.RuleMetadataLoader.(RuleMetadataLoader.java:51)
    at fr.cnumr.php.MyPhpRules.define(MyPhpRules.java:64)
    at org.sonarsource.sonarlint.core.rule.extractor.RuleDefinitionsLoader.(RuleDefinitionsLoader.java:38)
    at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:78)
    at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
    at java.base/java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:499)
    at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:480)
    at org.sonarsource.sonarlint.shaded.org.picocontainer.injectors.AbstractInjector.newInstance(AbstractInjector.java:145)
    at org.sonarsource.sonarlint.shaded.org.picocontainer.injectors.ConstructorInjector$1.run(ConstructorInjector.java:342)
    at org.sonarsource.sonarlint.shaded.org.picocontainer.injectors.AbstractInjector$ThreadLocalCyclicDependencyGuard.observe(AbstractInjector.java:270)
    at org.sonarsource.sonarlint.shaded.org.picocontainer.injectors.ConstructorInjector.getComponentInstance(ConstructorInjector.java:364)
    at org.sonarsource.sonarlint.shaded.org.picocontainer.injectors.AbstractInjectionFactory$LifecycleAdapter.getComponentInstance(AbstractInjectionFactory.java:56)
    at org.sonarsource.sonarlint.shaded.org.picocontainer.behaviors.AbstractBehavior.getComponentInstance(AbstractBehavior.java:64)
    at org.sonarsource.sonarlint.shaded.org.picocontainer.behaviors.Stored.getComponentInstance(Stored.java:91)
    at org.sonarsource.sonarlint.shaded.org.picocontainer.DefaultPicoContainer.getInstance(DefaultPicoContainer.java:699)
    at org.sonarsource.sonarlint.shaded.org.picocontainer.DefaultPicoContainer.getComponent(DefaultPicoContainer.java:647)
    at org.sonarsource.sonarlint.core.plugin.commons.pico.ComponentContainer$ExtendedDefaultPicoContainer.getComponent(ComponentContainer.java:55)
    … 15 more

With a new connection id XXXX_20220516_1424, i got only 20 plugins loaded as expected.

May be there is something to do to improve the setup step.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.