Error executing sensor: 'CFamily' with java.lang.IllegalStateException: unexpanded response file

  • Operating system: Win 10 21H1 (Build 19043)
  • IDE name and flavor/env: Visual Studio Code with PlatformIO
  • SonarLint plugin version: 3.4.1
  • Is connected mode used: no

I have already opened a ticket on PlatformIO which is my C++ build system because I thought the problem could be located there. As you can see it is not, as the other user can run SonarLint just fine:

It does not matter which project (recently created a new one from scratch), I get the following error from SonarLint:

[Info - 14:47:35.678] Analyzing file 'file:///c:/Users/Inso/Documents/PlatformIO/Projects/Text_SonarLint/src/main.cpp'...
[Info - 14:47:35.684] Index files
[Info - 14:47:35.685] 1 file indexed
[Error - 14:47:35.694] Error executing sensor: 'CFamily'
[Error - 14:47:35.694] java.lang.IllegalStateException: unexpanded response file
    at com.sonar.cpp.analyzer.ClangDriver.onCapture(
    at com.sonar.cpp.analyzer.CompilerDrivers.onCapture(
    at com.sonar.cpp.plugin.SonarLintSensor.lambda$processCompileCommands$1(
    at java.base/java.util.HashMap.forEach(
    at com.sonar.cpp.plugin.SonarLintSensor.processCompileCommands(
    at com.sonar.cpp.plugin.SonarLintSensor.process(
    at com.sonar.cpp.plugin.SonarLintSensor.execute(
    at com.sonar.cpp.plugin.CFamilySensor.execute(
    at org.sonarsource.sonarlint.core.analysis.container.analysis.sensor.SensorsExecutor.executeSensor(
    at org.sonarsource.sonarlint.core.analysis.container.analysis.sensor.SensorsExecutor.execute(
    at org.sonarsource.sonarlint.core.analysis.container.analysis.AnalysisContainer.doAfterStart(
    at org.sonarsource.sonarlint.core.plugin.commons.pico.ComponentContainer.startComponents(
    at org.sonarsource.sonarlint.core.plugin.commons.pico.ComponentContainer.execute(
    at org.sonarsource.sonarlint.core.analysis.container.module.ModuleContainer.analyze(
    at org.sonarsource.sonarlint.core.analysis.command.AnalyzeCommand.execute(
    at org.sonarsource.sonarlint.core.analysis.command.AnalyzeCommand.execute(
    at org.sonarsource.sonarlint.core.analysis.AnalysisEngine$AsyncCommand.execute(
    at org.sonarsource.sonarlint.core.analysis.AnalysisEngine.executeQueuedCommands(
    at java.base/

The verbose log and compile commands are attached at the end of this reply:

maybe it is more convenient to link them here than to paste all file content.

I now have also tried to install jdk and set it manually within the options, with no success.

Hi @Inso,

while generating the compilation database, can you set it to not use response files? Are you able to generate a compilation database with the response files expanded?

1 Like

Sorry for my late reply: no, only I can customize is to add the toolchain paths (which I btw just tried to toggle with no success).

PIO Compile Database Options

Hi @Inso ,

I would better check in Support for SonarLint in Visual Studio Code · Issue #4219 · platformio/platformio-core · GitHub why temporary response files end up in the compilation database. It is not a good practice that temporary response files appear in the compilation database as those files may not be available.