Two files raise "ERROR: Failure when reading cache"

In one of our applications (very old webapplication) we get with two files an error message, see below,
One file is: 614 lines and 19700 characters (18745 without CR/LF)
The other file: 163 lines and 5711 characters (5387 without CR/LF)

So the first one I could understand, but the second one? :thinking:

Must-share information (formatted with Markdown):

  • which versions are you using (SonarQube, Scanner, Plugin, and any relevant extension)
    SonarQube ID information
    Server ID: 86E1FA4D-AVqpBTuKcamw9_u2b0kc
    Version: 10.4.1.88267
    Date: 2024-03-25

  • how is SonarQube deployed: zip, Docker, Helm
    We used the installer.

  • what are you trying to achieve
    Build and scan (old) webapplication

  • what have you tried so far to achieve this
    Excluded those files… :blush:

ERROR: Failure when reading cache entry java.io.IOException: The cache stream is too big (>148552) for file D:\Agents\Agent.Morpheus\_work\3\.sonarqube\out\.sonar\mod13\..\mod30\ucfg2\js\D__Agents_Agent_Morpheus__work_3_s_Map_Map_Web_MapTestPage_html.ucfgs
    at org.sonar.plugins.javascript.bridge.cache.SequenceSerialization.writeFile(SequenceSerialization.java:91)
    at org.sonar.plugins.javascript.bridge.cache.SequenceSerialization.readFromCache(SequenceSerialization.java:139)
    at org.sonar.plugins.javascript.bridge.cache.UCFGFilesSerialization.readFromCache(UCFGFilesSerialization.java:60)
    at org.sonar.plugins.javascript.bridge.cache.CacheAnalysisSerialization.readFromCache(CacheAnalysisSerialization.java:58)
    at org.sonar.plugins.javascript.bridge.cache.CacheStrategies.readFromCache(CacheStrategies.java:124)
    at org.sonar.plugins.javascript.bridge.cache.CacheStrategies.getStrategyFor(CacheStrategies.java:105)
    at org.sonar.plugins.javascript.bridge.cache.CacheStrategies.getStrategyFor(CacheStrategies.java:69)
    at org.sonar.plugins.javascript.bridge.HtmlSensor.analyzeFiles(HtmlSensor.java:91)
    at org.sonar.plugins.javascript.bridge.AbstractBridgeSensor.execute(AbstractBridgeSensor.java:79)
    at org.sonar.scanner.sensor.AbstractSensorWrapper.analyse(AbstractSensorWrapper.java:64)
    at org.sonar.scanner.sensor.ModuleSensorsExecutor.execute(ModuleSensorsExecutor.java:88)
    at org.sonar.scanner.sensor.ModuleSensorsExecutor.lambda$execute$1(ModuleSensorsExecutor.java:61)
    at org.sonar.scanner.sensor.ModuleSensorsExecutor.withModuleStrategy(ModuleSensorsExecutor.java:79)
    at org.sonar.scanner.sensor.ModuleSensorsExecutor.execute(ModuleSensorsExecutor.java:61)
    at org.sonar.scanner.scan.SpringModuleScanContainer.doAfterStart(SpringModuleScanContainer.java:82)
    at org.sonar.core.platform.SpringComponentContainer.startComponents(SpringComponentContainer.java:223)
    at org.sonar.core.platform.SpringComponentContainer.execute(SpringComponentContainer.java:202)
    at org.sonar.scanner.scan.SpringProjectScanContainer.scan(SpringProjectScanContainer.java:197)
    at org.sonar.scanner.scan.SpringProjectScanContainer.scanRecursively(SpringProjectScanContainer.java:193)
    at org.sonar.scanner.scan.SpringProjectScanContainer.scanRecursively(SpringProjectScanContainer.java:190)
    at org.sonar.scanner.scan.SpringProjectScanContainer.doAfterStart(SpringProjectScanContainer.java:166)
    at org.sonar.core.platform.SpringComponentContainer.startComponents(SpringComponentContainer.java:223)
    at org.sonar.core.platform.SpringComponentContainer.execute(SpringComponentContainer.java:202)
    at org.sonar.scanner.bootstrap.SpringScannerContainer.doAfterStart(SpringScannerContainer.java:351)

Hi,

You excluded the files and still got the same error?

Can you provide your full analysis log, please?

The analysis / scanner log is what’s output from the analysis command. Hopefully, the log you provide - redacted as necessary - will include that command as well.

This guide will help you find them.

 
Thx,
Ann

I’ve added sonar.verbose=true to the build and removed the exclusions, the errors did not appear anymore. :thinking:

So for now close this issue.

The problem is back again. How can I send you the files in private?

Hi,

Feel free to redact as necessary.

 
Ann

Hello Ann,

Hereby I send you the logfile and the files that were reporting the error. If you need more, please contact me.

I hope you can help us.

Kind regards,
Henk

Sonar build-scan log.zip (54.8 KB)

Hi,

Thanks for the files. I’m going to flag this for the language experts.

 
Ann

Dear @HeSitates,

Thanks for the report.

The issue is fixed in the upcoming 10.5 release, due later this week.

For information, here is the GitHub issue that was opened to track the fix: Do not generate UCFGs for JavaScript code inside HTML · Issue #4036 · SonarSource/SonarJS · GitHub

Eric.

1 Like