Error in SonarLint for IntelliJ NullPointerException AbstractSonarLintEngine

Environment:

  • Java: JetBrains s.r.o. 11.0.11
  • OS: Windows 10 amd64
  • IDE: IntelliJ IDEA 2021.2
  • SonarLint: 5.3.0.36775

*** exception class was changed or removed

java.lang.NullPointerException
	at o.ss.sl.core.AbstractSonarLintEngine.lambda$declareModule$0(AbstractSonarLintEngine.java:54)
	at o.ss.sl.core.AbstractSonarLintEngine.withRwLock(AbstractSonarLintEngine.java:109)
	at o.ss.sl.core.AbstractSonarLintEngine.declareModule(AbstractSonarLintEngine.java:54)
	at o.sl.ij.module.Modules$declareModule$$inlined$let$lambda$1.run(ModuleChangeListener.kt:57)
	at c.ij.oa.application.impl.ApplicationImpl$1.run(ApplicationImpl.java:265)
	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)

Hello @Fokko_van_der_Wal,
Thank you for your report and welcome to the community!
I’ve created ticket based on your report: [SLI-617] NPE during module declaration - SonarSource
Would be great if you provided more details about situation when you had this exception. Do you connect your SonarLint to SonarQube or SonarCloud server? Was once or several times? Ideally - what exactly was you actions to get this.

I opened a “recent project” in IntelliJ, which was already connected to SonarQube, but got this error.
After re-configuring the SonarQube-connection (Edit-next-next-finish) the “Open recent project” didn’t fail with this error. But the next day this error re-appeared. So re-configuring the connection seems to help temporarily.
I hope this error can be reproduced on another environment. It’s not breaking but annoying.
I use a Windows-10 Hyper-V.

Hello @Fokko_van_der_Wal,

We reworked this part of the code recently, and this issue should have disappeared in the latest release. Could you please update and check if it is really gone for you ?
Thanks!