Error in SonarLint for IntelliJ - NumberFormatException: For input string

Environment:

  • Java: JetBrains s.r.o. 17.0.10
  • OS: Windows 10 amd64
  • IDE: IntelliJ IDEA 2023.3.4
  • SonarLint: 10.3.0.77475
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 o.ss.sl.core.commons.Version.<init>(Version.java:44)
	at o.ss.sl.core.commons.Version.create(Version.java:139)
	at o.ss.sl.core.serverconnection.storage.ServerInfoStorage.adapt(ServerInfoStorage.java:61)
	at o.ss.sl.core.serverconnection.storage.ServerInfoStorage.lambda$read$1(ServerInfoStorage.java:53)
	at o.ss.sl.core.serverconnection.storage.RWLock.read(RWLock.java:32)
	at o.ss.sl.core.serverconnection.storage.ServerInfoStorage.read(ServerInfoStorage.java:53)
	at o.ss.sl.core.serverconnection.ServerConnection.compareSynchronizedServerVersion(ServerConnection.java:225)
	at o.ss.sl.core.serverconnection.ServerConnection.supportsCustomSecrets(ServerConnection.java:216)
	at o.ss.sl.core.ConnectedSonarLintEngineImpl.getEmbeddedPluginPathsByKey(ConnectedSonarLintEngineImpl.java:148)
	at o.ss.sl.core.ConnectedSonarLintEngineImpl.loadPlugins(ConnectedSonarLintEngineImpl.java:140)
	at o.ss.sl.core.ConnectedSonarLintEngineImpl.loadAnalysisContext(ConnectedSonarLintEngineImpl.java:119)
	at o.ss.sl.core.ConnectedSonarLintEngineImpl.start(ConnectedSonarLintEngineImpl.java:115)
	at o.ss.sl.core.ConnectedSonarLintEngineImpl.<init>(ConnectedSonarLintEngineImpl.java:105)

Hi @mark-o88,

The SonarLint server version is stored under the system path for IntelliJ (~/.cache/JetBrains//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.

I would recommend updating the local storage and then seeing if the issue happens again. You can do that by going to Settings → Tools → SonarLint → Project Settings → Bind to SonarCloud / SonarQube tab → Update local storage

Thanks for using SonarLint! :sonarlint: