SonarCloud & Azure DevOps Windows hosted agents: Failed to delete temp folder

  • 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

Cheers,
Robin

5 Likes

Hey there.

Can you give a little bit more context to these logs? At what point is the error thrown? What logs came before it?

Hey Colin,

sure, the logs are from the SonarCloudAnalyze task in Azure DevOps:


image

Cheers,
Robin

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)
2 Likes

Hey there.

Thanks for the reports.

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.

4 Likes

Hey Colin,

just want to add that this problem is exclusive to Windows agents - we’re not facing any issues with our Ubuntu agents.

Cheers,
Robin

Hey @RobCo and @vincebowdren

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?

Hey Colin,

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.

Cheers,
Robin

No, just the distracting error messages in the build summary.

Indeed, same here. Just the error message.

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 :smiley:

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

1 Like

Same here, seeing the error all over the place on all our teams’ builds.

1 Like

Ehhh… here too. What is going on?

1 Like

This seems to cause builds to fail (on AppVeyor). See e.g. AppVeyor

Hey all.

We expect to deploy a new version of our C/C++ analyzer on Monday which fixes the issue. Sorry for the noise, and we appreciate your patience. :pray:

4 Likes

Hi there;

We also have that issue. Any progress so far?

A new version of our C/C++ analyzer has been deployed. The issue should be resolved.

1 Like

Confirmed, we’re no longer getting the error messages in the Run Code Analysis task.

Thanks for the help :slight_smile:

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.