Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-54954

401 response requesting Quality Gate status

    XMLWordPrintable

    Details

    • Similar Issues:

      Description

      Analysis completes successfully but upon requesting the status of the quality gate at the end of the build a 401 response is received. Our user has full admin privileges for both the SonarQube project and the SonarQube instance.

       

      This did not occur in the previous SonarQube version we were using (6.x)

      12:44:36 org.quality.gates.jenkins.plugin.QGException: Expected status 200, got: 401. Response:
      12:44:36 at org.quality.gates.sonar.api.SonarHttpRequester.executeGetRequest(SonarHttpRequester.java:124)
      12:44:36 at org.quality.gates.sonar.api.SonarHttpRequester.getAPITaskInfo(SonarHttpRequester.java:151)
      12:44:36 at org.quality.gates.sonar.api.QualityGatesProvider.getAPIResultsForQualityGates(QualityGatesProvider.java:62) 12:44:36 at org.quality.gates.jenkins.plugin.BuildDecision.getStatus(BuildDecision.java:24)
      12:44:36 at org.quality.gates.jenkins.plugin.QGPublisher.perform(QGPublisher.java:85)
      12:44:36 at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)
      12:44:36 at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:744)
      12:44:36 at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:690)
      12:44:36 at hudson.model.Build$BuildExecution.post2(Build.java:186)
      12:44:36 at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:635)
      12:44:36 at hudson.model.Run.execute(Run.java:1749)
      12:44:36 at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
      12:44:36 at hudson.model.ResourceController.execute(ResourceController.java:97)
      12:44:36 at hudson.model.Executor.run(Executor.java:421)

       

       

        Attachments

          Activity

          Hide
          arkanjoms Rafael Ramos added a comment -

          Does this problem still occur?
          I tested the 7.4-community and 7.6-community versions and could not reproduce the problem.
          It was only possible to reproduce the error by using the wrong credentials.

          If the problem persists, please reopen this issue.

          Show
          arkanjoms Rafael Ramos added a comment - Does this problem still occur? I tested the 7.4-community and 7.6-community versions and could not reproduce the problem. It was only possible to reproduce the error by using the wrong credentials. If the problem persists, please reopen this issue.
          Hide
          miles_mason Miles Mason added a comment -

          Rafael Ramos - Yes, you're right, I needed to add permissions for "Administer Quality Gates" so the Jenkins user could get the status...

          Show
          miles_mason Miles Mason added a comment - Rafael Ramos - Yes, you're right, I needed to add permissions for "Administer Quality Gates" so the Jenkins user could get the status...
          Hide
          ramim Rami Ammar added a comment -

          I have this problem with plugin version 1.3.1 dor jenkins 2.190.1 and sonar server version 7.5. There is a fix for this problem? Can you help me to resolve it please?

          There is the exception:

          SonarQube analysis completed: SUCCESS
          quality.gates.jenkins.plugin.QGException: Expected status 200, got: 401. Response:
          at quality.gates.sonar.api.SonarHttpRequester.executeGetRequest(SonarHttpRequester.java:59)
          at quality.gates.sonar.api.SonarHttpRequester.getAPIInfo(SonarHttpRequester.java:47)
          at quality.gates.sonar.api.QualityGatesProvider.getRequesterResult(QualityGatesProvider.java:34)
          at quality.gates.sonar.api.QualityGatesProvider.getAPIResultsForQualityGates(QualityGatesProvider.java:29)
          at quality.gates.jenkins.plugin.BuildDecision.getStatus(BuildDecision.java:20)
          at quality.gates.jenkins.plugin.QGPublisher.perform(QGPublisher.java:73)
          at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)
          at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:741)
          at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:690)
          at hudson.model.Build$BuildExecution.post2(Build.java:186)
          at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:635)
          at hudson.model.Run.execute(Run.java:1840)
          at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
          at hudson.model.ResourceController.execute(ResourceController.java:97)
          at hudson.model.Executor.run(Executor.java:429)
          Build step 'Quality Gates' marked build as failure

           

          Thanks

          Rami

          Show
          ramim Rami Ammar added a comment - I have this problem with plugin version 1.3.1 dor jenkins 2.190.1 and sonar server version 7.5. There is a fix for this problem? Can you help me to resolve it please? There is the exception: SonarQube analysis completed: SUCCESS quality.gates.jenkins.plugin.QGException: Expected status 200, got: 401. Response: at quality.gates.sonar.api.SonarHttpRequester.executeGetRequest(SonarHttpRequester.java:59) at quality.gates.sonar.api.SonarHttpRequester.getAPIInfo(SonarHttpRequester.java:47) at quality.gates.sonar.api.QualityGatesProvider.getRequesterResult(QualityGatesProvider.java:34) at quality.gates.sonar.api.QualityGatesProvider.getAPIResultsForQualityGates(QualityGatesProvider.java:29) at quality.gates.jenkins.plugin.BuildDecision.getStatus(BuildDecision.java:20) at quality.gates.jenkins.plugin.QGPublisher.perform(QGPublisher.java:73) at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20) at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:741) at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:690) at hudson.model.Build$BuildExecution.post2(Build.java:186) at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:635) at hudson.model.Run.execute(Run.java:1840) at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43) at hudson.model.ResourceController.execute(ResourceController.java:97) at hudson.model.Executor.run(Executor.java:429) Build step 'Quality Gates' marked build as failure   Thanks Rami
          Hide
          rafaeltorress Rafael Teixeira added a comment -

          Hi there. The same it's happen with me.

           

          When I build some project with only sonar, it is ok. But if I add a rule with the quality gate, a action after build, my log it's the same.

          Quality Gate plugin version 1.3.1
          OS W10 professional. 

          I really don't know if matters but my Java is in C: and my project, F: (at this point I start to doubt everything). And my user has all administrator permissions

          Show
          rafaeltorress Rafael Teixeira added a comment - Hi there. The same it's happen with me.   When I build some project with only sonar, it is ok. But if I add a rule with the quality gate, a action after build, my log it's the same. Quality Gate plugin version 1.3.1 OS W10 professional.  I really don't know if matters but my Java is in C: and my project, F: (at this point I start to doubt everything). And my user has all administrator permissions

            People

            Assignee:
            arkanjoms Rafael Ramos
            Reporter:
            miles_mason Miles Mason
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: