SonarLint not functioning on VS Studio 2022 Enterprise

Please provide

  • Operating system: Windows 11
  • Visual Studio version: Visual Studio Enterprise 2022
  • SonarLint plugin version: 8.0.0.56719
  • Programming language you’re coding in: C#
  • Is connected mode used:
    • Connected to SonarCloud or SonarQube (and which version): Sonarcloud

And a thorough description of the problem / question:

SonarLint does not seem to work on a colleague’s Windows machine. It works for everyone else in the company except on his PC. I have installed OpenJDK 17, added JAVA_HOME and JDK_HOME variables, also utilizing the latest version of NodeJS. He has also uninstalled and reinstalled his Visual Studio, but this has not solved anything.

When I open the SonarLint Extension in VS Studio, and use Connected Mode, I had the credentials as per usual and link the Sonarcloud Project to the VS Studio Project using the bindings. Once completed, I can see that SonarLint scans the files, but no lines are drawn under the lines that have issues been reported in the Sonarcloud console. Show Error Squiggles is enabled in Visual Studio.

Here is the output log when SonarLint scans the project:

Initializing the telemetry package...
Finished initializing the telemetry package...
Initializing the daemon package...
[SLCoreHandler] Creating SLCore instance
[SLCoreHandler] Starting SLCore instance
Settings file does not exist at "C:\Users\xxxx\AppData\Roaming\SonarLint for Visual Studio\settings.json".
Default settings will be used
Current VS version:
    Visual Studio Enterprise 2022
    17.11.35312.102
    17.11.4
[NodeJSLocator] Checking environment variable SONAR_NODEJS_PATH
[NodeJsLocator] Environment variable value: C:\Program Files\nodejs\node.exe
Finished initializing the daemon package.
Connecting to '
https://sonarcloud.io/'.
[SLCORE] Can't open directory channel. Log directory fsync won't be performed.
[FileTracker] Service Provider is unavailable
[SLCoreAnalyzer] Analyzing C:\dev\xxxxx\projects\xxxxxx\Services\FeatureRequestService.cs with id 
[SLCoreAnalyzer] Analysis  not ready for file C:\dev\xxxxxxx\projects\xxxxxxxx\Services\FeatureRequestService.cs: Configuration scope not initialized
Initializing the SonarLint package...
Finishing initializing the SonarLint package
Connected to SonarCloud '8.0.0.56719'.
Binding has changed. Open documents will be re-analysed.
Starting job: "re-analyzing 1 document(s)...". Time: 08:33:38
Finished job "re-analyzing 1 document(s)..." started at 08:33:38. Elapsed time: 297ms
[SLCoreAnalyzer] Analyzing C:\dev\xxxxxx\projects\xxxxx\Services\FeatureRequestService.cs with id 
Initializing the notifications package...
[SLCoreAnalyzer] Analysis  not ready for file C:\dev\xxxxxxxx\projects\xxxxxxxxx\Services\FeatureRequestService.cs: Configuration scope not initialized
Loading notifications settings...
Connected: checking for notifications
Finished initializing the notifications package
[ConnectedMode] Initializing package...
[ConnectedMode] Package initialized
ERROR: Could not find factory for 'IGetSonarLintEventStream'.
[Suppressions] Fetching all suppressions...
[Hotspots] Fetching all hotspots...
[Taint] Initializing taint issues synchronization package...
[ConnectedMode/BranchMapping] Matching Sonar server branch: develop
[ConnectedMode/BranchMapping] Matching Sonar server branch: develop
[ConnectedMode/BranchMapping] Matching Sonar server branch: develop
[ConnectedMode/BranchMapping] Closest Sonar server branch: develop
[ConnectedMode/BranchMapping] Closest Sonar server branch: develop
[ConnectedMode/BranchMapping] Closest Sonar server branch: develop
[Hotspots] Finished fetching all hotspots
[ServerIssueStore] Raising change event...
[Suppressions] Finished fetching all suppressions
Updated analysis readiness: True
Starting job: "re-analyzing 1 document(s)...". Time: 08:33:40
Finished job "re-analyzing 1 document(s)..." started at 08:33:40. Elapsed time: 16ms
[Taint] Fetched 17 taint vulnerabilities.
[SLCoreAnalyzer] Analyzing C:\dev\xxxxxxx\projects\xxxxxxxx\Services\FeatureRequestService.cs with id 
[SLCoreAnalyzer] Finished analyzing C:\dev\xxxxxxxx\projects\xxxxxxx\Services\FeatureRequestService.cs with id 60a5c30d-4a56-46c0-a5da-e08f1a5d5396, analysis time: 0s
[SLCoreAnalyzer] Found 0 issue(s) for C:\dev\xxxxxxx\projects\xxxxxxx\Services\FeatureRequestService.cs
[SLCoreAnalyzer] Finished analyzing C:\dev\xxxxxxxx\projects\xxxxxxx\Services\FeatureRequestService.cs with id 60a5c30d-4a56-46c0-a5da-e08f1a5d5396, analysis time: 0s
[SLCoreAnalyzer] Found 0 issue(s) for C:\dev\xxxxxxx\projects\xxxxxxxxx\Services\FeatureRequestService.cs
Initializing security package...
Finished initializing security package.
[Taint] Finished initializing taint issues synchronization package.

Hi,

The current version of SonarLint for Visual Studio is 8.3.0. Could you upgrade and see if this is still replicable?

 
Thx,
Ann

Upgraded to version 8.4.0.10426, the same issue persists. Logs are the same. I am wondering if it is not related to this line:

ERROR: Could not find factory for ‘IGetSonarLintEventStream’.

1 Like

Hi,

Thanks for checking. I’m going to flag this for the team.

 
Ann

1 Like

We have seen this problem with multiple users on our team. Seems to be more of an issue if the file is on the root level of the project, not in a subfolder. The file here is quite simple and we see it on different files.

[SLCoreAnalyzer] Analyzing C:\SourceCode\PP-AssemblyPlanner\Proplanner\ChartDoubleClickEventHandler.cs with id 
[SLCORE] Internal error: java.lang.NullPointerException: Cannot invoke "java.nio.file.Path.getParent()" because "file" is null
[SLCoreAnalyzer] Failed to analyze C:\SourceCode\PP-AssemblyPlanner\Proplanner\ChartDoubleClickEventHandler.cs with id : StreamJsonRpc.RemoteInvocationException: Internal error.
   at StreamJsonRpc.JsonRpc.<InvokeCoreAsync>d__154`1.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at SonarLint.VisualStudio.SLCore.Analysis.SLCoreAnalyzer.<ExecuteAnalysisInternalAsync>d__7.MoveNext()
1 Like

Hello MichaelduPreez, Juan Foegen

Thank you for using SonarLint and sharing your feedback.

Juan Foegen: After reviewing the details, the two issues you mentioned do not appear to be exactly related. To help us provide the best attention to both, I kindly ask you to open a separate community thread for it.

MichaelduPreez: It’s still unclear where the issue originates, and I’ll need some additional information to investigate further. Could you please provide the verbose logs by following the instructions?

Best regards,
Vasileios

SonarLint_20241007.log (97.3 KB)

Not sure if these log files will show anything as well

SonarLintLog.txt (119.1 KB)

Added log