Azure DevOps build pipeline does not work through IIS reverse Proxy for SonarQube

Hello,

I set up IIS reverse proxy to enable SSL for SonarQube 9.4 developer edition. The reverse proxy works on SonarQube web portal for user to connect. It also work on the Azure DevOps build agent machine.
But Azure DevOps build pipeline, when sonarqube service connection directly connected to sonarqube not through proxy, build pipeline succeed, but when sonarqube service connection using proxy to sonarqube, it failed. Error message said it can’t reach the proxy.

Here is the log.

Code coverage command line tool: C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\Team Tools\Dynamic Code Coverage Tools\CodeCoverage.exe

Fetching code coverage report information from TFS…

Attempting to locate a test results (.trx) file…

Looking for TRX files in: C:\agent2_work\4\TestResults, C:\agent2_work\4\s\TestResults

No test results files found

Did not find any binary coverage files in the expected location.

Falling back on locating coverage files in the agent temp directory.

Searching for coverage files in C:\agent2_work_temp

No coverage files found in the agent temp directory.

Coverage report conversion completed successfully.

The TFS Processor has finished

Calling the SonarScanner CLI…

INFO: Scanner configuration file: C:\agent2_work_tasks\SonarQubePrepare_15b84ca1-b62f-4a2a-a403-89b77a063157\4.23.1\classic-sonar-scanner-ms***\sonar-scanner-4.6.2.2472\bin..\conf\sonar-scanner.properties

INFO: Project root configuration file: C:\agent2_work\4.sonarqube\out\sonar-project.properties

INFO: SonarScanner 4.6.2.2472

INFO: Java 11.0.15 Microsoft (64-bit)

INFO: Windows Server 2016 10.0 amd64

INFO: User cache: C:\Windows\ServiceProfiles\NetworkService.sonar\cache

##[error]ERROR: SonarQube server [https://proxyserverurl] can not be reached

ERROR: SonarQube server [https://proxyserverurl] can not be reached

INFO: ------------------------------------------------------------------------

INFO: EXECUTION FAILURE

INFO: ------------------------------------------------------------------------

INFO: Total time: 3.893s

INFO: Final Memory: 3M/20M

##[error]ERROR: Error during SonarScanner execution

ERROR: Error during SonarScanner execution

Please help and share your solution. Thank you

It looks like your server can’t get in touch with Azure DevOps – I would suggest you take the scanner out of the picture entirely and test the connection using a tool like SSLPoke .

Thanks Colin. I found the same issue and solution by Mark. "SonarQube server https://{myserver} can not be reached" in step 3 of Sonar Scanner manual scan

1 Like

We are able to follow Mark Everest suggestion and fix the issue. It works, Thanks! Mark Everest