I am experiencing some strange issues with our self-hosted SonarQube instance in an Azure yml pipeline.
I have added the Prepare Analysis Configuration in my .yml pipeline using a ubuntu-latest vmImage.
- task: SonarQubePrepare@6
inputs:
SonarQube: 'SonarQube'
scannerMode: 'MSBuild'
projectKey: 'deleted'
I have set up the Service connection with Read& Write access to the repository and followed the steps in the docs on connecting to the pipeline but when running it, I get the following error (or lack thereof):
##[warning]Error while executing SonarQube:Prepare task: [SQ] API GET ‘/api/server/version’ failed, error is The operation was aborted.
I’ve done this setup before with SonarCloud and it worked without a hitch so I’m wondering if it is not something to do with the self-hosted setup. I don’t have access to the deployment but I can share that there is no reverse proxy, it is deployed on a VM in Azure alongside a Jenkins instance (which can access SonarQube without any issues.)
I’ve tried setting and resetting the service connection in DevOps, resetting the token, basically trying to eliminate the possibility that I have missed permissions in Azure but I’m a bit stumped due to the lack of an error in the pipeline. I haven’t tried using a self-hosted version before so I’m not sure if maybe networking is getting in the way here
I have gotten some of the logs from the server and can see that the access.log is being spammed by my project:
10.0.0.162 - - [02/Sep/2024:15:43:30 +0200] “GET /api/ce/component?component=myProjectKey HTTP/1.1” 200 - “http://myhostUrl:portno/api/server/version/tutorials?id=myProjectKey&selectedTutorial=azure-pipelines” “Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/128.0.0.0 Safari/537.36” “key”
I can also see the service connection in Azure being accessed as well.
I’m tempted to point fingers at the HTTP call or the lack of a reverse proxy, but I am not sure if I’m headed in the right direction, since the log shows a lot of undefined fields. Any pointers are highly appreciated.
Full debug mode on the pipeline (edited out the URLs and keys):
##[debug]loading ENDPOINT_AUTH_PARAMETER_myGuid_USERNAME
##[debug]loading ENDPOINT_AUTH_SYSTEMVSSCONNECTION
##[debug]loading ENDPOINT_AUTH_SCHEME_SYSTEMVSSCONNECTION
##[debug]loading ENDPOINT_AUTH_PARAMETER_SYSTEMVSSCONNECTION_ACCESSTOKEN
##[debug]loading SECRET_SYSTEM_ACCESSTOKEN
##[debug]loaded 16
##[debug]Agent.ProxyUrl=undefined
##[debug]Agent.CAInfo=undefined
##[debug]Agent.ClientCert=undefined
##[debug]Agent.SkipCertValidation=undefined
##[debug]Agent.ProxyUrl=undefined
##[debug]Agent.CAInfo=undefined
##[debug]Agent.ClientCert=undefined
##[debug]check path : /home/vsts/work/_tasks/SonarQubePrepare_guid/6.3.2/lib.json
##[debug]adding resource file: /home/vsts/work/_tasks/SonarQubePrepare_guid/6.3.2/lib.json
##[debug]system.culture=en-US
##[debug]SonarQube=removed
##[debug]myGuid=http://myhostUrl:portno/
##[debug]myGuid auth param apitoken = undefined
##[debug]myGuid auth param username = ***
##[debug]myGuid auth param password = undefined
##[debug]organization=undefined
##[debug]scannerMode=MSBuild
##[debug]projectKey=myProjectKeyFromSonar
##[debug]projectName=undefined
##[debug]projectVersion=1.0
##[debug]organization=undefined
##[debug][SQ] API GET: '/api/server/version' with full URL "http://myhostUrl:portno/api/server/version" and query "undefined"
##[debug]Not using a proxy agent
##[debug][SQ] API GET '/api/server/version' failed, error is The operation was aborted.
##[warning]Error while executing SonarQube:Prepare task: [SQ] API GET '/api/server/version' failed, error is The operation was aborted.
##[debug]Processed: ##vso[task.issue type=warning;]Error while executing SonarQube:Prepare task: [SQ] API GET '/api/server/version' failed, error is The operation was aborted.
##[debug]task result: Failed
##[error][SQ] API GET '/api/server/version' failed, error is The operation was aborted.
##[debug]Processed: ##vso[task.issue type=error;][SQ] API GET '/api/server/version' failed, error is The operation was aborted.
##[debug]Processed: ##vso[task.complete result=Failed;][SQ] API GET '/api/server/version' failed, error is The operation was aborted.