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

401 when trying to update the build status in gitea

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Not A Defect
    • Icon: Minor Minor
    • gitea-plugin
    • None
    • Jenkins X with the gitea addon enabled on GKE

      I can use Jenkins X with gitea and the gitea-plugin to create repos & setup MultiBranchProjects for PRs/master and webhooks and all that are working great. 
       
      However each pipeilne build fails to update the build status. Here's the exceptions that are generated at the beginning and end of a pipeline run. Its a little odd its a 401 as there's 1 credential used for querying the MBP branches, reading repos from gitea and doing commits/issues/PRs etc - so the credential is fine and the same credential is used in the Jenkins server config + the MBp
       
      Here's a sample stack trace at the start...
      [Gitea] Notifying branch build status: PENDING Build started... ERROR: Could not send notifications org.jenkinsci.plugin.gitea.client.api.GiteaHttpStatusException: HTTP 401/Unauthorized {"context":"test-user/environment-jstrachan-test8-staging/master","description":"Build started...","state":"pending","status":"pending","target_url":"http://jenkins.jx.35.197.207.229.nip.io/job/test-user/job/environment-jstrachan-test8-staging/job/master/2/display/redirect"} at org.jenkinsci.plugin.gitea.client.impl.DefaultGiteaConnection.post(DefaultGiteaConnection.java:911) at org.jenkinsci.plugin.gitea.client.impl.DefaultGiteaConnection.createCommitStatus(DefaultGiteaConnection.java:550) at org.jenkinsci.plugin.gitea.GiteaNotifier.sendNotifications(GiteaNotifier.java:144) at org.jenkinsci.plugin.gitea.GiteaNotifier.access$200(GiteaNotifier.java:66) at org.jenkinsci.plugin.gitea.GiteaNotifier$JobCheckOutListener.onCheckout(GiteaNotifier.java:277) at org.jenkinsci.plugins.workflow.steps.scm.SCMStep.checkout(SCMStep.java:127) at org.jenkinsci.plugins.workflow.steps.scm.SCMStep$StepExecutionImpl.run(SCMStep.java:85) at org.jenkinsci.plugins.workflow.steps.scm.SCMStep$StepExecutionImpl.run(SCMStep.java:75) at org.jenkinsci.plugins.workflow.steps.AbstractSynchronousNonBlockingStepExecution$1$1.call(AbstractSynchronousNonBlockingStepExecution.java:47) at hudson.security.ACL.impersonate(ACL.java:290) at org.jenkinsci.plugins.workflow.steps.AbstractSynchronousNonBlockingStepExecution$1.run(AbstractSynchronousNonBlockingStepExecution.java:44) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at java.lang.Thread.run(Thread.java:748)  
       
      then at the end:
      [Gitea] Notifying branch build status: SUCCESS This commit looks good ERROR: Could not send notifications org.jenkinsci.plugin.gitea.client.api.GiteaHttpStatusException: HTTP 401/Unauthorized {"context":"test-user/environment-jstrachan-test8-staging/master","description":"This commit looks good","state":"success","status":"success","target_url":"http://jenkins.jx.35.197.207.229.nip.io/job/test-user/job/environment-jstrachan-test8-staging/job/master/2/display/redirect"} at org.jenkinsci.plugin.gitea.client.impl.DefaultGiteaConnection.post(DefaultGiteaConnection.java:911) at org.jenkinsci.plugin.gitea.client.impl.DefaultGiteaConnection.createCommitStatus(DefaultGiteaConnection.java:550) at org.jenkinsci.plugin.gitea.GiteaNotifier.sendNotifications(GiteaNotifier.java:144) at org.jenkinsci.plugin.gitea.GiteaNotifier.access$200(GiteaNotifier.java:66) at org.jenkinsci.plugin.gitea.GiteaNotifier$JobCompletedListener.onCompleted(GiteaNotifier.java:297) at hudson.model.listeners.RunListener.fireCompleted(RunListener.java:211) at org.jenkinsci.plugins.workflow.job.WorkflowRun.finish(WorkflowRun.java:688) at org.jenkinsci.plugins.workflow.job.WorkflowRun.access$1400(WorkflowRun.java:143) at org.jenkinsci.plugins.workflow.job.WorkflowRun$GraphL.onNewHead(WorkflowRun.java:1006) at org.jenkinsci.plugins.workflow.cps.CpsFlowExecution.notifyListeners(CpsFlowExecution.java:1368) at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup$3.run(CpsThreadGroup.java:412) at org.jenkinsci.plugins.workflow.cps.CpsVmExecutorService$1.run(CpsVmExecutorService.java:35) at hudson.remoting.SingleLaneExecutorService$1.run(SingleLaneExecutorService.java:131) at jenkins.util.ContextResettingExecutorService$1.run(ContextResettingExecutorService.java:28) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at java.lang.Thread.run(Thread.java:748) Finished: SUCCESS

        1. Screen Shot 2018-08-03 at 13.36.36.png
          Screen Shot 2018-08-03 at 13.36.36.png
          17 kB
        2. Screen Shot 2018-08-03 at 13.36.15.png
          Screen Shot 2018-08-03 at 13.36.15.png
          28 kB
        3. Screen Shot 2018-08-03 at 13.35.16.png
          Screen Shot 2018-08-03 at 13.35.16.png
          18 kB
        4. Screen Shot 2018-08-03 at 13.34.44.png
          Screen Shot 2018-08-03 at 13.34.44.png
          337 kB
        5. Screen Shot 2018-08-03 at 13.27.48.png
          Screen Shot 2018-08-03 at 13.27.48.png
          28 kB
        6. Screen Shot 2018-08-03 at 13.27.37.png
          Screen Shot 2018-08-03 at 13.27.37.png
          28 kB
        7. plugin.png
          plugin.png
          11 kB
        8. plugin.png
          plugin.png
          11 kB
        9. actions.png
          actions.png
          27 kB
        10. actions.png
          actions.png
          27 kB

            Unassigned Unassigned
            jstrachan James Strachan
            Votes:
            2 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: