Versions used (SonarQube, Scanner, Plugin, and any relevant extension): SonarCloud extension for Azure DevOps 1.30.1 (Latest), windows-latest hosted agents
Error observed (wrap logs/code around triple quote for proper formatting): 2022-03-15T12:39:14.8577936Z ERROR: Failed to delete temp folder 2022-03-15T12:39:14.8579709Z java.nio.file.AccessDeniedException: D:\a\1\.sonarqube\out\.sonar\.sonartmp\13912262812298238453\jni.dll
Steps to reproduce: Create a standard .NET pipeline with SonarCloud analysis (Integrate with MSBuild) running on windows-hosted agents
In case of SonarCloud:
ALM used (GitHub, Bitbucket Cloud, Azure DevOps): Azure DevOps
CI system used (Bitbucket Cloud, Azure DevOps, Travis CI, Circle CI, Jenkins, other): Azure DevOps
We’re getting the same problem here too. Reproduced on both a self-hosted azure devops pipeline agent, and a microsoft-hosted agent.
Sample log extract:
14:13:39.912 DEBUG: Upload report
14:13:40.095 DEBUG: POST 200 https://sonarcloud.io/api/ce/submit?organization=REDACTED&projectKey=REDACTED&projectName=REDACTED | time=181ms
14:13:40.099 INFO: Analysis report uploaded in 185ms
14:13:40.105 DEBUG: Report metadata written to D:\a\_temp\sonar\0.1.0-batchedci-20220315140733-0454\b8021913-3249-2a68-4cf4-da6a8294631f\report-task.txt
14:13:40.105 INFO: ANALYSIS SUCCESSFUL, you can find the results at: https://sonarcloud.io/dashboard?id=REDACTED
14:13:40.105 INFO: Note that you will be able to access the updated dashboard once the server has processed the submitted analysis report
14:13:40.105 INFO: More about the report processing at https://sonarcloud.io/api/ce/task?id=REDACTED
14:13:40.112 DEBUG: Post-jobs :
##[error]14:13:40.136 ERROR: Failed to delete temp folder
java.nio.file.AccessDeniedException: D:\a\1\.sonarqube\out\.sonar\.sonartmp\18364497554461249186\jni.dll
at java.base/sun.nio.fs.WindowsException.translateToIOException(WindowsException.java:89)
at java.base/sun.nio.fs.WindowsException.rethrowAsIOException(WindowsException.java:103)
at java.base/sun.nio.fs.WindowsException.rethrowAsIOException(WindowsException.java:108)
##[debug]Processed: ##vso[task.logissue type=error;]14:13:40.136 ERROR: Failed to delete temp folder%0D%0Ajava.nio.file.AccessDeniedException: D:\a\1\.sonarqube\out\.sonar\.sonartmp\18364497554461249186\jni.dll%0D%0A at java.base/sun.nio.fs.WindowsException.translateToIOException(WindowsException.java:89)%0D%0A at java.base/sun.nio.fs.WindowsException.rethrowAsIOException(WindowsException.java:103)%0D%0A at java.base/sun.nio.fs.WindowsException.rethrowAsIOException(WindowsException.java:108)
14:13:40.136 ERROR: Failed to delete temp folder
java.nio.file.AccessDeniedException: D:\a\1\.sonarqube\out\.sonar\.sonartmp\18364497554461249186\jni.dll
at java.base/sun.nio.fs.WindowsException.translateToIOException(WindowsException.java:89)
at java.base/sun.nio.fs.WindowsException.rethrowAsIOException(WindowsException.java:103)
at java.base/sun.nio.fs.WindowsException.rethrowAsIOException(WindowsException.java:108)
##[error]at java.base/sun.nio.fs.WindowsFileSystemProvider.implDelete(WindowsFileSystemProvider.java:274)
at java.base/sun.nio.fs.AbstractFileSystemProvider.deleteIfExists(AbstractFileSystemProvider.java:110)
at java.base/java.nio.file.Files.deleteIfExists(Files.java:1181)
at org.sonar.api.impl.utils.DefaultTempFolder$DeleteRecursivelyFileVisitor.visitFile(DefaultTempFolder.java:101)
at org.sonar.api.impl.utils.DefaultTempFolder$DeleteRecursivelyFileVisitor.visitFile(DefaultTempFolder.java:96)
at java.base/java.nio.file.Files.walkFileTree(Files.java:2725)
It turns out we also started to face the issue on some of our internal jobs this morning. The issue results from an upgrade to our C/C++ analyzer – and a ticket has been created at CPP-3600.
We’ll keep you posted as we learn more about what the next steps are.
While the error may look scary – the analysis (and the step) succeeds and produces the expected analysis results. We plan to fix this soon (days to weeks, not hours). Is this causing any other issues beyond an annoying log in the build summary?
Is this causing any other issues beyond an annoying log in the build summary?
No, I can see the analysis results in SonarCloud and the quality gate check in Azure DevOps. It’s really just the annoying error message in the pipeline summary.
But it’s very very annoying, we have a big organisation and Sonar analysis is the standard in all our pipelines (a lot). People will keep investigating and wasting time on this untill it disappears. Unless if everyone has read my message on our organization-wide channel, but I doubt it
edit: we DO run out of disk space on our build agents very often since two days ago, more often than usual. Maybe that’s related to SonarCloud not properly cleaning up