Error in SonarLint for IntelliJ 2022.1.1 - One more

Environment:

  • Java: JetBrains s.r.o. 11.0.14.1
  • OS: Mac OS X x86_64
  • IDE: IntelliJ IDEA 2022.1.1
  • SonarLint: 6.7.0.45926

The SonarLint plugin crashes more often than all the others plugins combined!

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.ui.AutoTriggerStatusPanel.lambda$switchCards$2(AutoTriggerStatusPanel.java:87)

Hello @alotia,

This stack trace is truncated, would you still have the full one ? Are you connected to SonarQube ?

This is what got included as a result of ‘submit this issue’. Let me try once more… Our SonarQube installation was upgraded about a couple of weeks ago, but the plugin was working – with its occasional crashes – until yesterday.

Hope this one helps…

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.config.global.ServerConnectionMgmtPanel.lambda$switchTo$2(ServerConnectionMgmtPanel.java:275)
	at com.intellij.openapi.application.impl.ApplicationImpl$1.run(ApplicationImpl.java:295)
	at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
	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)
	... 19 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)
	... 25 more

What version of SonarQube are you using now ?

The error happens because NewRule.setDebtSubCharacteristic has been removed a few months ago from Sonar products. This method was deprecated since SonarQube 5.5 (early 2016)!

It appears that one plugin installed on your server still uses this old API. A similar error was recently reported in this thread.

I would recommend the same solution, contact the maintainers to update the plugin or remove it if you don’t really use it.

Thanks for reporting!

Our SonarQube was upgraded to v9.3. I will contact the group that manages SonarQube and pass on the this information. Thanks for your quick help on this. Please feel free to close the ticket as resolved.

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