Error: ##[error]08:27:57.65 Failed to create an empty directory 'D:\[path]\[path]\221\.sonarqube\out'. Please check that there are no open or read-only files in the directory and that you have the necessary read/write permissions.
Detailed error message: Could not find a part of the path 'D__[path]_[path]_221_s_[appname]_src_web_apps_WebHealth_wwwroot_lib_jquery_validation_unobtrusive_jquery_validate_unobtrusive_js_288_23_FE_18_ada_min_max_min_min_max.ucfg'.
Steps to reproduce: intermittent, but happening pretty regularly now
Work-around: unknown
We started seeing this with one of our projects when it was updated from .NET Core 3.1 to .NET 5. However, that commit didn’t make any changes to the UI, which is where the file name is coming from.
The error is the same in all cases - when it happens - but there are different results I’m seeing.
Most of the time, that absurdly long file name is there (in a pretty deep path). I cannot rename it or delete it in a normal manner, and end up having to use robocopy d:\ . /purge from the directory to delete it
Some of the time, I go there and the directory is empty. I end up just deleting the .sonarqube folder for that pipeline, and the next time it runs, it is successful
Three questions: (1) why is it creating such long file names (including part of the path), (2) why is it creating such a deep path, which exacerbates the problem, and (3) what, if anything can I do about it to get these builds working consistently again?
The path where that long file name gets created looks like this:
We also started seeing this recently on the file which name/path didn’t change for couple years.
Our current version is 8.7.1
(since sonar is out of my control I can’t say version we were before 8.7.1)
This is pretty pressing thing, could you please recommend any workaround or maybe version where this is fixed already?
Log message: Removing the existing directory: C:\agent\_work\558\.sonarqube\out Failed to create an empty directory 'C:\agent\_work\558\.sonarqube\out'. Please check that there are no open or read-only files in the directory and that you have the necessary read/write permissions. Detailed error message: Could not find a part of the path '_agent__work_558_s_src_[path]_[filename]_21_16_FE_5901__sc__xc__lo__xc__xc__xc__xc__xc__ti__q__xc__xc__xc.ucfg'.
Deleting the /out folder allows a single build to run, but any subsequent builds will automatically fail. So it seems like there is something in the folder that it builds upon that takes it over some kind of limit.
I noticed that this folder becomes quite large too as it never seems to get cleaned up between builds. Could this be the issue?
Okay, in order to get this working I have had to add a powershell script to do some manual clean up before and after our builds. This, however, is not a good long-term solution.
For anyone else who comes across this issue before anyone can even take notice of this thread this fixed it for us:
We are seeing this here as well for some projects and the JIRA-ticket is not public so I can’t follow whatever happened to it. Does @saberduck have any insight on a possible solution?
I’m still having this issue as well (the really long names, and rmdir doesn’t want to delete them all), but I’ve had success so far with this hacky workaround:
Would love a fix for this, i have the same issue on some pipelines.
Using SonarScanner for MSBuild 5.13 on Azure DevOps 2020 pipeline (running on Windows Agent).
Our Sonarqube is Data Center Edition Version 9.9.1