Unable to start OmniSharp

Hi, I am using Sonarlint 5.2.0.35150 plugin for Rider on Mac OS Big Sur and it gives the following error in the logs:

Error running SonarLint analysis
java.lang.IllegalStateException: Unable to start OmniSharp
	at org.sonarsource.sonarlint.omnisharp.OmnisharpSensor.execute(OmnisharpSensor.java:101)
	at org.sonarsource.sonarlint.core.analyzer.sensor.SensorsExecutor.executeSensor(SensorsExecutor.java:80)
	at org.sonarsource.sonarlint.core.analyzer.sensor.SensorsExecutor.execute(SensorsExecutor.java:71)
	at org.sonarsource.sonarlint.core.container.analysis.AnalysisContainer.doAfterStart(AnalysisContainer.java:133)
	at org.sonarsource.sonarlint.core.container.ComponentContainer.startComponents(ComponentContainer.java:126)
	at org.sonarsource.sonarlint.core.container.ComponentContainer.execute(ComponentContainer.java:111)
	at org.sonarsource.sonarlint.core.container.standalone.StandaloneGlobalContainer.analyze(StandaloneGlobalContainer.java:162)
	at org.sonarsource.sonarlint.core.StandaloneSonarLintEngineImpl.lambda$analyze$0(StandaloneSonarLintEngineImpl.java:95)
	at org.sonarsource.sonarlint.core.AbstractSonarLintEngine.withModule(AbstractSonarLintEngine.java:87)
	at org.sonarsource.sonarlint.core.StandaloneSonarLintEngineImpl.analyze(StandaloneSonarLintEngineImpl.java:93)
	at org.sonarlint.intellij.core.StandaloneSonarLintFacade.analyze(StandaloneSonarLintFacade.java:91)
	at org.sonarlint.intellij.core.SonarLintFacade.startAnalysis(SonarLintFacade.java:64)
	at org.sonarlint.intellij.analysis.SonarLintAnalyzer.analyzeModule(SonarLintAnalyzer.java:93)
	at org.sonarlint.intellij.analysis.AnalysisTask.analyzePerModule(AnalysisTask.java:387)
	at org.sonarlint.intellij.analysis.AnalysisTask.run(AnalysisTask.java:155)
	at com.intellij.openapi.progress.impl.CoreProgressManager.startTask(CoreProgressManager.java:450)
	at com.intellij.openapi.progress.impl.ProgressManagerImpl.startTask(ProgressManagerImpl.java:117)
	at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$runProcessWithProgressAsync$5(CoreProgressManager.java:510)
	at com.intellij.codeWithMe.ClientId$Companion$decorateFunction$2.apply(ClientId.kt:209)
	at com.intellij.codeWithMe.ClientId$Companion$decorateFunction$2.apply(ClientId.kt:209)
	at com.intellij.openapi.progress.impl.ProgressRunner.lambda$submit$3(ProgressRunner.java:243)
	at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$runProcess$2(CoreProgressManager.java:183)
	at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:705)
	at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:647)
	at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:63)
	at com.intellij.openapi.progress.impl.CoreProgressManager.runProcess(CoreProgressManager.java:170)
	at com.intellij.openapi.progress.impl.ProgressRunner.lambda$submit$4(ProgressRunner.java:243)
	at java.base/java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1700)
	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)
Caused by: java.lang.IllegalStateException: Timeout waiting for solution/project configuration to be loaded
	at org.sonarsource.sonarlint.omnisharp.OmnisharpServer.doStart(OmnisharpServer.java:196)
	at org.sonarsource.sonarlint.omnisharp.OmnisharpServer.lazyStart(OmnisharpServer.java:147)
	at org.sonarsource.sonarlint.omnisharp.OmnisharpSensor.execute(OmnisharpSensor.java:95)
	... 34 more

Hello Ahmet,

Thanks for joining the community and raising this issue.

When analyzing C# in Rider SonarLint starts an Omnisharp server, that in turns tries to load the solution/project. If after 1min the loading process didn’t finish, we throw this error.

May I ask you some questions:

  • What is the size of your solution ? How many projects do you have, and how many lines of code ?
  • Do you face the problem consistently, or are you able to analyze if you restart Rider ?
  • Could you check if the omnisharp process is still alive ? You could try to locate it with the Activity Monitor (the process should have been started with a bash command that refers to the SonarLint.OmniSharp.DotNet.Services.dll file).

I will try to reproduce your problem on our side.
Thanks again

Hi Damien,

  • It is a solution consisting of 23 projects. I am sharing a screenshot of the line count stats from SonarQube:

  • It always happens regardless of restarting the Rider.

  • There is no omnisharp or similar process in the Activity monitor.

  • While I was trying it again, I saw some more logs from the beginning which says it is Analysing 10 files…

Creating container for module with key=Module: 'rider.module'
Server started on 64120
Analysing 10 files...
Error running SonarLint analysis
java.lang.IllegalStateException: Unable to start OmniSharp
	at org.sonarsource.sonarlint.omnisharp.OmnisharpSensor.execute(OmnisharpSensor.java:101)

Hello,

Thanks for those details.

I realized that you probably don’t have the full logs enabled. Could you try to activate verbose logs, as shown here, and share with us what you get ?