We are seeing slow SonarCloud times. It takes 10 minutes every single time and very rarely is using the cached layer. The layer is always restored:
Found a cache from build 249003 at v1-sonarcloud-scanner-4.7.0.2747
Size: 470 MiB
Cached paths:
* /tmp/cache/scanner
Downloading cache archive...
Validating cache...
Unarchiving cache...
Seems like the cached files are not being used. We are seeing this sometimes:
The PHP analyzer was able to leverage cached data from previous analyses for 0 out of 2605 files. These files were not parsed.
And sometimes it works and we see this and job runs in only 1 minute:
Starting PHP rules
INFO: 2605 source files to be analyzed
INFO: 2605/2605 source files have been analyzed
INFO: The PHP analyzer was able to leverage cached data from previous analyses for 2602 out of 2605 files. These files were not parsed.
INFO: Sensor PHP sensor [php] (done) | time=7506ms
The problem is that in both runs the cache layer restored was one and the same and we don’t see a difference. How can we troubleshoot this?
We’d like more of our SonarCloud CircleCI jobs to run in 1 minute.
I was just taking a look at the information you have provided. Can you send me information about what parameters you are sending to sonar-scanner? Also if you have a copy of the full log that would be useful.
Separately im reaching out to our teams to see if we have an issue related to caching in this case. I will come back to you if we find an issue here.
Can I check if you have sensor cache enabled in the general settings for your project on the Sonarcloud UI? I can see from your logs that it is being used but it appears like the cache is being ignored in almost all cases.
FYI I am currently trying to isolate where the issue might be occuring, I will update again once we have a more clear idea. I’ll keep you updated with the progress.
You mentioned that sometimes the cache is used and sometimes not. The cache is only used during a PR analysis, not when the main branch is being analyzed. When does this behavior occur?