ANALYSIS SUCCESSFUL but giving 401 while fetching Quality Gate status

Must-share information (formatted with Markdown):

  • which versions are you using (SonarQube, Scanner, Plugin, and any relevant extension) → 9.9
  • how is SonarQube deployed: zip, Docker, Helm → zip
  • what are you trying to achieve → Sonar scan report
  • what have you tried so far to achieve this → I created the Jenkins pipeline for this and integrated the sonar.

ANALYSIS SUCCESSFUL but giving 401 while fetching Quality Gate status.

I am using User type token with sonar-users group permission.


jenkins pipeline

Sonar stage in jenkins pipeline:

stage('Build and Test') {
        withSonarQubeEnv(installationName: 'sonar-server') {
          configFileProvider([configFile(fileId: 'MAVEN_SETTINGS_NEW', variable: 'MAVEN_SETTINGS_NEW')]) {
            sh "mvn -s ${MAVEN_SETTINGS_NEW} clean org.jacoco:jacoco-maven-plugin:0.8.10:report install sonar:sonar"
          }
        }
      }
stage("Quality Gate") {
        timeout(time: 3, unit: 'MINUTES') {
          sleep(40)
            def qg = waitForQualityGate()
              if (qg.status != 'OK') {
                error "Pipeline aborted due to quality gate failure: ${qg.status}"
              }
        }

Quality gate stage is failing with 401

Do not share screenshots of logs – share the text itself (bonus points for being well-formatted)!

Hi,

I setup the webhook for Jenkins but now I am getting 403, please help on this.

Uploading: image.png…

eg: Response: 403

Duration: 105ms

Payload:

{
“serverUrl”: “http://localhost:9000”,
“taskId”: “AYpGmRxWcbrKGEWJVeHO”,
“status”: “SUCCESS”,
“analysedAt”: “2023-08-30T13:18:46+0000”,
“revision”: “0919823f32b2323021bcb46c3882de14474ec033”,
“changedAt”: “2023-08-30T13:18:46+0000”,
“project”: {
“key”: “com.gks.unm.message:unm.message”,
“name”: “gks-unm-message-be”,
“url”: “http://localhost:9000/dashboard?id=com.gks.unm.message%3Aunm.message
},
“branch”: {
“name”: “main”,
“type”: “BRANCH”,
“isMain”: true,
“url”: “http://localhost:9000/dashboard?id=com.gks.unm.message%3Aunm.message
},

Please help on this, this is coming in prod env.

Hi,

I’m confused by this:

Since you say it’s a 403 (error) response, but that looks like a 200 response from some web service.

 
Ann