Getting `ERROR: Failure when reading cache entry` with GitHub Actions but scan completes as success

  • ALM used GitHub
  • CI system used GitHub Actions
  • Scanner command used when applicable (private details masked)
    Using ubuntu-22.04 and sonarsource/sonarcloud-github-action@5875562561d22a34be0c657405578705a169af6c
  • Languages of the repository: JavaScript
  • Error observed
INFO: Sensor JavaScript inside HTML analysis [javascript]
INFO: 12 source files to be analyzed
ERROR: Failure when reading cache entry The cache stream is too big (>2625) for file /github/workspace/.scannerwork/ucfg2/js/_Users_..._index_html.ucfgs
	at org.sonar.plugins.javascript.eslint.cache.SequenceSerialization.writeFile(
	at org.sonar.plugins.javascript.eslint.cache.SequenceSerialization.readFromCache(
	at org.sonar.plugins.javascript.eslint.cache.UCFGFilesSerialization.readFromCache(
	at org.sonar.plugins.javascript.eslint.cache.CacheAnalysisSerialization.readFromCache(
	at org.sonar.plugins.javascript.eslint.cache.CacheStrategies.readFromCache(
	at org.sonar.plugins.javascript.eslint.cache.CacheStrategies.getStrategyFor(
	at org.sonar.plugins.javascript.eslint.cache.CacheStrategies.getStrategyFor(
	at org.sonar.plugins.javascript.eslint.HtmlSensor.analyze(
	at org.sonar.plugins.javascript.eslint.AbstractEslintSensor.analyzeFiles(
	at org.sonar.plugins.javascript.eslint.AbstractEslintSensor.execute(
	at org.sonar.scanner.sensor.AbstractSensorWrapper.analyse(
	at org.sonar.scanner.sensor.ModuleSensorsExecutor.execute(
	at org.sonar.scanner.sensor.ModuleSensorsExecutor.lambda$execute$1(
	at org.sonar.scanner.sensor.ModuleSensorsExecutor.withModuleStrategy(
	at org.sonar.scanner.sensor.ModuleSensorsExecutor.execute(
	at org.sonar.scanner.scan.ModuleScanContainer.doAfterStart(
	at org.sonar.core.platform.ComponentContainer.startComponents(
	at org.sonar.core.platform.ComponentContainer.execute(
	at org.sonar.scanner.scan.ProjectScanContainer.scan(
	at org.sonar.scanner.scan.ProjectScanContainer.scanRecursively(
	at org.sonar.scanner.scan.ProjectScanContainer.doAfterStart(
	at org.sonar.core.platform.ComponentContainer.startComponents(
	at org.sonar.core.platform.ComponentContainer.execute(
	at org.sonar.scanner.bootstrap.GlobalContainer.doAfterStart(
	at org.sonar.core.platform.ComponentContainer.startComponents(
	at org.sonar.core.platform.ComponentContainer.execute(
	at org.sonar.batch.bootstrapper.Batch.doExecute(
	at org.sonar.batch.bootstrapper.Batch.execute(
	at org.sonarsource.scanner.api.internal.batch.BatchIsolatedLauncher.execute(
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(
	at java.base/java.lang.reflect.Method.invoke(
	at org.sonarsource.scanner.api.internal.IsolatedLauncherProxy.invoke(
	at com.sun.proxy.$Proxy0.execute(Unknown Source)
	at org.sonarsource.scanner.api.EmbeddedScanner.doExecute(
	at org.sonarsource.scanner.api.EmbeddedScanner.execute(
	at org.sonarsource.scanner.cli.Main.execute(
	at org.sonarsource.scanner.cli.Main.execute(
	at org.sonarsource.scanner.cli.Main.main(
  • Steps to reproduce
    This is consistently happening when a PR triggers our pipelines

This seems similar to " The cache stream is too big" when running the scanner in our repository, but I don’t have the ability to modify the generated file that is creating the issue, and the HTML file that seems to map to does not have any lines over 100 characters long and is less than 1k total characters.

The overall run succeeds, but there are multiple errors around the cache entries.

INFO: Analysis total time: 3:26.971 s
INFO: ------------------------------------------------------------------------
INFO: ------------------------------------------------------------------------
INFO: Total time: 4:07.697s
INFO: Final Memory: 664M/2220M
INFO: ------------------------------------------------------------------------


Our general advice is to not analyze generated files.

Can you just set an exclusion for the file(s) in question?


From local testing, it looks like .scannerwork directory is created by Sonar. I can try adding an exclusion for it, but it seems odd that I need to exclude files generated by Sonar.


You shouldn’t need to. It sounds like perhaps your sonar.sources definition is overly broad…?


The sonar.sources is set to the root of the project, but .scannerwork/ is included in the .gitignore. I’ve also tried excluding **/*.ucfgs, and I still see the same error.

This looks like it’s some kind of issue with the cache that is generated for the JS inside HTML analysis. How can I clear that cache?


Sorry. I didn’t pay enough attention to the file path originally. We generated the file. :roll_eyes:.

I’m going to flag this for a deeper look.


Awesome, please keep me posted.

Hello Dan,

Many thanks for the feedback!

Those files are generated by mistake, as they shouldn’t. I created this ticket to address that issue as soon as possible.

However, these generated files don’t explain the root cause of the failure. I would need from you a minimal reproducible project example so that I can investigate further.

Thank you,

1 Like