IntelliJ SonarLint 6.4.0.41939 NullPointerException

Hi,

since the new update following error occurs due to binding update.

Environment:

  • Java: JetBrains s.r.o. 11.0.13
  • OS: Windows 10 amd64
  • IDE: IntelliJ IDEA 2021.3.1
  • SonarLint: 6.4.0.41939
java.lang.NullPointerException: HTML description is mandatory in SonarLint
	at java.base/java.util.Objects.requireNonNull(Objects.java:246)
	at o.ss.sl.core.rule.extractor.SonarLintRuleDefinition.<init>(SonarLintRuleDefinition.java:53)
	at o.ss.sl.core.rule.extractor.RulesDefinitionExtractor.extractRules(RulesDefinitionExtractor.java:57)
	at o.ss.sl.core.AbstractSonarLintEngine.loadPluginMetadata(AbstractSonarLintEngine.java:83)
	at o.ss.sl.core.ConnectedSonarLintEngineImpl.loadAnalysisContext(ConnectedSonarLintEngineImpl.java:160)
	at o.ss.sl.core.ConnectedSonarLintEngineImpl.start(ConnectedSonarLintEngineImpl.java:152)
	at o.ss.sl.core.ConnectedSonarLintEngineImpl.<init>(ConnectedSonarLintEngineImpl.java:142)
	at o.sl.ij.core.SonarLintEngineFactory.createEngine(SonarLintEngineFactory.java:95)
	at java.base/java.util.HashMap.computeIfAbsent(HashMap.java:1134)
	at o.sl.ij.core.SonarLintEngineManager.getConnectedEngine(SonarLintEngineManager.java:134)
	at o.sl.ij.config.project.SonarLintProjectBindPanel.downloadProjectList(SonarLintProjectBindPanel.java:157)
	at o.sl.ij.config.project.SonarLintProjectBindPanel$2.actionPerformed(SonarLintProjectBindPanel.java:247)
	at java.desktop/javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1967)
	at java.desktop/javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2308)
	at java.desktop/javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:405)

Hi @kreake

We did a major code cleanup in this version (to prepare for incremental sync in connected mode) and we may have broken something.
To be sure of the source of the issue, can you please confirm that you have (at least) one custom rules plugin deployed on your SonarQube server?

This might be a bit advanced question if you are not the developer of this custom rules plugin, but just in case, do you know if this custom rules plugin have some rules without descriptions, or if they are using markdown description?

Anyway I created a ticket:
https://jira.sonarsource.com/browse/SLI-658

Hi @Julien_HENRY ,

Sorry that I cannot give you any more insight since I’m not able to see anything in the company im working in.

Thank you for the fast reply,

Cheers

Hi,
I get the same issue on a fresh install of sonarqube Version 9.2.4 (build 50792) on Linux and a clean installation of the plugin on my dev env. So it is not related to custom rules.

IDE Environment:

  • Java: J11.0.13+7-b1751.21 aarch64
  • OS: MacOS 12.1 Apple M1 Max (but same syndrome on an intel mac)
  • IDE: IntelliJ IDEA 2021.3.1
  • SonarLint: 6.4.0.41939

Hi @Paul_Schleger

Is it the community edition of SonarQube?

Hi Julien, yes.

The issue goes away with plugin sonarlint-intellij-6.3.1.40498.zip
But only if I manually clean out the previous sonarlint artefacts from the IntelliJ directories. Places like:

$HOME/Application Support/JetBrains/IntelliJIdea2021.3/options/sonarlint.xml
$HOME/Application Support/JetBrains/IntelliJIdea2021.3/plugins/sonarlint-intellij
$HOME/Application Support/JetBrains/IntelliJIdea2021.3/sonarlint

@Paul_Schleger I can not reproduce with a clean install of SonarQube 9.2.4. Are you sure you had the SonarLint binding updated? Can you double check you don’t have any custom plugin on SonarQube (in doubt, please send me the output of /api/plugins/installed)

Thanks

Hi @Julien_HENRY

I was about to get the information you requested, but couldn’t actually find that directory on the Linux server or my macbook. Since the macbook is quite new and was setup from scratch very recently, I decided to just delete IntelliJ and any app support stuff:

/Applications/IntelliJ IDEA.app
$HOME/Library/Application Support/JetBrains

Reinstalled IntelliJ IDEA from scratch, installed sonarlint 6.4.0.41939, setup my SonarQube connection, bound the project to SonarQube and the error no longer appears.

So the good news is, it “works on my machine” now too. The bad news is, I can’t reproduce the issue anymore. All I can say is that a full clean-out of everything IntelliJ IDEA related on the IDE side seems to be a workaround.

Thanks.

OK, thanks @Paul_Schleger . I guess a custom plugin was there in the SonarLint cache. Anyway we are going to fix the issue in the next release.

Hi @Julien_HENRY ,

Can you tell me the schedule for the next release?

Thank you and cheers

Probably this week. I will update this thread when it is done.

Would you mind trying this artifact? If you confirm the bug is fixed, I will release tomorrow.
https://repox.jfrog.io/repox/sonarsource/org/sonarsource/sonarlint/intellij/sonarlint-intellij/6.4.1.42104/sonarlint-intellij-6.4.1.42104.zip

@Julien_HENRY I have the same issue as described here above. When using the new artifact (6.4.1.42104) SonarLint works normal again. When putting back the old artifact (6.4.0.41939), the NullPointerException returns again. So for me, the fix is working.

OS: Windows 10.0.19042.1415
IDE: IntelliJ IDEA 2021.3.1
SonarLint: 6.4.0.41939
Sonarqube: Community EditionVersion 8.9.6 (build 50800)
1 Like

Bugfix 6.4.1.42145 has been released and is available on the marketplace.

Thanks all for the feedback, and sorry for the inconvenience!

1 Like

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