Error MSB3677: Unable to move file "/home/vsts/work/1/.sonarqube/out/7/ProjectInfo.xml" to "/ProjectInfo.xml". Access to the path '/ProjectInfo.xml' is denied

Hi all, just got an issue with SonarQube with Azure DevOps build. Can you please help?

Sonar: (Abcd.Security.csproj) Project processed successfully

Sonar: (Abcd.Security.Demo.Mvc.csproj) Project processed successfully

Sonar: (Abcd.Security.Demo.Mvc.csproj) Project processed successfully

##[debug]Processed: ##vso[task.logdetail id=4ea2ede3-5a82-4ff8-8aa8-6b02922e8b45;parentid=;name=SonarQube.Integration.targets;type=Build;starttime=2022-02-07T22:22:05.0925152Z;state=InProgress;]

##[error]/home/vsts/work/1/.sonarqube/bin/targets/SonarQube.Integration.targets(405,5): Error MSB3677: Unable to move file "/home/vsts/work/1/.sonarqube/out/7/ProjectInfo.xml" to "/ProjectInfo.xml". Access to the path '/ProjectInfo.xml' is denied.

##[debug]Processed: ##vso[task.logissue type=Error;sourcepath=/home/vsts/work/1/.sonarqube/bin/targets/SonarQube.Integration.targets;linenumber=405;columnnumber=5;code=MSB3677;]Unable to move file "/home/vsts/work/1/.sonarqube/out/7/ProjectInfo.xml" to "/ProjectInfo.xml". Access to the path '/ProjectInfo.xml' is denied.

##[debug]Processed: ##vso[task.logdetail id=4ea2ede3-5a82-4ff8-8aa8-6b02922e8b45;parentid=;type=Build;result=Failed;finishtime=2022-02-07T22:22:05.0925780Z;progress=100;state=Completed;parentid=;name=;]

/home/vsts/work/1/.sonarqube/bin/targets/SonarQube.Integration.targets(405,5): error MSB3677: Unable to move file "/home/vsts/work/1/.sonarqube/out/7/ProjectInfo.xml" to "/ProjectInfo.xml". Access to the path '/ProjectInfo.xml' is denied. [/home/vsts/work/1/s/demo/Abcd.Security.Demo.Mvc/Abcd.Security.Demo.Mvc.csproj]

##[debug]Processed: ##vso[task.logdetail id=0038d48d-ab87-446d-8a77-b535bf0d131f;parentid=;name=SonarQube.Integration.targets;type=Build;starttime=2022-02-07T22:22:05.0928346Z;state=InProgress;]

##[error]/home/vsts/work/1/.sonarqube/bin/targets/SonarQube.Integration.targets(405,5): Error MSB3677: Unable to move file "/home/vsts/work/1/.sonarqube/out/6/ProjectInfo.xml" to "/ProjectInfo.xml". Access to the path '/ProjectInfo.xml' is denied.

##[debug]Processed: ##vso[task.logissue type=Error;sourcepath=/home/vsts/work/1/.sonarqube/bin/targets/SonarQube.Integration.targets;linenumber=405;columnnumber=5;code=MSB3677;]Unable to move file "/home/vsts/work/1/.sonarqube/out/6/ProjectInfo.xml" to "/ProjectInfo.xml". Access to the path '/ProjectInfo.xml' is denied.

##[debug]Processed: ##vso[task.logdetail id=0038d48d-ab87-446d-8a77-b535bf0d131f;parentid=;type=Build;result=Failed;finishtime=2022-02-07T22:22:05.0934843Z;progress=100;state=Completed;parentid=;name=;]

/home/vsts/work/1/.sonarqube/bin/targets/SonarQube.Integration.targets(405,5): error MSB3677: Unable to move file "/home/vsts/work/1/.sonarqube/out/6/ProjectInfo.xml" to "/ProjectInfo.xml". Access to the path '/ProjectInfo.xml' is denied. [/home/vsts/work/1/s/demo/Abcd.Security.Demo.Mvc/Abcd.Security.Demo.Mvc.csproj]

Build FAILED.

2 posts were split to a new topic: Broken GitHub analysis

Hello and welcome to the community!

Please give us the following version information:

Also, can you share the verbose logs for the build step please? (pass -v:diag to dotnet build).

Thanks.

@rodchenkov in addition to what Duncan had asked, would you be able to provide a minimal reproducer project? (I can send a private message if you don’t want to share it). Thanks!

FYI I’ve opened https://github.com/SonarSource/sonar-scanner-msbuild/issues/1199 . However I’d need more details to investigate.

An update @rodchenkov , we’ve found the root cause of the regression, describes in #1199. It manifests when ErrorLog is explicitly set in your MSBuild configuration.

We’ll prepare a new bugfix release, until then you should either use version 5.4.1 of the scanner, or not set ErrorLog explicitly.

Hi @rodchenkov

We’ve released the Scanner for .NET 5.5.3.43281 and also the SonarScanner for Azure DevOps. It should fix the error. Please let me know if it doesn’t.

I am still interested in your use case and why you were hitting this error, in order to tell if we have some other regression. While I found the issue in the code and fixed it, I wasn’t able to come up with an E2E test that would simulate a normal user scenario to hit the error.

Would you be willing to discuss this further (maybe in a private thread)?

Thanks,
Andrei

This topic was automatically closed after 10 days. New replies are no longer allowed.