Languages of the repository: C#
Currently having an issue when trying to setup SonarCloudPrepare on a local agent behind a firewall to Azure Devops
At first got the following error
Starting: SonarCloudPrepare
==============================================================================
Task : Prepare Analysis Configuration
Description : Prepare SonarCloud analysis configuration
Version : 1.39.0
Author : sonarsource
Help : Version: 1.39.0. [More Information](https://docs.sonarcloud.io/advanced-setup/ci-based-analysis/sonarcloud-extension-for-azure-devops/)
==============================================================================
##[error][SQ] API GET '/api/server/version' failed, error is connect ECONNREFUSED 18.155.229.118:443
Finishing: SonarCloudPrepare
After reading a few random articles here and there, attempted to set windows proxy (didnt work)
Added a proxy env var HTTP_PROXY and HTTPS_PROXY
Then new error appeared
Starting: SonarCloudPrepare
==============================================================================
Task : Prepare Analysis Configuration
Description : Prepare SonarCloud analysis configuration
Version : 1.39.0
Author : sonarsource
Help : Version: 1.39.0. [More Information](https://docs.sonarcloud.io/advanced-setup/ci-based-analysis/sonarcloud-extension-for-azure-devops/)
==============================================================================
##[error][SQ] API GET '/api/server/version' failed, error is write EPROTO 6080:error:1408F10B:SSL routines:ssl3_get_record:wrong version number:c:\ws\deps\openssl\openssl\ssl\record\ssl3_record.c:332:
Finishing: SonarCloudPrepare
Yaml im using is as follows
- task: SonarCloudPrepare@1
displayName: Prepare Code Analysis
inputs:
SonarCloud: '#REDACTED#'
organization: '#REDACTED#'
scannerMode: 'MSBuild'
projectKey: '#REDACTED#'
projectName: '#REDACTED#'
extraProperties: |
# Additional properties that will be passed to the scanner,
# Put one key=value per line, example:
sonar.verbose=true
sonar.exclusions=#REDACTED#
sonar.cs.opencover.reportsPaths=$(Agent.TempDirectory)/**/coverage.opencover.xml
I dont see any issues with the config and if we use a Azure Hosted Agent we do connect successfully
Im guessing it is having an issue with the proxy etc and the firewall or something is blocking access.
Just wondering if anyone else has had these errors (specifically the second one) and any resolutions to it?
Hi, we are having the same issue. The plugin on Azure DevOps seems to have been updated recently.
We changed the âSonarcloud prepareâ task to reference the 1.38.0 version of the plugin and that seems to work, but all the versions after that seems to be broken. It also looks like the âPublish resultsâ task needs to be pinned to 1.13.0 as that is also broken in the same way.
We are getting the issue for all sonarcloud scans. .net, java, js etc.
Hi, yes that is correct. we did not change anything, it just stopped working yesterday. We checked the Azure DevOps extensions and saw that the plugin was updated just before the issue started.
This didnât fix the problem for us. We are running the tasks (Prepare analysis 1.40.1) behind a proxy and the message still is ERR_SECURE_CONNECT_FAIL combined with ERR_BAD_RESPONSE.
I notice you have reverted the use of axios and pushed a new version. I can confirm that extension version 1.44.2 with Prepare Analysis task version 1.40.2 has fixed the issue.
Using Extension 1.44.2
and version 1.40.2 for task SonarCloudPrepare
Still having issues, (even though now gets further)
I can see agent is running behind proxy in the Init Job Section.
once it tries to run Prepare step it fails but further along
Compared to previous flags only change was setting the version number
- task: SonarCloudPrepare@1.40.2
Starting: SonarCloudPrepare
==============================================================================
Task : Prepare Analysis Configuration
Description : Prepare SonarCloud analysis configuration
Version : 1.40.2
Author : sonarsource
Help : Version: 1.40.2. [More Information](https://docs.sonarcloud.io/advanced-setup/ci-based-analysis/sonarcloud-extension-for-azure-devops/)
==============================================================================
C:\agent\_work\_tasks\SonarCloudPrepare_14d9cde6-c1da-4d55-aa01-2965cd301255\1.40.2\classic-sonar-scanner-msbuild\SonarScanner.MSBuild.exe begin /k:Bell-Financial_Onboarding.Service /o:bell-financial-group
SonarScanner for MSBuild 5.14
Using the .NET Framework version of the Scanner for MSBuild
Pre-processing started.
Preparing working directories...
09:17:23.392 09:17:23.376 Loading analysis properties from C:\agent\_work\_tasks\SonarCloudPrepare_#redacted#\1.40.2\classic-sonar-scanner-msbuild\SonarQube.Analysis.xml
09:17:23.392 09:17:23.392 sonar.verbose=true was specified - setting the log verbosity to 'Debug'
09:17:23.408 Updating build integration targets...
09:17:23.408 The file SonarQube.Integration.ImportBefore.targets is up to date at C:\Windows\ServiceProfiles\NetworkService\AppData\Local\Microsoft\MSBuild\4.0\Microsoft.Common.targets\ImportBefore
09:17:23.408 The file SonarQube.Integration.ImportBefore.targets is up to date at C:\Windows\ServiceProfiles\NetworkService\AppData\Local\Microsoft\MSBuild\10.0\Microsoft.Common.targets\ImportBefore
09:17:23.408 The file SonarQube.Integration.ImportBefore.targets is up to date at C:\Windows\ServiceProfiles\NetworkService\AppData\Local\Microsoft\MSBuild\11.0\Microsoft.Common.targets\ImportBefore
09:17:23.408 The file SonarQube.Integration.ImportBefore.targets is up to date at C:\Windows\ServiceProfiles\NetworkService\AppData\Local\Microsoft\MSBuild\12.0\Microsoft.Common.targets\ImportBefore
09:17:23.408 The file SonarQube.Integration.ImportBefore.targets is up to date at C:\Windows\ServiceProfiles\NetworkService\AppData\Local\Microsoft\MSBuild\14.0\Microsoft.Common.targets\ImportBefore
09:17:23.408 The file SonarQube.Integration.ImportBefore.targets is up to date at C:\Windows\ServiceProfiles\NetworkService\AppData\Local\Microsoft\MSBuild\15.0\Microsoft.Common.targets\ImportBefore
09:17:23.408 The file SonarQube.Integration.ImportBefore.targets is up to date at C:\Windows\ServiceProfiles\NetworkService\AppData\Local\Microsoft\MSBuild\Current\Microsoft.Common.targets\ImportBefore
09:17:23.408 Installed SonarQube.Integration.targets to C:\agent\_work\15\.sonarqube\bin\targets
09:17:23.408 Creating config and output folders...
09:17:23.408 Creating directory: C:\agent\_work\15\.sonarqube\conf
09:17:23.408 Creating directory: C:\agent\_work\15\.sonarqube\out
09:17:23.439 Fetching server version...
09:17:23.439 Downloading from https://sonarcloud.io/api/server/version...
##[error]09:17:31.691 Unable to connect to server. Please check if the server is running and if the address is correct. Url: 'https://sonarcloud.io/api/server/version'.
09:17:31.691 Unable to connect to server. Please check if the server is running and if the address is correct. Url: 'https://sonarcloud.io/api/server/version'.
09:17:31.691 System.Net.WebException: Unable to connect to the remote server ---> System.Net.Sockets.SocketException: No connection could be made because the target machine actively refused it 18.155.229.118:443
at System.Net.Sockets.Socket.InternalEndConnect(IAsyncResult asyncResult)
at System.Net.Sockets.Socket.EndConnect(IAsyncResult asyncResult)
at System.Net.ServicePoint.ConnectSocketInternal(Boolean connectFailure, Socket s4, Socket s6, Socket& socket, IPAddress& address, ConnectSocketState state, IAsyncResult asyncResult, Exception& exception)
--- End of inner exception stack trace ---
at System.Net.HttpWebRequest.EndGetResponse(IAsyncResult asyncResult)
at System.Net.Http.HttpClientHandler.GetResponseCallback(IAsyncResult ar)
##[error]09:17:31.691 An error occured while querying the server version! Please check if the server is running and if the address is correct.
09:17:31.691 An error occured while querying the server version! Please check if the server is running and if the address is correct.
##[error]09:17:31.691 Pre-processing failed. Exit code: 1
09:17:31.691 Pre-processing failed. Exit code: 1
##[error]The process 'C:\agent\_work\_tasks\SonarCloudPrepare_#redacted#\1.40.2\classic-sonar-scanner-msbuild\SonarScanner.MSBuild.exe' failed with exit code 1
Finishing: SonarCloudPrepare
Youâre failing with the latest version on the first call to SonarCloud. Can you verify that thereâs nothing âhelpfulâ on the network that may be interfering?
Also, Colin asked this earlier and Iâm not sure you responded: