Hello everybody,
I encoutered the same problem mentionned in this old topic : SQ creating really long file names
I want to scan a project during a CI Pipeline on Azure DevOps 2020 On Premise (as usual). But for some reason, for this specific project, i get this error :
Failed to create an empty directory 'D:\APPLI\AzureDevOps-Agent\_work\2598\.sonarqube\out
I thought it was due to a file path too long but the max i could mesure on this project was 205 caracters, so i doubt it.
Version of Tools
- SonarScanner for MSBuild 5.13.0 on Azure DevOps 2020 pipeline (running on Windows Agent).
- Sonarqube Data Center Edition Version 9.9.1
- Project to Analyse is written in c# and contains .js files in wwwroot/src (we exclude wwwroot/lib from analysis of course)
Here are the logs of the pipeline step Prepare Sonarqube Analysis
SonarScanner for MSBuild 5.13
Using the .NET Framework version of the Scanner for MSBuild
Default properties file was found at D:\APPLI\AzureDevOps-Agent\_work\_tasks\SonarQubePrepare_15b84ca1-b62f-4a2a-a403-89b77a063157\5.13.0\classic-sonar-scanner-msbuild\SonarQube.Analysis.xml
Loading analysis properties from D:\APPLI\AzureDevOps-Agent\_work\_tasks\SonarQubePrepare_15b84ca1-b62f-4a2a-a403-89b77a063157\5.13.0\classic-sonar-scanner-msbuild\SonarQube.Analysis.xml
sonar.verbose=true was specified - setting the log verbosity to 'Debug'
Pre-processing started.
Preparing working directories...
Using environment variables to determine the download directory...
Using environment variable 'AGENT_BUILDDIRECTORY', value 'D:\APPLI\AzureDevOps-Agent\_work\2598'
Cannot delete directory: 'D:\APPLI\AzureDevOps-Agent\_work\2598\.sonarqube\out' because Could not find a part of the path 'D__APPLI_AzureDevOps_Agent__work_2598_s_Portail_wwwroot_src_components_console_module_edit_console_module_components_specific_property_format_component_specific_property_format_component_js.ucfgs'..
Cannot delete file: 'D:\APPLI\AzureDevOps-Agent\_work\2598\.sonarqube\out\.sonar\mod0\ucfg2\js\D__APPLI_AzureDevOps_Agent__work_2598_s_Portail_wwwroot_src_components_console_module_edit_console_module_components_specific_property_format_component_specific_property_format_component_js.ucfgs' because Could not find a part of the path 'D__APPLI_AzureDevOps_Agent__work_2598_s_Portail_wwwroot_src_components_console_module_edit_console_module_components_specific_property_format_component_specific_property_format_component_js.ucfgs'..
14:28:31.59 14:28:31.574 Loading analysis properties from D:\APPLI\AzureDevOps-Agent\_work\_tasks\SonarQubePrepare_15b84ca1-b62f-4a2a-a403-89b77a063157\5.13.0\classic-sonar-scanner-msbuild\SonarQube.Analysis.xml
14:28:31.59 14:28:31.59 sonar.verbose=true was specified - setting the log verbosity to 'Debug'
14:28:31.606 Updating build integration targets...
14:28:31.606 The file SonarQube.Integration.ImportBefore.targets is up to date at C:\Users\SVCPBIPE8Build\AppData\Local\Microsoft\MSBuild\4.0\Microsoft.Common.targets\ImportBefore
14:28:31.606 The file SonarQube.Integration.ImportBefore.targets is up to date at C:\Users\SVCPBIPE8Build\AppData\Local\Microsoft\MSBuild\10.0\Microsoft.Common.targets\ImportBefore
14:28:31.606 The file SonarQube.Integration.ImportBefore.targets is up to date at C:\Users\SVCPBIPE8Build\AppData\Local\Microsoft\MSBuild\11.0\Microsoft.Common.targets\ImportBefore
14:28:31.606 The file SonarQube.Integration.ImportBefore.targets is up to date at C:\Users\SVCPBIPE8Build\AppData\Local\Microsoft\MSBuild\12.0\Microsoft.Common.targets\ImportBefore
14:28:31.606 The file SonarQube.Integration.ImportBefore.targets is up to date at C:\Users\SVCPBIPE8Build\AppData\Local\Microsoft\MSBuild\14.0\Microsoft.Common.targets\ImportBefore
14:28:31.606 The file SonarQube.Integration.ImportBefore.targets is up to date at C:\Users\SVCPBIPE8Build\AppData\Local\Microsoft\MSBuild\15.0\Microsoft.Common.targets\ImportBefore
14:28:31.606 The file SonarQube.Integration.ImportBefore.targets is up to date at C:\Users\SVCPBIPE8Build\AppData\Local\Microsoft\MSBuild\Current\Microsoft.Common.targets\ImportBefore
14:28:31.606 Installed SonarQube.Integration.targets to D:\APPLI\AzureDevOps-Agent\_work\2598\.sonarqube\bin\targets
14:28:31.606 Creating config and output folders...
14:28:31.606 Creating directory: D:\APPLI\AzureDevOps-Agent\_work\2598\.sonarqube\conf
14:28:31.606 Removing the existing directory: D:\APPLI\AzureDevOps-Agent\_work\2598\.sonarqube\out
##[error]14:28:31.621 Failed to create an empty directory 'D:\APPLI\AzureDevOps-Agent\_work\2598\.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__APPLI_AzureDevOps_Agent__work_2598_s_Portail_wwwroot_src_components_console_module_edit_console_module_components_specific_property_format_component_specific_property_format_component_js.ucfgs'.
##[debug]Processed: ##vso[task.logissue type=error;]14:28:31.621 Failed to create an empty directory 'D:\APPLI\AzureDevOps-Agent\_work\2598\.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.%0D%0A Detailed error message: Could not find a part of the path 'D__APPLI_AzureDevOps_Agent__work_2598_s_Portail_wwwroot_src_components_console_module_edit_console_module_components_specific_property_format_component_specific_property_format_component_js.ucfgs'.
14:28:31.621 Failed to create an empty directory 'D:\APPLI\AzureDevOps-Agent\_work\2598\.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__APPLI_AzureDevOps_Agent__work_2598_s_Portail_wwwroot_src_components_console_module_edit_console_module_components_specific_property_format_component_specific_property_format_component_js.ucfgs'.
##[error]14:28:31.621 Pre-processing failed. Exit code: 1
##[debug]Processed: ##vso[task.logissue type=error;]14:28:31.621 Pre-processing failed. Exit code: 1
14:28:31.621 Pre-processing failed. Exit code: 1
##[debug]Exit code 1 received from tool 'D:\APPLI\AzureDevOps-Agent\_work\_tasks\SonarQubePrepare_15b84ca1-b62f-4a2a-a403-89b77a063157\5.13.0\classic-sonar-scanner-msbuild\SonarScanner.MSBuild.exe'
##[debug]STDIO streams have closed for tool 'D:\APPLI\AzureDevOps-Agent\_work\_tasks\SonarQubePrepare_15b84ca1-b62f-4a2a-a403-89b77a063157\5.13.0\classic-sonar-scanner-msbuild\SonarScanner.MSBuild.exe'
##[debug]task result: Failed
##[error]The process 'D:\APPLI\AzureDevOps-Agent\_work\_tasks\SonarQubePrepare_15b84ca1-b62f-4a2a-a403-89b77a063157\5.13.0\classic-sonar-scanner-msbuild\SonarScanner.MSBuild.exe' failed with exit code 1
I would love some help to understand the behavior here and some guidance on a workaround if it exists.
Thanks everybody