Error in SonarLint for IntelliJ

Environment:

  • Java: JetBrains s.r.o. 17.0.10
  • OS: Windows 11 amd64
  • IDE: IntelliJ IDEA 2023.3.4
  • SonarLint: 10.4.0.77904
java.lang.IllegalStateException: Could not initialize SonarLint
	at o.sl.ij.core.BackendService.oneTimeInitialization(BackendService.kt:188)
	at o.sl.ij.core.BackendService.<init>(BackendService.kt:152)
	at o.sl.ij.core.BackendService.<init>(BackendService.kt:150)
	at java.base/java.lang.invoke.MethodHandle.invokeWithArguments(MethodHandle.java:732)
	at c.ij.platform.instanceContainer.instantiation.InstantiateKt$instantiate$2.invoke(instantiate.kt:41)
	at c.ij.platform.instanceContainer.instantiation.InstantiateKt$instantiate$2.invoke(instantiate.kt:39)
	at c.ij.platform.instanceContainer.instantiation.InstantiateKt.instantiate(instantiate.kt:278)
	at c.ij.platform.instanceContainer.instantiation.InstantiateKt.instantiate(instantiate.kt:39)
	at c.ij.serviceContainer.LightServiceInstanceSupport$LightServiceInstanceInitializer.createInstance(LightServiceInstanceSupport.kt:47)
	at c.ij.platform.instanceContainer.internal.LazyInstanceHolder$initialize$1$1.invokeSuspend(LazyInstanceHolder.kt:162)
	at c.ij.platform.instanceContainer.internal.LazyInstanceHolder$initialize$1$1.invoke(LazyInstanceHolder.kt)
	at c.ij.platform.instanceContainer.internal.LazyInstanceHolder$initialize$1$1.invoke(LazyInstanceHolder.kt)
	at kotlinx.coroutines.intrinsics.UndispatchedKt.startUndispatchedOrReturn(Undispatched.kt:78)
	at kotlinx.coroutines.BuildersKt__Builders_commonKt.withContext(Builders.common.kt:167)
	at kotlinx.coroutines.BuildersKt.withContext(Unknown Source)

There has been some instabilities in recent releases of SonarLint and AFAIK most of them should have been fixed by now. The latest release is 10.4.2.78113 and you are on 10.4.0.77904 so I would recommend that you upgrade and see if this fixes the issues.

Personally I’ve had to wait for the IDE to finish indexing, then restart, before SonarLint would work again.

Per https://plugins.jetbrains.com/plugin/7973-sonarlint:

  • 10.4.2 - Fix an issue where rule configuration is not loaded at startup. Stop the creation of configuration files at module level for storing module IDs. Improve performance during synchronization on large projects. Various bug fixes.
  • 10.4.1 - Fix various errors when starting the SonarLint service. Fix an error when using a proxy.
2 Likes