Error in SonarLint for IntelliJ on Start Up

Environment:

  • Java: JetBrains s.r.o. 17.0.7
  • OS: Linux amd64
  • IDE: CLion 2023.1.4
  • SonarLint: 8.3.0.71062
java.lang.NumberFormatException: For input string: ""
	at java.base/java.lang.NumberFormatException.forInputString(NumberFormatException.java:67)
	at java.base/java.lang.Integer.parseInt(Integer.java:678)
	at java.base/java.lang.Integer.parseInt(Integer.java:786)
	at org.sonarsource.sonarlint.core.commons.Version.<init>(Version.java:44)
	at org.sonarsource.sonarlint.core.commons.Version.create(Version.java:139)
	at org.sonarsource.sonarlint.core.serverconnection.storage.ServerInfoStorage.adapt(ServerInfoStorage.java:61)
	at org.sonarsource.sonarlint.core.serverconnection.storage.ServerInfoStorage.lambda$read$1(ServerInfoStorage.java:53)
	at org.sonarsource.sonarlint.core.serverconnection.storage.RWLock.read(RWLock.java:32)
	at org.sonarsource.sonarlint.core.serverconnection.storage.ServerInfoStorage.read(ServerInfoStorage.java:53)
	at org.sonarsource.sonarlint.core.hotspot.HotspotServiceImpl.isLocalDetectionSupported(HotspotServiceImpl.java:170)
	at org.sonarsource.sonarlint.core.hotspot.HotspotServiceImpl.checkLocalDetectionSupported(HotspotServiceImpl.java:110)
	at org.sonarlint.intellij.core.BackendService.checkLocalSecurityHotspotDetectionSupported(BackendService.kt:295)
	at org.sonarlint.intellij.finding.hotspot.SecurityHotspotsPresenter.presentSecurityHotspotsForOpenFiles(SecurityHotspotsPresenter.kt:39)
	at org.sonarlint.intellij.finding.hotspot.SecurityHotspotsRefreshTrigger.triggerRefresh(SecurityHotspotsRefreshTrigger.kt:66)
	at org.sonarlint.intellij.finding.hotspot.SecurityHotspotsRefreshTrigger.subscribeToTriggeringEvents(SecurityHotspotsRefreshTrigger.kt:62)
	at org.sonarlint.intellij.StartServicesOnProjectOpened.runActivity(StartServicesOnProjectOpened.java:49)
	at com.intellij.ide.startup.impl.StartupManagerImpl.runActivityAndMeasureDuration(StartupManagerImpl.kt:328)
	at com.intellij.ide.startup.impl.StartupManagerImpl.access$runActivityAndMeasureDuration(StartupManagerImpl.kt:69)
	at com.intellij.ide.startup.impl.StartupManagerImpl$runPostStartupActivities$4$3.invoke$lambda$0(StartupManagerImpl.kt:284)
	at com.intellij.openapi.project.SmartModeScheduler.doRun(SmartModeScheduler.kt:124)
	at com.intellij.openapi.project.SmartModeScheduler.runAllWhileSmart(SmartModeScheduler.kt:117)
	at com.intellij.openapi.application.TransactionGuardImpl.runWithWritingAllowed(TransactionGuardImpl.java:209)
	at com.intellij.openapi.application.TransactionGuardImpl.access$100(TransactionGuardImpl.java:21)
	at com.intellij.openapi.application.TransactionGuardImpl$1.run(TransactionGuardImpl.java:191)
	at com.intellij.openapi.application.impl.ApplicationImpl.runIntendedWriteActionOnCurrentThread(ApplicationImpl.java:831)
	at com.intellij.openapi.application.impl.ApplicationImpl$3.run(ApplicationImpl.java:456)
	at com.intellij.openapi.application.impl.FlushQueue.doRun(FlushQueue.java:79)
	at com.intellij.openapi.application.impl.FlushQueue.runNextEvent(FlushQueue.java:122)
	at com.intellij.openapi.application.impl.FlushQueue.flushNow(FlushQueue.java:41)
	at java.desktop/java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:318)
	at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:788)
	at java.desktop/java.awt.EventQueue$3.run(EventQueue.java:739)
	at java.desktop/java.awt.EventQueue$3.run(EventQueue.java:731)
	at java.base/java.security.AccessController.doPrivileged(AccessController.java:399)
	at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:86)
	at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:758)
	at com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.kt:667)
	at com.intellij.ide.IdeEventQueue._dispatchEvent$lambda$7(IdeEventQueue.kt:571)
	at com.intellij.openapi.application.impl.ApplicationImpl.withoutImplicitRead(ApplicationImpl.java:1446)
	at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.kt:571)
	at com.intellij.ide.IdeEventQueue.access$_dispatchEvent(IdeEventQueue.kt:68)
	at com.intellij.ide.IdeEventQueue$dispatchEvent$processEventRunnable$1$1$1.compute(IdeEventQueue.kt:349)
	at com.intellij.ide.IdeEventQueue$dispatchEvent$processEventRunnable$1$1$1.compute(IdeEventQueue.kt:348)
	at com.intellij.openapi.progress.impl.CoreProgressManager.computePrioritized(CoreProgressManager.java:787)
	at com.intellij.ide.IdeEventQueue$dispatchEvent$processEventRunnable$1$1.invoke(IdeEventQueue.kt:348)
	at com.intellij.ide.IdeEventQueue$dispatchEvent$processEventRunnable$1$1.invoke(IdeEventQueue.kt:343)
	at com.intellij.ide.IdeEventQueueKt.performActivity$lambda$1(IdeEventQueue.kt:995)
	at com.intellij.openapi.application.TransactionGuardImpl.performActivity(TransactionGuardImpl.java:105)
	at com.intellij.ide.IdeEventQueueKt.performActivity(IdeEventQueue.kt:995)
	at com.intellij.ide.IdeEventQueue.dispatchEvent$lambda$4(IdeEventQueue.kt:343)
	at com.intellij.openapi.application.impl.ApplicationImpl.runIntendedWriteActionOnCurrentThread(ApplicationImpl.java:831)
	at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.kt:385)
	at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:207)
	at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:128)
	at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:117)
	at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:113)
	at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:105)
	at java.desktop/java.awt.EventDispatchThread.run(EventDispatchThread.java:92)

“Update local storage” in “Tools → SonarLint → Project Settings → Bind project to SonarQube / SonarCloud” seems to fix it.

Hi @Peace,

Thank you for your report! The SonarLint server version is stored under the system path for IntelliJ (~/.cache/JetBrains/<IDE>/sonarlint), perhaps you may have altered those files?

Also, are you using SonarLint in connected mode with SonarQube or SonarCloud? Do not hesitate to share if you have any details on specific things you did that may have led to this situation.

Lastly, updating local storage is indeed a good solution in such cases.

Thanks for using SonarLint! :sonarlint: