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.
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.