For some reason sonar-scanner started to slow down two days ago

Versions:

  1. sonar-scanner-cli: 4.8.0.2856
  2. java-11-openjdk
  3. Max. Heap Size (Estimated): 15.70G
  4. sonarsource/sonarcloud-github-action@master
  5. Node.JS 18.16.0
  • how is SonarQube deployed: Github Docker CLI
  • I would like to keep the analysis within the 15 minutes, now it is taking more than 3 hours and Gituhub cancels the workflow, for some reason it is now analysing only 3 files per run.
  • I have tried downgrading nodejs, used github actions and enabled/disabled caching.

Hey there.

  • Are you using SonarQube or SonarCloud (you posted in the SonarQube category, but indicated you’re using sonarsource/sonarcloud-github-action@master).
  • It would be helpful (and the only way to start debugging) if you provide the analysis logs where the analysis stalls

Yes we are using sonarcloud but we first analyze the code coverage on GitHub using sonar-scanner before pushing to sonarcloud. I thought that’s sonarqube? Or I am I wrong?

How can I access the logs? I only see 2/8200 files analyzed and keep increasing 4 by 4. Before it was much faster it was analyzing the 8200 files in 15 minutes. I tried to increase the node maxspace but no luck.

You can call it all SonarCloud if SonarCloud is where the results land :slight_smile:

If you can see that only 2/8200 files have been analyzed, you have found the logs!

Hello @yaabed,

thanks for your feedback. Indeed last changes seem to have affected projects with several tsconfigs. Can you please confirm that’s your case?

One workaround until we provide a fix is to provide the sonar property sonar.typescript.tsconfigPath pointing to the base tsconfig in the project root. Let me know if that helps in your case.

Cheers,
Victor

Hi @yaabed,

what kind of project you are working on? react? angular? are you using nx?

Thanks,
Victor

Hi Victor,

Thank you for your response, I am testing your suggestion right now.

Regarding what kind of project, we have a mono-repo full of Angular projects and we use NX to manage those. We have around 100 projects and each of them outputs a set of LCOV files.

Last week those 100 projects were analysed in 15 minutes max and suddenly last Friday it started to take hours and not even completes.

Thank you Victor for the suggestion. The time went down to 11 minutes after pointing to the main tsconfig

sonar.typescript.tsconfigPaths=./tsconfig.base.json
INFO: Time spent writing ucfgs 15490ms
INFO: Analysis total time: 11:08.673 s
INFO: ------------------------------------------------------------------------
INFO: EXECUTION SUCCESS
INFO: ------------------------------------------------------------------------
INFO: Total time: 11:31.554s
INFO: Final Memory: 2920M/5016M
INFO: ------------------------------------------------------------------------
1 Like