Sonarlint on Idea runs infinitely

Please provide

  • Operating system: Windows 10, Fedora Linux, Alma Linux
  • SonarLint plugin version: 10.4.1.77998
  • Programming language you’re coding in: Java
  • Is connected mode used: Yes
    • Connected to SonarCloud or SonarQube (and which version): Enterprise Sonar Server 10.3 Build 82913

Also using Idea 2023.3.5, 2023.2.6, community and ultimate editions

And a thorough description of the problem / question:

Configured Idea sonarlint plugin to connect to our Sonar Enterprise server and begins synchronizing. Waited 5+ hours and it is still incomplete. Not sure if it is simply taking an extremely long time or if it is stuck. Idea is working as the synchronization is running.

The project is a legacy system with many open issues. We are moving to the “Clean as you code” methodology since it is not practical to solve all issues at this point. There are approximately 300k legacy issues over 3.5M lines of code.

I suspect there is either a misconfiguration somewhere or an extreme performance issue. Many users have tried to setup sonarlint with the same result.

2 Likes

Got the same issue here, using Ubuntu 22.04 and latest IDEA.
This issue started in the previous release of the Sonarlint plugin and is still there with the latest one.

Same issue here with 10.4.x. WSL, Ubuntu 22.04, latest IDEA.

Same here:

  • Operating system: macOS Sonoma 14.4 (23E214)
  • SonarLint plugin version: 10.4.1.77998
  • Programming language you’re coding in: Java
  • Is connected mode used: Yes
    • Connected to SonarCloud or SonarQube (and which version): SonarQube Enterprise Edition Version 9.9.3 (build 79811)
  • Operating system: Windows 10
  • SonarLint plugin version: 10.4.x
  • Programming language you’re coding in: java
  • Is connected mode used:Yes
    • Connected to SonarCloud or SonarQube (and which version): SonarQube Community Edition
      Version 9.8 (build 63668)

And a thorough description of the problem / question:

After upgrading the SonarLint intellij plugin to any version 10.4.x (the ones where SonarLint runs in a separate process), background tasks are spawned and the number of them keeps increasing indefinitely:

I had to downgrade to 10.3.x to fix this issue.

Anyone experiencing the same? Not sure how to troubleshoot this.

Thanks,
MP

I have the same issue since 10.4.1 (WSL Ubuntu 22.04)
Some colleagues of mine have it a bit longer (10.4)

Thank you for your reports and the valuable information you shared.

I found some issues that can appear in rare cases while iterating over project files at startup, which can prevent SonarLint from running analysis.

I made a custom build in an attempt to prevent the issue you are encountering. Could you please follow these steps and see if there is an improvement:

If the issue is still present, please take a thread dump so we can have a better understanding of what could be blocking SonarLint.

I tried new plugin (10.5.0.78034) on Idea Ultimate running in Fedora Linux and Idea Community running in Alma Linux running in WSL. I did not see a significant improvement (it may be better but I could not tell since the synchronization time is still measured in hours). I captured thread dumps and include them below. I capture a thread dump at various points in time.

idea-ultimate-threaddumps.zip (1.5 MB)
idea-community-threadumps.zip (76.5 KB)

In both cases I first removed the latest sonarlint plugin, restarted idea, then installed the experimental sonarlint plugin. I did not attempt to cleanup any leftover configuration or data that may have been leftover from the original latest sonarlint plugin.

After posting the sonarlint synchronization with our Sonar Enterprise server did complete. It appears to work as expected in my Fedora Idea Ultimate environment but in the Alma WSL Idea Community the sonarlint was showing issues, but the issues reported did not apply rule configuration from the Sonar Enterprise server (may synchronization was not 100% successful). For example, we have bumped the cognitive complexity rule threshold from 15 to 30, I see this setting correctly on Fedora Idea Ultimate but not on Alma Idea Community. The experimental sonarlint plugin has not changed this observation.

I also had ‘Automatically trigger analysis’ enabled which triggered a lot of ‘SonarLint Analysis’ tasks to start as I was working. These analysis scans were not completing or taking a really long time. Over time I see that there many scans running (50+) and some were in ‘stopping’ state but did not seem to ever stop.

I just exited out of Idea and started again and I see the same ‘synchronizing’ process has started again and is again taking a long time to complete (at least longer than 10 to 20 minutes). I am also finding that opening new source files and running analysis on them is taking a long time (has not completed for 10-20 minutes so far).

Some other factors to note not included in the original problem description.

  1. Full analysis published to the Sonar Enterprise server takes 1.75-2 hours. We don’t use the sonar gradle plugin for full source analysis as it is less efficient than using the sonar CLI.
  2. The quality profile for the project analysis contains 520 rules, 5 of which are custom (created by us)
  3. The Sonar Enterprise server is running in Munich Germany and I work in Boston Massachusetts. Many developers are in Gdynia Poland so they will also be remote to the Sonar Enterprise server.
  4. We use git as source repository and gradle as build system.
2 Likes

Thank you, we take this issue very seriously and we are investigating the case.

In the meantime and as suggested by @mpela81, you can downgrade to 10.3 and install SonarLint manually if that’s a blocking issue.

I had the same problem.
With plugin version 10.4.2.78113 it seems to be running fine again.

Thanks for the quick help!

1 Like

We just released a new version on the marketplace (10.5.0), which contains a lot of fixes, notably for big projects, as reported in this thread. Could you please give it a try and report back?
Thanks!

I installed the new Idea SonarLint plugin (10.5.0.78339) and it works better. I have not seen any issues with sonarlint analysis at commit or on-demand analysis as browsing sources.

1 Like