SonarScanner for MSBuild 4.8

Hi,

We use SonarQube Server Community Edition Version 7.9.2 (build 30863). And we have our TFS 2018 Build Pipeline with TFS Extension version 4.9.0.

We use the below given configuration.

Task : Prepare Analysis Configuration
Description : Prepare SonarQube analysis configuration
Version : 4.9.0
Author : sonarsource

During this task its giving the error attached in the log fine.1_Job.txt (6.1 KB)

But its working fine in standalone scanner mode. Not sure whats going wrong. Any help in this regard much appriciated,

Thanks,
Mohan

Hello @kumarmohe

The error you have here:
System.IO.InvalidDataException: End of Central Directory record could not be found.
is an underlying .NET error saying that the ZIP archive (of the C# analyzer) could not be well read by the scanner. As it works well in a standalone scanner, it’s likely not the archive itself the problem, but something in between.

My guess is that you have a proxy/load-balancer here that messes up with ZIP query so the content end up corrupted. You can turn on the debug mode on the Scanner (/d:sonar.verbose=true) so it logs the exact query it does before failing (something like <SONARQUBE_URL>/static/csharp/SonarAnalyzer-8.2.0.14119.zip).
You could then execute it manually from the same agent and see if the resulting ok is fine or not. Finally, you could check on your proxy/load-balancer logs what went wrong with this query.

I hope this helps.

Antoine

Thanks Antoine. Apologies for the delay. I will try that and let you know.

Thanks Antoine. I could fix the issue with your suggestion. It was failing to download and extract “SonarAnalyzer-8.3.0.14607.zip” from the server. I did this manually on the Build Sever for the service account user, and it worked.

Thanks for the support. Really appreciate it.

Thanks,
Mohan

Downloading SonarAnalyzer-8.3.0.14607.zip from https:///quality/static/csharp/SonarAnalyzer-8.3.0.14607.zip to C:\Users<User>\AppData\Local\Temp.sonarqube\resources\0
2020-06-25T14:53:51.4785958Z 10:53:51.468 Downloading file from https:///quality/static/csharp/SonarAnalyzer-8.3.0.14607.zip to C:\Users<User>\AppData\Local\Temp.sonarqube\resources\0\SonarAnalyzer-8.3.0.14607.zip…
2020-06-25T14:53:51.5200670Z 10:53:51.515 Extracting files to C:\Users<User>\AppData\Local\Temp.sonarqube\resources\0…
2020-06-25T14:53:51.5828632Z
2020-06-25T14:53:51.5829343Z ##[error]Unhandled Exception:
2020-06-25T14:53:51.5969431Z ##[error]System.IO.InvalidDataException: End of Central Directory record could not be found.

2 Likes

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