Failed to download analysis cache

Must-share information (formatted with Markdown):

  • Sonarqube 9.9.4 (LTS) and maven sonar scanner
  • how is SonarQube deployed: Docker and NGINX (for https, proxy) and postgres14
  • what are you trying to achieve: Analyzing a project

Maven analysis crashes with:

[ERROR] Failed to execute goal org.sonarsource.scanner.maven:sonar-maven-plugin:3.10.0.2594:sonar (default-cli) on project pauss-h-parent: Error creating bean with name 'org.sonarsource.scanner.api.internal.IsolatedClassloader@66450129-org.sonar.scanner.report.ReportPublisher': Unsatisfied dependency expressed through constructor parameter 7; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'org.sonarsource.scanner.api.internal.IsolatedClassloader@66450129-org.sonar.scanner.report.AnalysisCachePublisher': Unsatisfied dependency expressed through constructor parameter 0; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'WriteCache' defined in org.sonar.scanner.cache.AnalysisCacheProvider: Unsatisfied dependency expressed through method 'provideWriter' parameter 1; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'ReadCache' defined in org.sonar.scanner.cache.AnalysisCacheProvider: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.sonar.api.batch.sensor.cache.ReadCache]: Factory method 'provideReader' threw exception; nested exception is java.lang.IllegalStateException: Failed to download analysis cache: Fail to request url: https://SONARp/api/analysis_cache/get?project=xxxxx&branch=master: timeout: Read timed out -> [Help 1]

When I delete the analysis cache fromt the database, it works:
grafik
The analysis_cache is about 300MB large. and takes avbout 3 Minutes to prepare and download. I Can download the cache with the browser, but maven plugin seems to have a smaller timeout.
I tried giving sonar more RAM. I observed CPU and RAM Usage, but everything is fine.

1 Like

Hey there.

Iā€™m a little surprised to see an analysis cache that large! How big is this project (Lines of Code or number of files would be a good measure). How long does the analysis take with / without cahce?

My first suggestion would be trying to increase sonar.ws.timeout value to something like 180 (so -Dsonar.ws.timeout=180) and see if that at least gets you past this error message.

1 Like