scan aborts with error:
Community Edition
Version 9.6.1
Please, help me.
> Error creating bean with name 'org.sonarsource.scanner.api.internal.IsolatedClassloader@372acf39-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@372acf39-org.sonar.scanner.report.AnalysisCachePublisher': Unsatisfied dependency expressed through constructor parameter 2; 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
Hello @f33r0 are you having this issue with multiple projects or only with one?
That error is related to some issues with the analysis cache of the specific project and branch you are trying to analyse.
If you have admin rights you can try to remove the cached analysis data with the help of this endpoint:
Keep in mind that in version 9.6 you cannot clean the analysis cache for a specific project/branch. That functionality has been added in SonarQube 9.7.
In SonarQube 9.6 that will remove ALL the analysis caches.
I managed to reproduce the issue locally with this list of steps:
Run an analysis on a project
Manually invalidate the analysis cache entry in the Database for the specific project
Running another analysis on the same project results on the same error reported:
Caused by: java.lang.IllegalStateException: Failed to download analysis cache
at org.sonar.scanner.cache.DefaultAnalysisCacheLoader.load(DefaultAnalysisCacheLoader.java:92)
at org.sonar.scanner.cache.AnalysisCacheMemoryStorage.load(AnalysisCacheMemoryStorage.java:52)
at org.sonar.scanner.cache.AnalysisCacheProvider.provideReader(AnalysisCacheProvider.java:35)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.base/java.lang.reflect.Method.invoke(Unknown Source)
at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:154)
... 77 more
In order to recover I tried two approaches:
Manually deleted the cache entry from the Database
Deleted the cache data for the project using the mentioned API (But I am using a version higher than 9.7)
In both cases I was able to scan again the project.