ERROR: Unable to run check class | S5693

Hi,

I get this error on many Java files with the same rule.

Sonarqube 9.6.1
Sonarscanner 4.7

thx,
Mark

ERROR: Unable to run check class org.sonar.java.checks.security.ExcessiveContentRequestCheck - S5693 on file 'xxxxxxxxx.java', To help improve the SonarSource Java Analyzer, please report this problem to SonarSource: see https://community.sonarsource.com/ 
**00:05:18.091** org.sonar.java.AnalysisException: Failed to write to cache for file xxxxxx.java 
**00:05:18.091**    at org.sonar.java.checks.security.ExcessiveContentRequestCheck.writeForNextAnalysis(ExcessiveContentRequestCheck.java:323) 
**00:05:18.091**    at org.sonar.java.checks.security.ExcessiveContentRequestCheck.leaveFile(ExcessiveContentRequestCheck.java:201) 
**00:05:18.091**    at org.sonar.java.model.VisitorsBridge$IssuableSubscriptionVisitorsRunner.lambda$scanFile$3(VisitorsBridge.java:417) 
**00:05:18.091**    at org.sonar.java.model.VisitorsBridge$IssuableSubscriptionVisitorsRunner.lambda$forEach$9(VisitorsBridge.java:468) 
**00:05:18.091**    at org.sonar.java.model.VisitorsBridge.runScanner(VisitorsBridge.java:265) 
**00:05:18.091**    at org.sonar.java.model.VisitorsBridge$IssuableSubscriptionVisitorsRunner.forEach(VisitorsBridge.java:468) 
**00:05:18.091**    at org.sonar.java.model.VisitorsBridge$IssuableSubscriptionVisitorsRunner.scanFile(VisitorsBridge.java:417) 
**00:05:18.091**    at org.sonar.java.model.VisitorsBridge.lambda$runScanner$1(VisitorsBridge.java:260) 
**00:05:18.091**    at org.sonar.java.model.VisitorsBridge.runScanner(VisitorsBridge.java:265) 
**00:05:18.091**    at org.sonar.java.model.VisitorsBridge.runScanner(VisitorsBridge.java:260) 
**00:05:18.091**    at org.sonar.java.model.VisitorsBridge.visitFile(VisitorsBridge.java:243) 
**00:05:18.092**    at org.sonar.java.ast.JavaAstScanner.simpleScan(JavaAstScanner.java:132) 
**00:05:18.092**    at org.sonar.java.JavaFrontend.scanAsBatchCallback(JavaFrontend.java:247) 
**00:05:18.092**    at org.sonar.java.JavaFrontend.lambda$scanBatch$0(JavaFrontend.java:238) 
**00:05:18.092**    at org.sonar.java.model.JParserConfig$Batch$1.acceptAST(JParserConfig.java:181) 
**00:05:18.092**    at org.eclipse.jdt.core.dom.CompilationUnitResolver.resolve(CompilationUnitResolver.java:1065) 
**00:05:18.092**    at org.eclipse.jdt.core.dom.CompilationUnitResolver.resolve(CompilationUnitResolver.java:661) 
**00:05:18.092**    at org.eclipse.jdt.core.dom.ASTParser.createASTs(ASTParser.java:1049) 
**00:05:18.092**    at org.sonar.java.model.JParserConfig$Batch.parse(JParserConfig.java:165) 
**00:05:18.092**    at org.sonar.java.JavaFrontend.scanBatch(JavaFrontend.java:238) 
**00:05:18.092**    at org.sonar.java.JavaFrontend.scanInBatches(JavaFrontend.java:228) 
**00:05:18.092**    at org.sonar.java.JavaFrontend.scanAsBatch(JavaFrontend.java:195) 
**00:05:18.092**    at org.sonar.java.JavaFrontend.scan(JavaFrontend.java:170) 
**00:05:18.092**    at org.sonar.plugins.java.JavaSensor.execute(JavaSensor.java:113) 
**00:05:18.092**    at org.sonar.scanner.sensor.AbstractSensorWrapper.analyse(AbstractSensorWrapper.java:64) 
**00:05:18.092**    at org.sonar.scanner.sensor.ModuleSensorsExecutor.execute(ModuleSensorsExecutor.java:88) 
**00:05:18.092**    at org.sonar.scanner.sensor.ModuleSensorsExecutor.lambda$execute$1(ModuleSensorsExecutor.java:61) 
**00:05:18.092**    at org.sonar.scanner.sensor.ModuleSensorsExecutor.withModuleStrategy(ModuleSensorsExecutor.java:79) 
**00:05:18.092**    at org.sonar.scanner.sensor.ModuleSensorsExecutor.execute(ModuleSensorsExecutor.java:61) 
**00:05:18.092**    at org.sonar.scanner.scan.SpringModuleScanContainer.doAfterStart(SpringModuleScanContainer.java:81) 
**00:05:18.092**    at org.sonar.core.platform.SpringComponentContainer.startComponents(SpringComponentContainer.java:188) 
**00:05:18.092**    at org.sonar.core.platform.SpringComponentContainer.execute(SpringComponentContainer.java:167) 
**00:05:18.092**    at org.sonar.scanner.scan.SpringProjectScanContainer.scan(SpringProjectScanContainer.java:396) 
**00:05:18.092**    at org.sonar.scanner.scan.SpringProjectScanContainer.scanRecursively(SpringProjectScanContainer.java:392) 
**00:05:18.092**    at org.sonar.scanner.scan.SpringProjectScanContainer.doAfterStart(SpringProjectScanContainer.java:361) 
**00:05:18.092**    at org.sonar.core.platform.SpringComponentContainer.startComponents(SpringComponentContainer.java:188) 
**00:05:18.092**    at org.sonar.core.platform.SpringComponentContainer.execute(SpringComponentContainer.java:167) 
**00:05:18.092**    at org.sonar.scanner.bootstrap.SpringGlobalContainer.doAfterStart(SpringGlobalContainer.java:135) 
**00:05:18.092**    at org.sonar.core.platform.SpringComponentContainer.startComponents(SpringComponentContainer.java:188) 
**00:05:18.092**    at org.sonar.core.platform.SpringComponentContainer.execute(SpringComponentContainer.java:167) 
**00:05:18.092**    at org.sonar.batch.bootstrapper.Batch.doExecute(Batch.java:72) 
**00:05:18.092**    at org.sonar.batch.bootstrapper.Batch.execute(Batch.java:66) 
**00:05:18.092**    at org.sonarsource.scanner.api.internal.batch.BatchIsolatedLauncher.execute(BatchIsolatedLauncher.java:46) 
**00:05:18.092**    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 
**00:05:18.092**    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) 
**00:05:18.092**    at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) 
**00:05:18.092**    at java.base/java.lang.reflect.Method.invoke(Method.java:566) 
**00:05:18.092**    at org.sonarsource.scanner.api.internal.IsolatedLauncherProxy.invoke(IsolatedLauncherProxy.java:60) 
**00:05:18.092**    at com.sun.proxy.$Proxy0.execute(Unknown Source) 
**00:05:18.092**    at org.sonarsource.scanner.api.EmbeddedScanner.doExecute(EmbeddedScanner.java:189) 
**00:05:18.092**    at org.sonarsource.scanner.api.EmbeddedScanner.execute(EmbeddedScanner.java:138) 
**00:05:18.092**    at org.sonarsource.scanner.cli.Main.execute(Main.java:112) 
**00:05:18.092**    at org.sonarsource.scanner.cli.Main.execute(Main.java:75) 
**00:05:18.092**    at org.sonarsource.scanner.cli.Main.main(Main.java:61) 
**00:05:18.093** Caused by: java.lang.IllegalArgumentException: Cache already contains key 'java:S5693:xxxxxxxxxxxxxxxxx.java' 
**00:05:18.093**    at org.sonar.api.utils.Preconditions.checkArgument(Preconditions.java:43) 
**00:05:18.093**    at org.sonar.scanner.cache.WriteCacheImpl.checkKey(WriteCacheImpl.java:90) 
**00:05:18.093**    at org.sonar.scanner.cache.WriteCacheImpl.write(WriteCacheImpl.java:62) 
**00:05:18.093**    at org.sonar.java.caching.JavaWriteCacheImpl.write(JavaWriteCacheImpl.java:46) 
**00:05:18.093**    at org.sonar.java.checks.security.ExcessiveContentRequestCheck.writeForNextAnalysis(ExcessiveContentRequestCheck.java:319)
1 Like

hmmm, ok?

no one?

Hey there.

You posted on a Thursday, and it’s Monday now (Saturday when you posted again). :slight_smile: Please don’t bump threads, and be a little patient (this is a community forum, not a ticketing system)

1 Like

Hi,

I forgot to mention → we are using the Sonarqube 9.6.1 developer edition.

Hello Mark,

I got a chance to look into it a little. This seems to be related to the recent addition of caching for improved performance on PR analyses.

It seems as though the scanner is scanning the same file multiple times or different files that appear to have the same path. To dig further, could you provide me with the following information:

  • Do you get this log entry for any files where there exists no other file with the same name? (This could indicate that the scanner tries to scan the same file more than once).
  • Do you get this log entry for any files where there exists a file with the same name elsewhere in the project? Such as in a different module? Can you share the paths of the two files? (Anonymized paths are fine, as long as they still clearly demonstrate what is similar and what different. Alternatively, I can also open a private channel for you to share this information.)
  • What operating system are you running your analysis on?
  • Can you share the command you are using to launch the scanner? (Without any credentials of course).