Issues with the sensor cache - "sensor cache (404)"

  • ALM used: GitHub
  • CI system: Circle CI
  • Languages of the repository: Javascript/TypeScript
  • Only if the SonarCloud project is public: repo is private
  • Error observed (wrap logs/code around with triple quotes ``` for proper formatting)
18:39:11.386 INFO: Load metrics repository
18:39:11.859 DEBUG: GET 200,description,direction,qualitative&ps=500&p=1 | time=472ms
18:39:11.866 INFO: Load metrics repository (done) | time=480ms
18:39:11.880 INFO: Sensor cache enabled
18:39:11.883 INFO: Load sensor cache
18:39:12.220 DEBUG: GET 200 | time=334ms
18:39:12.247 INFO: Load sensor cache (404) | time=364ms
18:39:14.090 DEBUG: Adding rules for repository 'jssecurity', language: JAVASCRIPT, [class, class, class 

Hello, we’re experiencing issues again with the sensor cache. It appears that the analyzer is attempting to download the cache, as evidenced by a GET request with a 200 code. However, the logs indicate that the sensor cache is returning a 404 error, which is causing the analyzer to bypass the cache and analyze all 4125 files again. This is resulting in a significant increase in analysis time, going from 2 minutes to 27 minutes intermittently.

I’m not sure what could be causing this issue, and I was wondering if you had any insights or ideas on what we could do to resolve it. It’s impacting our CI pipeline efficiency.

Thank you in advance!!

Hi @lmalvins

In the case you observe, there is no cache that we can use in order to speed up the specific analysis, hence the 404 response you’ve seen in the logs.
The first request is made to check if a cache package exist or not. In this case, there is none, and it is an expected behavior in some situations. For example, if the main branch of your project has not been analyzed for more than 7 days.

We’ll work on improving our logs, as indeed they might be confusing.

Do not hesitate to ask if you have any more questions,