Unable to start SonarLint background service (C#)

  • Operating system: Windows 11 Pro - 23H2
  • Visual Studio version: Microsoft Visual Studio Community 2022 (64 bits) - 17.10.4
  • SonarLint plugin version: 8.2.0.96766
  • Programming language you’re coding in: C#
  • Is connected mode used: No
    • Connected to SonarCloud or SonarQube (and which version):

Description of the problem:
After a fresh install, SonarLint background service failed to start, here the log:

[ThreadId 41] [SLCoreHandler] Creating SLCore instance
[ThreadId 41] [SLCoreHandler] Starting SLCore instance
[ThreadId 41] [SLCoreHandler] Error starting SLCore instance
[ThreadId 41] [DEBUG] System.NullReferenceException: La référence d'objet n'est pas définie à une instance d'un objet.
   à SonarLint.VisualStudio.SLCore.Configuration.SlCoreTelemetryMigrationProvider.Get()
   à SonarLint.VisualStudio.SLCore.SLCoreInstanceHandle.Initialize()
   à SonarLint.VisualStudio.SLCore.SLCoreInstanceHandler.<LaunchInstanceAsync>d__14.MoveNext()
[ThreadId 41] [SLCoreHandler] SLCore instance exited
[ThreadId 41] [SLCoreHandler] Creating SLCore instance
[ThreadId 41] [SLCoreHandler] Starting SLCore instance
[ThreadId 41] [SLCoreHandler] Error starting SLCore instance
[ThreadId 41] [DEBUG] System.NullReferenceException: La référence d'objet n'est pas définie à une instance d'un objet.
   à SonarLint.VisualStudio.SLCore.Configuration.SlCoreTelemetryMigrationProvider.Get()
   à SonarLint.VisualStudio.SLCore.SLCoreInstanceHandle.Initialize()
   à SonarLint.VisualStudio.SLCore.SLCoreInstanceHandler.<LaunchInstanceAsync>d__14.MoveNext()
[ThreadId 41] [SLCoreHandler] SLCore instance exited
[ThreadId 32] [DEBUG] [SLCORE] SonarLint backend started, instance=org.sonarsource.sonarlint.core.rpc.impl.SonarLintRpcServerImpl@795509d9
[ThreadId 32] [DEBUG] [SLCORE] SonarLint backend shutting down, instance=org.sonarsource.sonarlint.core.rpc.impl.SonarLintRpcServerImpl@795509d9
[ThreadId 6] [DEBUG] [SLCORE] SonarLint backend started, instance=org.sonarsource.sonarlint.core.rpc.impl.SonarLintRpcServerImpl@795509d9
[ThreadId 6] [DEBUG] [SLCORE] SonarLint backend shutting down, instance=org.sonarsource.sonarlint.core.rpc.impl.SonarLintRpcServerImpl@795509d9
[ThreadId 33] [SLCORE-ERR] Server is shutting down...
[ThreadId 12] [SLCORE-ERR] Server is shutting down...

Did I miss something ?

Hi @Brun0oO

This is a bug with our latest release. We will work on releasing a fix soon.

1 Like

@Brun0oO Hi. We’ve released a fix for this, version 8.2.1.

1 Like

I have installed version 8.2.1.96841 and am still seeing this exact error message

Hi @bdekker
I tried to reproduce the issue and I can confirm that I can no longer reproduce it with 8.2.1, but can consistently reproduce it with 8.2.0.
Could you verify the extension version in Extensions > SonarLint > Help > About SonarLint?
Also, another thing is to check if you have telemetry.xml file in <user folder>\AppData\Roaming\SonarLint for Visual Studio

[ThreadId 158] [SLCoreHandler] Creating SLCore instance
[ThreadId 158] [SLCoreHandler] Starting SLCore instance
[ThreadId 158] [SLCoreHandler] Error starting SLCore instance
[ThreadId 158] [DEBUG] System.ArgumentNullException: Value cannot be null.
Parameter name: key
   at System.ThrowHelper.ThrowArgumentNullException(ExceptionArgument argument)
   at System.Collections.Generic.Dictionary`2.Insert(TKey key, TValue value, Boolean add)
   at SonarLint.VisualStudio.SLCore.State.ServerConnectionsProvider.GetUniqueConnections(IEnumerable`1 bindings)
   at SonarLint.VisualStudio.SLCore.SLCoreInstanceHandle.Initialize()
   at SonarLint.VisualStudio.SLCore.SLCoreInstanceHandler.<LaunchInstanceAsync>d__14.MoveNext()
[ThreadId 158] [SLCoreHandler] SLCore instance exited
[ThreadId 158] [SLCoreHandler] Creating SLCore instance
[ThreadId 158] [SLCoreHandler] Starting SLCore instance
[ThreadId 158] [SLCoreHandler] Error starting SLCore instance
[ThreadId 158] [DEBUG] System.ArgumentNullException: Value cannot be null.
Parameter name: key
   at System.ThrowHelper.ThrowArgumentNullException(ExceptionArgument argument)
   at System.Collections.Generic.Dictionary`2.Insert(TKey key, TValue value, Boolean add)
   at SonarLint.VisualStudio.SLCore.State.ServerConnectionsProvider.GetUniqueConnections(IEnumerable`1 bindings)
   at SonarLint.VisualStudio.SLCore.SLCoreInstanceHandle.Initialize()
   at SonarLint.VisualStudio.SLCore.SLCoreInstanceHandler.<LaunchInstanceAsync>d__14.MoveNext()
[ThreadId 158] [SLCoreHandler] SLCore instance exited
[ThreadId 647] [DEBUG] [SLCORE] SonarLint backend started, instance=org.sonarsource.sonarlint.core.rpc.impl.SonarLintRpcServerImpl@7161d8d1
[ThreadId 647] [DEBUG] [SLCORE] SonarLint backend shutting down, instance=org.sonarsource.sonarlint.core.rpc.impl.SonarLintRpcServerImpl@7161d8d1
[ThreadId 68] [DEBUG] [SLCORE] SonarLint backend started, instance=org.sonarsource.sonarlint.core.rpc.impl.SonarLintRpcServerImpl@7161d8d1
[ThreadId 68] [DEBUG] [SLCORE] SonarLint backend shutting down, instance=org.sonarsource.sonarlint.core.rpc.impl.SonarLintRpcServerImpl@7161d8d1
[ThreadId 90] [SLCORE-ERR] Server is shutting down...
[ThreadId 60] [SLCORE-ERR] Server is shutting down...

image

1 Like

I did confirm I have a telemetry.xml file in the location specified.

Thank you for providing the logs. This seems like a different issue than what was fixed in 8.2.1.

Could you please send me the contents of the <user folder>\AppData\Roaming\SonarLint for Visual Studio\Bindings folder? It seems to be that there is some binding data there that is corrupted.

There are no personal secrets stored in that folder, but if you would like to share it privately, I have sent you a DM you can reply to.

Sorry for the inconvenience!

Hi @bdekker

I tried to reproduce the problem with the binding files you’ve sent me and, unfortunately, I can’t.

If this issue appears for you consistently, I would suggest deleting the <user folder>\AppData\Roaming\SonarLint for Visual Studio folder and trying again. This will remove the 2 project bindings you have, so you will have to re-do it. A good shortcut to do it would be to export your bindings and then, after you delete the folder, to import them again

1 Like

Deleting the entire folder seemed to have solved it, thanks!

1 Like