Jenkins org.sonarqube.ws.client.HttpException:错误401

Jenkins org.sonarqube.ws.client.HttpException:错误401,jenkins,jenkins-pipeline,sonarscanner,quality-gate,Jenkins,Jenkins Pipeline,Sonarscanner,Quality Gate,我正在尝试运行声纳扫描仪并访问质量门结果,在尝试了论坛上建议的各种选项后,我有点不知所措。这是我第一次尝试发布,所以如果我遗漏了任何细节,请告诉我。我确实在sonarqube服务器webhooks控制台中看到了json负载,但它处于失败状态(红色十字标记)。我们的是一个共享的CBJ和SonarQube服务器,我对这两个服务器的访问都是有限的。非常感谢您的帮助/指导。非常感谢你 ====================================== 声纳qube配置 项目名称>管理>网络挂钩

我正在尝试运行声纳扫描仪并访问质量门结果,在尝试了论坛上建议的各种选项后,我有点不知所措。这是我第一次尝试发布,所以如果我遗漏了任何细节,请告诉我。我确实在sonarqube服务器webhooks控制台中看到了json负载,但它处于失败状态(红色十字标记)。我们的是一个共享的CBJ和SonarQube服务器,我对这两个服务器的访问都是有限的。非常感谢您的帮助/指导。非常感谢你

======================================

声纳qube配置 项目名称>管理>网络挂钩 名称:Webhook_Name 网址: 秘密:“webhook\u秘密\u文本”

======================================

CBJ配置 CredentialsID:'SonarQubeToken':值:作用域:全局凭据(不受限制)

======================================

Jenkins作业-管道脚本 /*这个阶段成功了*/

stage('SonarQube Analysis') {
        def scannerHome = tool 'Sonar-Prod';
        withSonarQubeEnv('Sonar-Prod') {
        sh """${scannerHome}/bin/sonar-scanner -X \
            -Dsonar.projectKey=ProjKey \
            -Dsonar.sources=src \
            -Dsonar.host.url=https://sonarqube_server_fqdn \
            -Dsonar.login=sonar_project_secret_text"""
        }
      }
/*在waitForQualityGate失败*/

stage("Quality Gate Status Check") {
            timeout(time: 1, unit: 'HOURS')// Just in case something goes wrong, pipeline will be killed after a timeout
           // had previously tried using waitForQualityGate() and waitForQualityGate(webhookSecretId: 'webhook_secret_text' with same result  
           def qg = waitForQualityGate(webhookSecretId: 'webhook_secret_text', credentialsId: 'sonar_project_secret_text') // Reuse taskId previously collected by withSonarQubeEnv
              if (qg.status != 'OK') {
                 error "Pipeline aborted due to quality gate failure: ${qg.status}"
               }
         }
=====================================

来自Jenkins服务器的日志-运行Sonascanner和qualitygate的作业
这是一个防火墙问题。Jenkins与SonarQube服务器之间的通信已打开,但并非相反。这个问题可以解决

这可能不需要结束,它似乎是一个足够好的问题在这里的候选人。您应该可以通过单击左侧的复选图标来接受自己的答案。这将把你的问题标记为“已回答”。如果你没有看到这个检查图标,给它几天时间,它就会出现。
SonarQube Scanner 4.2.0.1873
Java 1.8.0_242 Oracle Corporation (64-bit)
Linux 2.6.32-754.27.1.el6.x86_64 amd64
SonarQube server 7.9.1 - Community 7.9.1.27448
[CloudBees Jenkins Enterprise 2.204.3.7-rolling]


09:40:13.671 DEBUG: Upload report
09:40:13.931 DEBUG: POST 200 https://sonarqube_server_fqdn/api/ce/submit?projectKey=ProjKey | time=256ms
09:40:13.935 INFO: Analysis report uploaded in 264ms
09:40:13.938 INFO: ANALYSIS SUCCESSFUL, you can browse https://sonarqube_server_fqdn/dashboard?id=ProjKey
09:40:13.938 INFO: Note that you will be able to access the updated dashboard once the server has processed the submitted analysis report
09:40:13.938 INFO: More about the report processing at https://sonarqube_server_fqdn/api/ce/task?id=AXDt34Wae-uSoUyAgrS-

[Pipeline] waitForQualityGate
Checking status of SonarQube task 'AXDt34Wae-uSoUyAgrS-' on server 'Sonar-Prod'

org.sonarqube.ws.client.HttpException: Error 401 on https://sonarqube_server_fqdn/api/ce/task?id=AXDt34Wae-uSoUyAgrS-