将 sonarqube 与 azure 集成时出现 ETIMEOUT 错误
Getting ETIMEOUT error while integrating sonarqube with azure
我正在尝试将 sonarqube(企业版)与我的 azure 集成。我正在开发一个 iOS 移动应用程序项目。
我添加了以下任务以准备在我的 Azure 管道中进行声纳分析。
- task: SonarQubePrepare@4
displayName: 'Prepare for Sonar'
inputs:
SonarQube: 'SONARSERVICECONNECTION'
scannerMode: 'CLI'
configMode: 'manual'
cliProjectKey: 'com.ios.demoapp'
cliProjectName: 'com.ios.demo'
cliSources: '.'
extraProperties: |
# Additional properties that will be passed to the scanner,
# Put one key=value per line, example:
sonar.host.url=https://sonarprod.abc.xyz
sonar.login=d8s902h3hhh3jkl2kl2bn2j2l2b2kk2bn2
sonar.test.inclusions=**/*Test*/**
sonar.test.inclusions=*.swift
sonar.exclusions=Pods/**/*
Azure 构建管道在此任务上失败并出现以下错误:
Starting: Prepare for Sonar
==============================================================================
Task : Prepare Analysis Configuration
Description : Prepare SonarQube analysis configuration
Version : 4.21.0
Author : sonarsource
Help : Version: 4.21.0. [More Information](http://redirect.sonarsource.com/doc/install-configure-scanner-tfs-ts.html)
==============================================================================
##[debug]Using node path: /Users/runner/runners/2.189.0/externals/node/bin/node
##[debug]agent.TempDirectory=/Users/runner/work/_temp
##[debug]loading inputs and endpoints
##[debug]loading INPUT_SONARQUBE
##[debug]loading INPUT_SCANNERMODE
##[debug]loading INPUT_CONFIGMODE
##[debug]loading INPUT_CONFIGFILE
##[debug]loading INPUT_CLIPROJECTKEY
##[debug]loading INPUT_CLIPROJECTNAME
##[debug]loading INPUT_CLIPROJECTVERSION
##[debug]loading INPUT_PROJECTVERSION
##[debug]loading INPUT_CLISOURCES
##[debug]loading INPUT_EXTRAPROPERTIES
##[debug]loading ENDPOINT_AUTH_c36045b9-93fa-4ab7-95d0-205b5621232e
##[debug]loading ENDPOINT_AUTH_SCHEME_c36045b9-93fa-4ab7-95d0-205b5621232e
##[debug]loading ENDPOINT_AUTH_PARAMETER_c36045b9-93fa-4ab7-95d0-205b5621232e_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]loading SECRET_P12PASSWORD
##[debug]loading SECRET_KEYCHAINPASSWORD
##[debug]loaded 19
##[debug]Agent.ProxyUrl=undefined
##[debug]Agent.CAInfo=undefined
##[debug]Agent.ClientCert=undefined
##[debug]Agent.SkipCertValidation=undefined
##[debug]SonarQube=c36045b9-93fa-4ab7-95d0-205b5621232e
##[debug]c36045b9-93fa-4ab7-95d0-205b5621232e=https://sonarprod.abc.xyz
##[debug]c36045b9-93fa-4ab7-95d0-205b5621232e auth param apitoken = null
##[debug]c36045b9-93fa-4ab7-95d0-205b5621232e auth param username = ***
##[debug]c36045b9-93fa-4ab7-95d0-205b5621232e auth param password = null
##[debug]organization=null
##[debug]scannerMode=CLI
##[debug]configMode=manual
##[debug]cliProjectKey=com.ios.demoapp
##[debug]cliProjectName=com.ios.demo
##[debug]cliProjectVersion=1.0
##[debug]cliSources=/Users/runner/work/1/s
##[debug][SQ] API GET: '/api/server/version' with query "undefined"
##[debug][SQ] API GET '/api/server/version' failed, error was: {"code":"ETIMEDOUT","errno":"ETIMEDOUT","syscall":"connect","address":"***.**.***.**","port":443}
##[debug]task result: Failed
##[error][SQ] API GET '/api/server/version' failed, error was: {"code":"ETIMEDOUT","errno":"ETIMEDOUT","syscall":"connect","address":"***.**.***.**","port":443}
##[debug]Processed: ##vso[task.issue type=error;][SQ] API GET '/api/server/version' failed, error was: {"code":"ETIMEDOUT","errno":"ETIMEDOUT","syscall":"connect","address":"***.**.***.**","port":443}
##[debug]Processed: ##vso[task.complete result=Failed;][SQ] API GET '/api/server/version' failed, error was: {"code":"ETIMEDOUT","errno":"ETIMEDOUT","syscall":"connect","address":"57.188.3.133","port":443}
我不明白为什么会失败?
我还没有安装任何声纳扫描仪。我真的需要安装一个吗?如果是,那么应该安装在哪里?
我使用的是 Sonar 的企业版,它无法连接到 MAC 系统。
因此,我为声纳创建了一个单独的作业,并将代理 machine 分配为 WINDOWS。由于声纳运行静态分析,因此不需要 mac machine 来分析我的 iOS 应用程序代码。
- job: Sonar_Analysis
pool:
vmImage: 'windows-2019'
steps:
- task: SonarQubePrepare@4
displayName: 'Prepare for Sonar'
等等...
我正在尝试将 sonarqube(企业版)与我的 azure 集成。我正在开发一个 iOS 移动应用程序项目。
我添加了以下任务以准备在我的 Azure 管道中进行声纳分析。
- task: SonarQubePrepare@4
displayName: 'Prepare for Sonar'
inputs:
SonarQube: 'SONARSERVICECONNECTION'
scannerMode: 'CLI'
configMode: 'manual'
cliProjectKey: 'com.ios.demoapp'
cliProjectName: 'com.ios.demo'
cliSources: '.'
extraProperties: |
# Additional properties that will be passed to the scanner,
# Put one key=value per line, example:
sonar.host.url=https://sonarprod.abc.xyz
sonar.login=d8s902h3hhh3jkl2kl2bn2j2l2b2kk2bn2
sonar.test.inclusions=**/*Test*/**
sonar.test.inclusions=*.swift
sonar.exclusions=Pods/**/*
Azure 构建管道在此任务上失败并出现以下错误:
Starting: Prepare for Sonar
==============================================================================
Task : Prepare Analysis Configuration
Description : Prepare SonarQube analysis configuration
Version : 4.21.0
Author : sonarsource
Help : Version: 4.21.0. [More Information](http://redirect.sonarsource.com/doc/install-configure-scanner-tfs-ts.html)
==============================================================================
##[debug]Using node path: /Users/runner/runners/2.189.0/externals/node/bin/node
##[debug]agent.TempDirectory=/Users/runner/work/_temp
##[debug]loading inputs and endpoints
##[debug]loading INPUT_SONARQUBE
##[debug]loading INPUT_SCANNERMODE
##[debug]loading INPUT_CONFIGMODE
##[debug]loading INPUT_CONFIGFILE
##[debug]loading INPUT_CLIPROJECTKEY
##[debug]loading INPUT_CLIPROJECTNAME
##[debug]loading INPUT_CLIPROJECTVERSION
##[debug]loading INPUT_PROJECTVERSION
##[debug]loading INPUT_CLISOURCES
##[debug]loading INPUT_EXTRAPROPERTIES
##[debug]loading ENDPOINT_AUTH_c36045b9-93fa-4ab7-95d0-205b5621232e
##[debug]loading ENDPOINT_AUTH_SCHEME_c36045b9-93fa-4ab7-95d0-205b5621232e
##[debug]loading ENDPOINT_AUTH_PARAMETER_c36045b9-93fa-4ab7-95d0-205b5621232e_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]loading SECRET_P12PASSWORD
##[debug]loading SECRET_KEYCHAINPASSWORD
##[debug]loaded 19
##[debug]Agent.ProxyUrl=undefined
##[debug]Agent.CAInfo=undefined
##[debug]Agent.ClientCert=undefined
##[debug]Agent.SkipCertValidation=undefined
##[debug]SonarQube=c36045b9-93fa-4ab7-95d0-205b5621232e
##[debug]c36045b9-93fa-4ab7-95d0-205b5621232e=https://sonarprod.abc.xyz
##[debug]c36045b9-93fa-4ab7-95d0-205b5621232e auth param apitoken = null
##[debug]c36045b9-93fa-4ab7-95d0-205b5621232e auth param username = ***
##[debug]c36045b9-93fa-4ab7-95d0-205b5621232e auth param password = null
##[debug]organization=null
##[debug]scannerMode=CLI
##[debug]configMode=manual
##[debug]cliProjectKey=com.ios.demoapp
##[debug]cliProjectName=com.ios.demo
##[debug]cliProjectVersion=1.0
##[debug]cliSources=/Users/runner/work/1/s
##[debug][SQ] API GET: '/api/server/version' with query "undefined"
##[debug][SQ] API GET '/api/server/version' failed, error was: {"code":"ETIMEDOUT","errno":"ETIMEDOUT","syscall":"connect","address":"***.**.***.**","port":443}
##[debug]task result: Failed
##[error][SQ] API GET '/api/server/version' failed, error was: {"code":"ETIMEDOUT","errno":"ETIMEDOUT","syscall":"connect","address":"***.**.***.**","port":443}
##[debug]Processed: ##vso[task.issue type=error;][SQ] API GET '/api/server/version' failed, error was: {"code":"ETIMEDOUT","errno":"ETIMEDOUT","syscall":"connect","address":"***.**.***.**","port":443}
##[debug]Processed: ##vso[task.complete result=Failed;][SQ] API GET '/api/server/version' failed, error was: {"code":"ETIMEDOUT","errno":"ETIMEDOUT","syscall":"connect","address":"57.188.3.133","port":443}
我不明白为什么会失败?
我还没有安装任何声纳扫描仪。我真的需要安装一个吗?如果是,那么应该安装在哪里?
我使用的是 Sonar 的企业版,它无法连接到 MAC 系统。
因此,我为声纳创建了一个单独的作业,并将代理 machine 分配为 WINDOWS。由于声纳运行静态分析,因此不需要 mac machine 来分析我的 iOS 应用程序代码。
- job: Sonar_Analysis
pool:
vmImage: 'windows-2019'
steps:
- task: SonarQubePrepare@4
displayName: 'Prepare for Sonar'
等等...