Gradle. Scan Error. Error creating bean

scan aborts with error:
Community Edition
Version 9.6.1
Please, help me. :grimacing:

> 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

Hi,

Could we have the entire analysis log?

 
Ann

Sorry, it is all what I have

Hi,

Can you rerun with ./gradlew --debug?

 
Ann

I’ll send soon, approval required

debug2.zip (461.9 KB)

Hi,

Thanks for the log. Unfortunately, it didn’t make the part that I needed to be verbose, verbose. :frowning:

At any rate, I’m flagging this for more expert attention.

 
Ann

up topic

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:

:warning: WARNING :warning:

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.

only after devs fix it we can update, so please wait for an answer