Error in SonarLint for IntelliJ - Rules Metadata Extraction Failed

Environment:

  • Java: JetBrains s.r.o. 11.0.15
  • OS: Linux amd64
  • IDE: IntelliJ IDEA 2022.1.2
  • SonarLint: 6.7.0.45926
java.lang.IllegalStateException: Unable to extract rules metadata
	at o.ss.sl.core.rule.extractor.RulesDefinitionExtractor.extractRules(RulesDefinitionExtractor.java:40)
	at o.ss.sl.core.AbstractSonarLintEngine.loadPluginMetadata(AbstractSonarLintEngine.java:77)
	at o.ss.sl.core.ConnectedSonarLintEngineImpl.loadAnalysisContext(ConnectedSonarLintEngineImpl.java:171)
	at o.ss.sl.core.ConnectedSonarLintEngineImpl.start(ConnectedSonarLintEngineImpl.java:163)
	at o.ss.sl.core.ConnectedSonarLintEngineImpl.<init>(ConnectedSonarLintEngineImpl.java:153)
	at o.sl.ij.core.SonarLintEngineFactory.createEngine(SonarLintEngineFactory.java:96)
	at o.sl.ij.core.DefaultEngineManager.createConnectedEngine(DefaultEngineManager.java:144)
	at java.base/java.util.HashMap.computeIfAbsent(HashMap.java:1134)
	at o.sl.ij.core.DefaultEngineManager.getConnectedEngine(DefaultEngineManager.java:139)
	at o.sl.ij.core.DefaultEngineManager.getConnectedEngine(DefaultEngineManager.java:169)
	at o.sl.ij.core.ProjectBindingManager.getFacade(ProjectBindingManager.java:90)
	at o.sl.ij.core.ProjectBindingManager.getFacade(ProjectBindingManager.java:74)
	at o.sl.ij.analysis.LocalFileExclusions.filterWithServerExclusions(LocalFileExclusions.java:269)
	at o.sl.ij.analysis.LocalFileExclusions.retainNonExcludedFilesByModules(LocalFileExclusions.java:162)
	at o.sl.ij.analysis.AnalysisTask.filterAndGetByModule(AnalysisTask.java:192)
	at o.sl.ij.analysis.AnalysisTask.run(AnalysisTask.java:125)

Hello Thomas,

This stacktrace is truncated, by chance would you still have the full one ? Are you connected to SonarQube and if so which version is it ?
Thanks

Hi Damien

Our IT guys are running the service internally.

This is what I got from the user interface:

  • Enterprise Edition
  • Version 9.3 (build 51899)

Here is all I can get from the error window (this one I generated on Windows, FYI):

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.intellij.core.SonarLintEngineFactory.createEngine(SonarLintEngineFactory.java:96)
	at org.sonarlint.intellij.core.DefaultEngineManager.createConnectedEngine(DefaultEngineManager.java:144)
	at java.base/java.util.HashMap.computeIfAbsent(HashMap.java:1134)
	at org.sonarlint.intellij.core.DefaultEngineManager.getConnectedEngine(DefaultEngineManager.java:139)
	at org.sonarlint.intellij.core.ProjectBindingManager.getConnectedEngineSkipChecks(ProjectBindingManager.java:99)
	at org.sonarlint.intellij.core.ProjectBindingManager.getValidConnectedEngine(ProjectBindingManager.java:132)
	at org.sonarlint.intellij.issue.vulnerabilities.TaintVulnerabilitiesLoader.getTaintVulnerabilitiesByOpenedFiles(TaintVulnerabilitiesLoader.kt:43)
	at org.sonarlint.intellij.issue.vulnerabilities.TaintVulnerabilitiesPresenter$presentTaintVulnerabilitiesForOpenFiles$1.run(TaintVulnerabilitiesPresenter.kt:91)
	at com.intellij.openapi.progress.impl.CoreProgressManager.startTask(CoreProgressManager.java:442)
	at com.intellij.openapi.progress.impl.ProgressManagerImpl.startTask(ProgressManagerImpl.java:114)
	at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$runProcessWithProgressAsynchronously$5(CoreProgressManager.java:493)
	at com.intellij.openapi.progress.impl.ProgressRunner.lambda$submit$3(ProgressRunner.java:244)
	at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$runProcess$2(CoreProgressManager.java:189)
	at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$executeProcessUnderProgress$12(CoreProgressManager.java:608)
	at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:683)
	at com.intellij.openapi.progress.impl.CoreProgressManager.computeUnderProgress(CoreProgressManager.java:639)
	at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:607)
	at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:60)
	at com.intellij.openapi.progress.impl.CoreProgressManager.runProcess(CoreProgressManager.java:176)
	at com.intellij.openapi.progress.impl.ProgressRunner.lambda$submit$4(ProgressRunner.java:244)
	at java.base/java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1700)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
	at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1$1.run(Executors.java:668)
	at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1$1.run(Executors.java:665)
	at java.base/java.security.AccessController.doPrivileged(Native Method)
	at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1.run(Executors.java:665)
	at java.base/java.lang.Thread.run(Thread.java:829)
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)
	... 32 more
Caused by: java.lang.NoSuchMethodError: 'org.sonar.api.server.rule.RulesDefinition$NewRule org.sonar.api.server.rule.RulesDefinition$NewRule.setDebtSubCharacteristic(java.lang.String)'
	at org.sonar.squidbridge.annotations.AnnotationBasedRulesDefinition.setupSqaleModel(AnnotationBasedRulesDefinition.java:160)
	at org.sonar.squidbridge.annotations.AnnotationBasedRulesDefinition.addRuleClasses(AnnotationBasedRulesDefinition.java:100)
	at org.sonar.squidbridge.annotations.AnnotationBasedRulesDefinition.addRuleClasses(AnnotationBasedRulesDefinition.java:86)
	at org.sonar.plugins.objectscript.ObjectScriptSonarLintRulesDefinition.define(ObjectScriptSonarLintRulesDefinition.java:61)
	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:62)
	at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
	at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:490)
	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)
	... 38 more

I hope that helps.
Cheers
Thomas

Thomas,

Please have a look at the solution in this other thread, that corresponds exactly to what you observed

Damien,

I will inform our SonarQube mainainers about the issue.
Thanks.

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