Failed to create temp file


I am trying to run sonar:sonar command, and I am getting this error:

Failed to execute goal org.sonarsource.scanner.maven:sonar-maven-plugin: (default-cli) on project my-project: Failed to create temp file C:\Workspace\my-project\backend\target\sonar.sonartmp\

SonarQube instance: 9.4
java: 11

I also tried with different OS to create a report, but the result was the same.

Hey there.

In what context are you receiving this error? MANUAL runs? Using a specific CI (GitHub Actions, Azure DevOps, etc.)


I got this error on both my local analysis and on my jenkins instance.

we had the same problem (only after upgrading to sonar 9.4), sonar could not create the report zip because .sonartmp folder does not exist.
root cause was that we have a multi module project, and 2 /target folders were pointing to the same location. my guess is that after being done with one module sonar cleaned up (i.e. deleted the .sonartmp folder) that was still necessary to do the other module
hope it helps