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

Sometimes tries to use OAuth to connect to Bitbucket when Basic credential configured.

      Intermittently we get failures to get source or notify Bitbucket of build status which show the following errors.

      com.cloudbees.jenkins.plugins.bitbucket.api.BitbucketRequestException: HTTP request error. Status: 401: . HttpResponseProxy

      {HTTP/1.1 401 [Server: nginx, Date: Fri, 17 Dec 2021 11:59:17 GMT, Content-Type: application/json;charset=UTF-8, Transfer-Encoding: chunked, Connection: keep-alive, X-AREQUESTID: @1E51M4Hx719x57504526x4, X-ASEN: <redacted>, Cache-Control: no-cache, no-transform, Vary: accept-encoding,x-auserid,cookie,x-ausername,accept-encoding, WWW-Authenticate: OAuth realm="https%3A%2F%2F<redacted>", X-Content-Type-Options: nosniff] org.apache.http.client.entity.DecompressingEntity@7ca853a7}

      at com.cloudbees.jenkins.plugins.bitbucket.server.client.BitbucketServerAPIClient.doRequest(BitbucketServerAPIClient.java:1095) at com.cloudbees.jenkins.plugins.bitbucket.server.client.BitbucketServerAPIClient.postRequest(BitbucketServerAPIClient.java:1048) at com.cloudbees.jenkins.plugins.bitbucket.server.client.BitbucketServerAPIClient.postRequest(BitbucketServerAPIClient.java:1036) at com.cloudbees.jenkins.plugins.bitbucket.server.client.BitbucketServerAPIClient.postBuildStatus(BitbucketServerAPIClient.java:511) at com.cloudbees.jenkins.plugins.bitbucket.BitbucketChangesetCommentNotifier.buildStatus(BitbucketChangesetCommentNotifier.java:50) at com.cloudbees.jenkins.plugins.bitbucket.BitbucketBuildStatusNotifications.createStatus(BitbucketBuildStatusNotifications.java:161) at com.cloudbees.jenkins.plugins.bitbucket.BitbucketBuildStatusNotifications.sendNotifications(BitbucketBuildStatusNotifications.java:203) at com.cloudbees.jenkins.plugins.bitbucket.BitbucketBuildStatusNotifications.access$100(BitbucketBuildStatusNotifications.java:59) at com.cloudbees.jenkins.plugins.bitbucket.BitbucketBuildStatusNotifications$JobCompletedListener.onCompleted(BitbucketBuildStatusNotifications.java:285) at hudson.model.listeners.RunListener.fireCompleted(RunListener.java:208) at org.jenkinsci.plugins.workflow.job.WorkflowRun.finish(WorkflowRun.java:625) at org.jenkinsci.plugins.workflow.job.WorkflowRun.access$800(WorkflowRun.java:138) at org.jenkinsci.plugins.workflow.job.WorkflowRun$GraphL.onNewHead(WorkflowRun.java:1045) at org.jenkinsci.plugins.workflow.cps.CpsFlowExecution.notifyListeners(CpsFlowExecution.java:1472) at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup$3.run(CpsThreadGroup.java:491) at org.jenkinsci.plugins.workflow.cps.CpsVmExecutorService$1.run(CpsVmExecutorService.java:38) at hudson.remoting.SingleLaneExecutorService$1.run(SingleLaneExecutorService.java:139) at jenkins.util.ContextResettingExecutorService$1.run(ContextResettingExecutorService.java:28) at jenkins.security.ImpersonatingExecutorService$1.run(ImpersonatingExecutorService.java:68) at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515) at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) at java.base/java.lang.Thread.run(Thread.java:829)

       
      com.cloudbees.jenkins.plugins.bitbucket.api.BitbucketRequestException: HTTP request error. Status: 401: .

       

      HttpResponseProxy

      {HTTP/1.1 401 [Server: nginx, Date: Thu, 16 Dec 2021 15:22:56 GMT, Content-Type: application/json;charset=UTF-8, Transfer-Encoding: chunked, Connection: keep-alive, X-AREQUESTID: @1E51M4Hx922x56159881x3, X-ASEN: <redacted>, Cache-Control: no-cache, no-transform, Vary: accept-encoding,x-auserid,cookie,x-ausername,accept-encoding, WWW-Authenticate: OAuth realm="https%3A%2F%2F<redacted>", X-Content-Type-Options: nosniff] org.apache.http.client.entity.DecompressingEntity@53042323}

       at com.cloudbees.jenkins.plugins.bitbucket.server.client.BitbucketServerAPIClient.getRequest(BitbucketServerAPIClient.java:883) at com.cloudbees.jenkins.plugins.bitbucket.server.client.BitbucketServerAPIClient.getResources(BitbucketServerAPIClient.java:835)<redacted> at com.cloudbees.jenkins.plugins.bitbucket.server.client.BitbucketServerAPIClient.getServerBranches(BitbucketServerAPIClient.java:588) <redacted> at com.cloudbees.jenkins.plugins.bitbucket.server.client.BitbucketServerAPIClient.getBranches(BitbucketServerAPIClient.java:579) at com.cloudbees.jenkins.plugins.bitbucket.BitbucketSCMSource.retrieve(BitbucketSCMSource.java:795) at jenkins.scm.api.SCMSource.fetch(SCMSource.java:582) at org.jenkinsci.plugins.workflow.multibranch.SCMBinder.create(SCMBinder.java:100) at org.jenkinsci.plugins.workflow.job.WorkflowRun.run(WorkflowRun.java:310) at hudson.model.ResourceController.execute(ResourceController.java:99) at hudson.model.Executor.run(Executor.java:432)
       
      I don't understand why it would try and use OAuth authentication when the credentials configured are username/password.

      99% of the time both actions work fine.

          [JENKINS-67399] Sometimes tries to use OAuth to connect to Bitbucket when Basic credential configured.

          Stephen Fry created issue -
          Stephen Fry made changes -
          Description Original: Intermittently we get failures to get source or notifier of build status which show the following errors.

          com.cloudbees.jenkins.plugins.bitbucket.api.BitbucketRequestException: HTTP request error. Status: 401: . HttpResponseProxy\{HTTP/1.1 401 [Server: nginx, Date: Fri, 17 Dec 2021 11:59:17 GMT, Content-Type: application/json;charset=UTF-8, Transfer-Encoding: chunked, Connection: keep-alive, X-AREQUESTID: @1E51M4Hx719x57504526x4, X-ASEN: SEN-17354076, Cache-Control: no-cache, no-transform, Vary: accept-encoding,x-auserid,cookie,x-ausername,accept-encoding, WWW-Authenticate: OAuth realm="https%3A%2F%2F<redacted>", X-Content-Type-Options: nosniff] org.apache.http.client.entity.DecompressingEntity@7ca853a7} at com.cloudbees.jenkins.plugins.bitbucket.server.client.BitbucketServerAPIClient.doRequest(BitbucketServerAPIClient.java:1095) at com.cloudbees.jenkins.plugins.bitbucket.server.client.BitbucketServerAPIClient.postRequest(BitbucketServerAPIClient.java:1048) at com.cloudbees.jenkins.plugins.bitbucket.server.client.BitbucketServerAPIClient.postRequest(BitbucketServerAPIClient.java:1036) at com.cloudbees.jenkins.plugins.bitbucket.server.client.BitbucketServerAPIClient.postBuildStatus(BitbucketServerAPIClient.java:511) at com.cloudbees.jenkins.plugins.bitbucket.BitbucketChangesetCommentNotifier.buildStatus(BitbucketChangesetCommentNotifier.java:50) at com.cloudbees.jenkins.plugins.bitbucket.BitbucketBuildStatusNotifications.createStatus(BitbucketBuildStatusNotifications.java:161) at com.cloudbees.jenkins.plugins.bitbucket.BitbucketBuildStatusNotifications.sendNotifications(BitbucketBuildStatusNotifications.java:203) at com.cloudbees.jenkins.plugins.bitbucket.BitbucketBuildStatusNotifications.access$100(BitbucketBuildStatusNotifications.java:59) at com.cloudbees.jenkins.plugins.bitbucket.BitbucketBuildStatusNotifications$JobCompletedListener.onCompleted(BitbucketBuildStatusNotifications.java:285) at hudson.model.listeners.RunListener.fireCompleted(RunListener.java:208) at org.jenkinsci.plugins.workflow.job.WorkflowRun.finish(WorkflowRun.java:625) at org.jenkinsci.plugins.workflow.job.WorkflowRun.access$800(WorkflowRun.java:138) at org.jenkinsci.plugins.workflow.job.WorkflowRun$GraphL.onNewHead(WorkflowRun.java:1045) at org.jenkinsci.plugins.workflow.cps.CpsFlowExecution.notifyListeners(CpsFlowExecution.java:1472) at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup$3.run(CpsThreadGroup.java:491) at org.jenkinsci.plugins.workflow.cps.CpsVmExecutorService$1.run(CpsVmExecutorService.java:38) at hudson.remoting.SingleLaneExecutorService$1.run(SingleLaneExecutorService.java:139) at jenkins.util.ContextResettingExecutorService$1.run(ContextResettingExecutorService.java:28) at jenkins.security.ImpersonatingExecutorService$1.run(ImpersonatingExecutorService.java:68) at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515) at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) at java.base/java.lang.Thread.run(Thread.java:829)



           
          com.cloudbees.jenkins.plugins.bitbucket.api.BitbucketRequestException: HTTP request error. Status: 401: .
          [|https://psa.ci-prod.dev.financialforce.com/blue/organizations/jenkins/managed%2Fpsenterprise%2Fpsenterprise-core/detail/develop/59/pipeline#log-5]HttpResponseProxy\{HTTP/1.1 401 [Server: nginx, Date: Thu, 16 Dec 2021 15:22:56 GMT, Content-Type: application/json;charset=UTF-8, Transfer-Encoding: chunked, Connection: keep-alive, X-AREQUESTID: @1E51M4Hx922x56159881x3, X-ASEN: SEN-17354076, Cache-Control: no-cache, no-transform, Vary: accept-encoding,x-auserid,cookie,x-ausername,accept-encoding, WWW-Authenticate: OAuth realm="https%3A%2F%2F<redacted>", X-Content-Type-Options: nosniff] org.apache.http.client.entity.DecompressingEntity@53042323} at com.cloudbees.jenkins.plugins.bitbucket.server.client.BitbucketServerAPIClient.getRequest(BitbucketServerAPIClient.java:883) at com.cloudbees.jenkins.plugins.bitbucket.server.client.BitbucketServerAPIClient.getResources(BitbucketServerAPIClient.java:835)[|https://psa.ci-prod.dev.financialforce.com/blue/organizations/jenkins/managed%2Fpsenterprise%2Fpsenterprise-core/detail/develop/59/pipeline#log-8] at com.cloudbees.jenkins.plugins.bitbucket.server.client.BitbucketServerAPIClient.getServerBranches(BitbucketServerAPIClient.java:588) [|https://psa.ci-prod.dev.financialforce.com/blue/organizations/jenkins/managed%2Fpsenterprise%2Fpsenterprise-core/detail/develop/59/pipeline#log-9] at com.cloudbees.jenkins.plugins.bitbucket.server.client.BitbucketServerAPIClient.getBranches(BitbucketServerAPIClient.java:579) at com.cloudbees.jenkins.plugins.bitbucket.BitbucketSCMSource.retrieve(BitbucketSCMSource.java:795) at jenkins.scm.api.SCMSource.fetch(SCMSource.java:582) at org.jenkinsci.plugins.workflow.multibranch.SCMBinder.create(SCMBinder.java:100) at org.jenkinsci.plugins.workflow.job.WorkflowRun.run(WorkflowRun.java:310) at hudson.model.ResourceController.execute(ResourceController.java:99) at hudson.model.Executor.run(Executor.java:432)

          I don't understand why it would try and use OAuth authentication when the credentials configured are username/password.
          New: Intermittently we get failures to get source or notifier of build status which show the following errors.

          com.cloudbees.jenkins.plugins.bitbucket.api.BitbucketRequestException: HTTP request error. Status: 401: . HttpResponseProxy{HTTP/1.1 401 [Server: nginx, Date: Fri, 17 Dec 2021 11:59:17 GMT, Content-Type: application/json;charset=UTF-8, Transfer-Encoding: chunked, Connection: keep-alive, X-AREQUESTID: @1E51M4Hx719x57504526x4, X-ASEN: SEN-17354076, Cache-Control: no-cache, no-transform, Vary: accept-encoding,x-auserid,cookie,x-ausername,accept-encoding, WWW-Authenticate: OAuth realm="https%3A%2F%2F<redacted>", X-Content-Type-Options: nosniff] org.apache.http.client.entity.DecompressingEntity@7ca853a7} at com.cloudbees.jenkins.plugins.bitbucket.server.client.BitbucketServerAPIClient.doRequest(BitbucketServerAPIClient.java:1095) at com.cloudbees.jenkins.plugins.bitbucket.server.client.BitbucketServerAPIClient.postRequest(BitbucketServerAPIClient.java:1048) at com.cloudbees.jenkins.plugins.bitbucket.server.client.BitbucketServerAPIClient.postRequest(BitbucketServerAPIClient.java:1036) at com.cloudbees.jenkins.plugins.bitbucket.server.client.BitbucketServerAPIClient.postBuildStatus(BitbucketServerAPIClient.java:511) at com.cloudbees.jenkins.plugins.bitbucket.BitbucketChangesetCommentNotifier.buildStatus(BitbucketChangesetCommentNotifier.java:50) at com.cloudbees.jenkins.plugins.bitbucket.BitbucketBuildStatusNotifications.createStatus(BitbucketBuildStatusNotifications.java:161) at com.cloudbees.jenkins.plugins.bitbucket.BitbucketBuildStatusNotifications.sendNotifications(BitbucketBuildStatusNotifications.java:203) at com.cloudbees.jenkins.plugins.bitbucket.BitbucketBuildStatusNotifications.access$100(BitbucketBuildStatusNotifications.java:59) at com.cloudbees.jenkins.plugins.bitbucket.BitbucketBuildStatusNotifications$JobCompletedListener.onCompleted(BitbucketBuildStatusNotifications.java:285) at hudson.model.listeners.RunListener.fireCompleted(RunListener.java:208) at org.jenkinsci.plugins.workflow.job.WorkflowRun.finish(WorkflowRun.java:625) at org.jenkinsci.plugins.workflow.job.WorkflowRun.access$800(WorkflowRun.java:138) at org.jenkinsci.plugins.workflow.job.WorkflowRun$GraphL.onNewHead(WorkflowRun.java:1045) at org.jenkinsci.plugins.workflow.cps.CpsFlowExecution.notifyListeners(CpsFlowExecution.java:1472) at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup$3.run(CpsThreadGroup.java:491) at org.jenkinsci.plugins.workflow.cps.CpsVmExecutorService$1.run(CpsVmExecutorService.java:38) at hudson.remoting.SingleLaneExecutorService$1.run(SingleLaneExecutorService.java:139) at jenkins.util.ContextResettingExecutorService$1.run(ContextResettingExecutorService.java:28) at jenkins.security.ImpersonatingExecutorService$1.run(ImpersonatingExecutorService.java:68) at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515) at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) at java.base/java.lang.Thread.run(Thread.java:829)

           
           com.cloudbees.jenkins.plugins.bitbucket.api.BitbucketRequestException: HTTP request error. Status: 401: .
          [<redacted>
          |https://psa.ci-prod.dev.financialforce.com/blue/organizations/jenkins/managed%2Fpsenterprise%2Fpsenterprise-core/detail/develop/59/pipeline#log-5]HttpResponseProxy{HTTP/1.1 401 [Server: nginx, Date: Thu, 16 Dec 2021 15:22:56 GMT, Content-Type: application/json;charset=UTF-8, Transfer-Encoding: chunked, Connection: keep-alive, X-AREQUESTID: @1E51M4Hx922x56159881x3, X-ASEN: SEN-17354076, Cache-Control: no-cache, no-transform, Vary: accept-encoding,x-auserid,cookie,x-ausername,accept-encoding, WWW-Authenticate: OAuth realm="https%3A%2F%2F<redacted>", X-Content-Type-Options: nosniff] org.apache.http.client.entity.DecompressingEntity@53042323} at com.cloudbees.jenkins.plugins.bitbucket.server.client.BitbucketServerAPIClient.getRequest(BitbucketServerAPIClient.java:883) at com.cloudbees.jenkins.plugins.bitbucket.server.client.BitbucketServerAPIClient.getResources(BitbucketServerAPIClient.java:835)<redacted> at com.cloudbees.jenkins.plugins.bitbucket.server.client.BitbucketServerAPIClient.getServerBranches(BitbucketServerAPIClient.java:588) <redacted> at com.cloudbees.jenkins.plugins.bitbucket.server.client.BitbucketServerAPIClient.getBranches(BitbucketServerAPIClient.java:579) at com.cloudbees.jenkins.plugins.bitbucket.BitbucketSCMSource.retrieve(BitbucketSCMSource.java:795) at jenkins.scm.api.SCMSource.fetch(SCMSource.java:582) at org.jenkinsci.plugins.workflow.multibranch.SCMBinder.create(SCMBinder.java:100) at org.jenkinsci.plugins.workflow.job.WorkflowRun.run(WorkflowRun.java:310) at hudson.model.ResourceController.execute(ResourceController.java:99) at hudson.model.Executor.run(Executor.java:432)

          I don't understand why it would try and use OAuth authentication when the credentials configured are username/password.
          Stephen Fry made changes -
          Description Original: Intermittently we get failures to get source or notifier of build status which show the following errors.

          com.cloudbees.jenkins.plugins.bitbucket.api.BitbucketRequestException: HTTP request error. Status: 401: . HttpResponseProxy{HTTP/1.1 401 [Server: nginx, Date: Fri, 17 Dec 2021 11:59:17 GMT, Content-Type: application/json;charset=UTF-8, Transfer-Encoding: chunked, Connection: keep-alive, X-AREQUESTID: @1E51M4Hx719x57504526x4, X-ASEN: SEN-17354076, Cache-Control: no-cache, no-transform, Vary: accept-encoding,x-auserid,cookie,x-ausername,accept-encoding, WWW-Authenticate: OAuth realm="https%3A%2F%2F<redacted>", X-Content-Type-Options: nosniff] org.apache.http.client.entity.DecompressingEntity@7ca853a7} at com.cloudbees.jenkins.plugins.bitbucket.server.client.BitbucketServerAPIClient.doRequest(BitbucketServerAPIClient.java:1095) at com.cloudbees.jenkins.plugins.bitbucket.server.client.BitbucketServerAPIClient.postRequest(BitbucketServerAPIClient.java:1048) at com.cloudbees.jenkins.plugins.bitbucket.server.client.BitbucketServerAPIClient.postRequest(BitbucketServerAPIClient.java:1036) at com.cloudbees.jenkins.plugins.bitbucket.server.client.BitbucketServerAPIClient.postBuildStatus(BitbucketServerAPIClient.java:511) at com.cloudbees.jenkins.plugins.bitbucket.BitbucketChangesetCommentNotifier.buildStatus(BitbucketChangesetCommentNotifier.java:50) at com.cloudbees.jenkins.plugins.bitbucket.BitbucketBuildStatusNotifications.createStatus(BitbucketBuildStatusNotifications.java:161) at com.cloudbees.jenkins.plugins.bitbucket.BitbucketBuildStatusNotifications.sendNotifications(BitbucketBuildStatusNotifications.java:203) at com.cloudbees.jenkins.plugins.bitbucket.BitbucketBuildStatusNotifications.access$100(BitbucketBuildStatusNotifications.java:59) at com.cloudbees.jenkins.plugins.bitbucket.BitbucketBuildStatusNotifications$JobCompletedListener.onCompleted(BitbucketBuildStatusNotifications.java:285) at hudson.model.listeners.RunListener.fireCompleted(RunListener.java:208) at org.jenkinsci.plugins.workflow.job.WorkflowRun.finish(WorkflowRun.java:625) at org.jenkinsci.plugins.workflow.job.WorkflowRun.access$800(WorkflowRun.java:138) at org.jenkinsci.plugins.workflow.job.WorkflowRun$GraphL.onNewHead(WorkflowRun.java:1045) at org.jenkinsci.plugins.workflow.cps.CpsFlowExecution.notifyListeners(CpsFlowExecution.java:1472) at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup$3.run(CpsThreadGroup.java:491) at org.jenkinsci.plugins.workflow.cps.CpsVmExecutorService$1.run(CpsVmExecutorService.java:38) at hudson.remoting.SingleLaneExecutorService$1.run(SingleLaneExecutorService.java:139) at jenkins.util.ContextResettingExecutorService$1.run(ContextResettingExecutorService.java:28) at jenkins.security.ImpersonatingExecutorService$1.run(ImpersonatingExecutorService.java:68) at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515) at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) at java.base/java.lang.Thread.run(Thread.java:829)

           
           com.cloudbees.jenkins.plugins.bitbucket.api.BitbucketRequestException: HTTP request error. Status: 401: .
          [<redacted>
          |https://psa.ci-prod.dev.financialforce.com/blue/organizations/jenkins/managed%2Fpsenterprise%2Fpsenterprise-core/detail/develop/59/pipeline#log-5]HttpResponseProxy{HTTP/1.1 401 [Server: nginx, Date: Thu, 16 Dec 2021 15:22:56 GMT, Content-Type: application/json;charset=UTF-8, Transfer-Encoding: chunked, Connection: keep-alive, X-AREQUESTID: @1E51M4Hx922x56159881x3, X-ASEN: SEN-17354076, Cache-Control: no-cache, no-transform, Vary: accept-encoding,x-auserid,cookie,x-ausername,accept-encoding, WWW-Authenticate: OAuth realm="https%3A%2F%2F<redacted>", X-Content-Type-Options: nosniff] org.apache.http.client.entity.DecompressingEntity@53042323} at com.cloudbees.jenkins.plugins.bitbucket.server.client.BitbucketServerAPIClient.getRequest(BitbucketServerAPIClient.java:883) at com.cloudbees.jenkins.plugins.bitbucket.server.client.BitbucketServerAPIClient.getResources(BitbucketServerAPIClient.java:835)<redacted> at com.cloudbees.jenkins.plugins.bitbucket.server.client.BitbucketServerAPIClient.getServerBranches(BitbucketServerAPIClient.java:588) <redacted> at com.cloudbees.jenkins.plugins.bitbucket.server.client.BitbucketServerAPIClient.getBranches(BitbucketServerAPIClient.java:579) at com.cloudbees.jenkins.plugins.bitbucket.BitbucketSCMSource.retrieve(BitbucketSCMSource.java:795) at jenkins.scm.api.SCMSource.fetch(SCMSource.java:582) at org.jenkinsci.plugins.workflow.multibranch.SCMBinder.create(SCMBinder.java:100) at org.jenkinsci.plugins.workflow.job.WorkflowRun.run(WorkflowRun.java:310) at hudson.model.ResourceController.execute(ResourceController.java:99) at hudson.model.Executor.run(Executor.java:432)

          I don't understand why it would try and use OAuth authentication when the credentials configured are username/password.
          New: Intermittently we get failures to get source or notifier of build status which show the following errors.

          com.cloudbees.jenkins.plugins.bitbucket.api.BitbucketRequestException: HTTP request error. Status: 401: . HttpResponseProxy

          {HTTP/1.1 401 [Server: nginx, Date: Fri, 17 Dec 2021 11:59:17 GMT, Content-Type: application/json;charset=UTF-8, Transfer-Encoding: chunked, Connection: keep-alive, X-AREQUESTID: @1E51M4Hx719x57504526x4, X-ASEN: SEN-17354076, Cache-Control: no-cache, no-transform, Vary: accept-encoding,x-auserid,cookie,x-ausername,accept-encoding, WWW-Authenticate: OAuth realm="https%3A%2F%2F<redacted>", X-Content-Type-Options: nosniff] org.apache.http.client.entity.DecompressingEntity@7ca853a7}

          at com.cloudbees.jenkins.plugins.bitbucket.server.client.BitbucketServerAPIClient.doRequest(BitbucketServerAPIClient.java:1095) at com.cloudbees.jenkins.plugins.bitbucket.server.client.BitbucketServerAPIClient.postRequest(BitbucketServerAPIClient.java:1048) at com.cloudbees.jenkins.plugins.bitbucket.server.client.BitbucketServerAPIClient.postRequest(BitbucketServerAPIClient.java:1036) at com.cloudbees.jenkins.plugins.bitbucket.server.client.BitbucketServerAPIClient.postBuildStatus(BitbucketServerAPIClient.java:511) at com.cloudbees.jenkins.plugins.bitbucket.BitbucketChangesetCommentNotifier.buildStatus(BitbucketChangesetCommentNotifier.java:50) at com.cloudbees.jenkins.plugins.bitbucket.BitbucketBuildStatusNotifications.createStatus(BitbucketBuildStatusNotifications.java:161) at com.cloudbees.jenkins.plugins.bitbucket.BitbucketBuildStatusNotifications.sendNotifications(BitbucketBuildStatusNotifications.java:203) at com.cloudbees.jenkins.plugins.bitbucket.BitbucketBuildStatusNotifications.access$100(BitbucketBuildStatusNotifications.java:59) at com.cloudbees.jenkins.plugins.bitbucket.BitbucketBuildStatusNotifications$JobCompletedListener.onCompleted(BitbucketBuildStatusNotifications.java:285) at hudson.model.listeners.RunListener.fireCompleted(RunListener.java:208) at org.jenkinsci.plugins.workflow.job.WorkflowRun.finish(WorkflowRun.java:625) at org.jenkinsci.plugins.workflow.job.WorkflowRun.access$800(WorkflowRun.java:138) at org.jenkinsci.plugins.workflow.job.WorkflowRun$GraphL.onNewHead(WorkflowRun.java:1045) at org.jenkinsci.plugins.workflow.cps.CpsFlowExecution.notifyListeners(CpsFlowExecution.java:1472) at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup$3.run(CpsThreadGroup.java:491) at org.jenkinsci.plugins.workflow.cps.CpsVmExecutorService$1.run(CpsVmExecutorService.java:38) at hudson.remoting.SingleLaneExecutorService$1.run(SingleLaneExecutorService.java:139) at jenkins.util.ContextResettingExecutorService$1.run(ContextResettingExecutorService.java:28) at jenkins.security.ImpersonatingExecutorService$1.run(ImpersonatingExecutorService.java:68) at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515) at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) at java.base/java.lang.Thread.run(Thread.java:829)

           
           com.cloudbees.jenkins.plugins.bitbucket.api.BitbucketRequestException: HTTP request error. Status: 401: .
          |HttpResponseProxy \{HTTP/1.1 401 [Server: nginx, Date: Thu, 16 Dec 2021 15:22:56 GMT, Content-Type: application/json;charset=UTF-8, Transfer-Encoding: chunked, Connection: keep-alive, X-AREQUESTID: @1E51M4Hx922x56159881x3, X-ASEN: SEN-17354076, Cache-Control: no-cache, no-transform, Vary: accept-encoding,x-auserid,cookie,x-ausername,accept-encoding, WWW-Authenticate: OAuth realm="https%3A%2F%2F<redacted>", X-Content-Type-Options: nosniff] org.apache.http.client.entity.DecompressingEntity@53042323} at com.cloudbees.jenkins.plugins.bitbucket.server.client.BitbucketServerAPIClient.getRequest(BitbucketServerAPIClient.java:883) at com.cloudbees.jenkins.plugins.bitbucket.server.client.BitbucketServerAPIClient.getResources(BitbucketServerAPIClient.java:835)<redacted> at com.cloudbees.jenkins.plugins.bitbucket.server.client.BitbucketServerAPIClient.getServerBranches(BitbucketServerAPIClient.java:588) <redacted> at com.cloudbees.jenkins.plugins.bitbucket.server.client.BitbucketServerAPIClient.getBranches(BitbucketServerAPIClient.java:579) at com.cloudbees.jenkins.plugins.bitbucket.BitbucketSCMSource.retrieve(BitbucketSCMSource.java:795) at jenkins.scm.api.SCMSource.fetch(SCMSource.java:582) at org.jenkinsci.plugins.workflow.multibranch.SCMBinder.create(SCMBinder.java:100) at org.jenkinsci.plugins.workflow.job.WorkflowRun.run(WorkflowRun.java:310) at hudson.model.ResourceController.execute(ResourceController.java:99) at hudson.model.Executor.run(Executor.java:432)|

          I don't understand why it would try and use OAuth authentication when the credentials configured are username/password.
          Stephen Fry made changes -
          Description Original: Intermittently we get failures to get source or notifier of build status which show the following errors.

          com.cloudbees.jenkins.plugins.bitbucket.api.BitbucketRequestException: HTTP request error. Status: 401: . HttpResponseProxy

          {HTTP/1.1 401 [Server: nginx, Date: Fri, 17 Dec 2021 11:59:17 GMT, Content-Type: application/json;charset=UTF-8, Transfer-Encoding: chunked, Connection: keep-alive, X-AREQUESTID: @1E51M4Hx719x57504526x4, X-ASEN: SEN-17354076, Cache-Control: no-cache, no-transform, Vary: accept-encoding,x-auserid,cookie,x-ausername,accept-encoding, WWW-Authenticate: OAuth realm="https%3A%2F%2F<redacted>", X-Content-Type-Options: nosniff] org.apache.http.client.entity.DecompressingEntity@7ca853a7}

          at com.cloudbees.jenkins.plugins.bitbucket.server.client.BitbucketServerAPIClient.doRequest(BitbucketServerAPIClient.java:1095) at com.cloudbees.jenkins.plugins.bitbucket.server.client.BitbucketServerAPIClient.postRequest(BitbucketServerAPIClient.java:1048) at com.cloudbees.jenkins.plugins.bitbucket.server.client.BitbucketServerAPIClient.postRequest(BitbucketServerAPIClient.java:1036) at com.cloudbees.jenkins.plugins.bitbucket.server.client.BitbucketServerAPIClient.postBuildStatus(BitbucketServerAPIClient.java:511) at com.cloudbees.jenkins.plugins.bitbucket.BitbucketChangesetCommentNotifier.buildStatus(BitbucketChangesetCommentNotifier.java:50) at com.cloudbees.jenkins.plugins.bitbucket.BitbucketBuildStatusNotifications.createStatus(BitbucketBuildStatusNotifications.java:161) at com.cloudbees.jenkins.plugins.bitbucket.BitbucketBuildStatusNotifications.sendNotifications(BitbucketBuildStatusNotifications.java:203) at com.cloudbees.jenkins.plugins.bitbucket.BitbucketBuildStatusNotifications.access$100(BitbucketBuildStatusNotifications.java:59) at com.cloudbees.jenkins.plugins.bitbucket.BitbucketBuildStatusNotifications$JobCompletedListener.onCompleted(BitbucketBuildStatusNotifications.java:285) at hudson.model.listeners.RunListener.fireCompleted(RunListener.java:208) at org.jenkinsci.plugins.workflow.job.WorkflowRun.finish(WorkflowRun.java:625) at org.jenkinsci.plugins.workflow.job.WorkflowRun.access$800(WorkflowRun.java:138) at org.jenkinsci.plugins.workflow.job.WorkflowRun$GraphL.onNewHead(WorkflowRun.java:1045) at org.jenkinsci.plugins.workflow.cps.CpsFlowExecution.notifyListeners(CpsFlowExecution.java:1472) at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup$3.run(CpsThreadGroup.java:491) at org.jenkinsci.plugins.workflow.cps.CpsVmExecutorService$1.run(CpsVmExecutorService.java:38) at hudson.remoting.SingleLaneExecutorService$1.run(SingleLaneExecutorService.java:139) at jenkins.util.ContextResettingExecutorService$1.run(ContextResettingExecutorService.java:28) at jenkins.security.ImpersonatingExecutorService$1.run(ImpersonatingExecutorService.java:68) at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515) at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) at java.base/java.lang.Thread.run(Thread.java:829)

           
           com.cloudbees.jenkins.plugins.bitbucket.api.BitbucketRequestException: HTTP request error. Status: 401: .
          |HttpResponseProxy \{HTTP/1.1 401 [Server: nginx, Date: Thu, 16 Dec 2021 15:22:56 GMT, Content-Type: application/json;charset=UTF-8, Transfer-Encoding: chunked, Connection: keep-alive, X-AREQUESTID: @1E51M4Hx922x56159881x3, X-ASEN: SEN-17354076, Cache-Control: no-cache, no-transform, Vary: accept-encoding,x-auserid,cookie,x-ausername,accept-encoding, WWW-Authenticate: OAuth realm="https%3A%2F%2F<redacted>", X-Content-Type-Options: nosniff] org.apache.http.client.entity.DecompressingEntity@53042323} at com.cloudbees.jenkins.plugins.bitbucket.server.client.BitbucketServerAPIClient.getRequest(BitbucketServerAPIClient.java:883) at com.cloudbees.jenkins.plugins.bitbucket.server.client.BitbucketServerAPIClient.getResources(BitbucketServerAPIClient.java:835)<redacted> at com.cloudbees.jenkins.plugins.bitbucket.server.client.BitbucketServerAPIClient.getServerBranches(BitbucketServerAPIClient.java:588) <redacted> at com.cloudbees.jenkins.plugins.bitbucket.server.client.BitbucketServerAPIClient.getBranches(BitbucketServerAPIClient.java:579) at com.cloudbees.jenkins.plugins.bitbucket.BitbucketSCMSource.retrieve(BitbucketSCMSource.java:795) at jenkins.scm.api.SCMSource.fetch(SCMSource.java:582) at org.jenkinsci.plugins.workflow.multibranch.SCMBinder.create(SCMBinder.java:100) at org.jenkinsci.plugins.workflow.job.WorkflowRun.run(WorkflowRun.java:310) at hudson.model.ResourceController.execute(ResourceController.java:99) at hudson.model.Executor.run(Executor.java:432)|

          I don't understand why it would try and use OAuth authentication when the credentials configured are username/password.
          New: Intermittently we get failures to get source or notifier of build status which show the following errors.

          com.cloudbees.jenkins.plugins.bitbucket.api.BitbucketRequestException: HTTP request error. Status: 401: . HttpResponseProxy

          {HTTP/1.1 401 [Server: nginx, Date: Fri, 17 Dec 2021 11:59:17 GMT, Content-Type: application/json;charset=UTF-8, Transfer-Encoding: chunked, Connection: keep-alive, X-AREQUESTID: @1E51M4Hx719x57504526x4, X-ASEN: SEN-17354076, Cache-Control: no-cache, no-transform, Vary: accept-encoding,x-auserid,cookie,x-ausername,accept-encoding, WWW-Authenticate: OAuth realm="https%3A%2F%2F<redacted>", X-Content-Type-Options: nosniff] org.apache.http.client.entity.DecompressingEntity@7ca853a7}

          at com.cloudbees.jenkins.plugins.bitbucket.server.client.BitbucketServerAPIClient.doRequest(BitbucketServerAPIClient.java:1095) at com.cloudbees.jenkins.plugins.bitbucket.server.client.BitbucketServerAPIClient.postRequest(BitbucketServerAPIClient.java:1048) at com.cloudbees.jenkins.plugins.bitbucket.server.client.BitbucketServerAPIClient.postRequest(BitbucketServerAPIClient.java:1036) at com.cloudbees.jenkins.plugins.bitbucket.server.client.BitbucketServerAPIClient.postBuildStatus(BitbucketServerAPIClient.java:511) at com.cloudbees.jenkins.plugins.bitbucket.BitbucketChangesetCommentNotifier.buildStatus(BitbucketChangesetCommentNotifier.java:50) at com.cloudbees.jenkins.plugins.bitbucket.BitbucketBuildStatusNotifications.createStatus(BitbucketBuildStatusNotifications.java:161) at com.cloudbees.jenkins.plugins.bitbucket.BitbucketBuildStatusNotifications.sendNotifications(BitbucketBuildStatusNotifications.java:203) at com.cloudbees.jenkins.plugins.bitbucket.BitbucketBuildStatusNotifications.access$100(BitbucketBuildStatusNotifications.java:59) at com.cloudbees.jenkins.plugins.bitbucket.BitbucketBuildStatusNotifications$JobCompletedListener.onCompleted(BitbucketBuildStatusNotifications.java:285) at hudson.model.listeners.RunListener.fireCompleted(RunListener.java:208) at org.jenkinsci.plugins.workflow.job.WorkflowRun.finish(WorkflowRun.java:625) at org.jenkinsci.plugins.workflow.job.WorkflowRun.access$800(WorkflowRun.java:138) at org.jenkinsci.plugins.workflow.job.WorkflowRun$GraphL.onNewHead(WorkflowRun.java:1045) at org.jenkinsci.plugins.workflow.cps.CpsFlowExecution.notifyListeners(CpsFlowExecution.java:1472) at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup$3.run(CpsThreadGroup.java:491) at org.jenkinsci.plugins.workflow.cps.CpsVmExecutorService$1.run(CpsVmExecutorService.java:38) at hudson.remoting.SingleLaneExecutorService$1.run(SingleLaneExecutorService.java:139) at jenkins.util.ContextResettingExecutorService$1.run(ContextResettingExecutorService.java:28) at jenkins.security.ImpersonatingExecutorService$1.run(ImpersonatingExecutorService.java:68) at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515) at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) at java.base/java.lang.Thread.run(Thread.java:829)

           
           com.cloudbees.jenkins.plugins.bitbucket.api.BitbucketRequestException: HTTP request error. Status: 401: .

           

          HttpResponseProxy {HTTP/1.1 401 [Server: nginx, Date: Thu, 16 Dec 2021 15:22:56 GMT, Content-Type: application/json;charset=UTF-8, Transfer-Encoding: chunked, Connection: keep-alive, X-AREQUESTID: @1E51M4Hx922x56159881x3, X-ASEN: SEN-17354076, Cache-Control: no-cache, no-transform, Vary: accept-encoding,x-auserid,cookie,x-ausername,accept-encoding, WWW-Authenticate: OAuth realm="https%3A%2F%2F<redacted>", X-Content-Type-Options: nosniff] org.apache.http.client.entity.DecompressingEntity@53042323} at com.cloudbees.jenkins.plugins.bitbucket.server.client.BitbucketServerAPIClient.getRequest(BitbucketServerAPIClient.java:883) at com.cloudbees.jenkins.plugins.bitbucket.server.client.BitbucketServerAPIClient.getResources(BitbucketServerAPIClient.java:835)<redacted> at com.cloudbees.jenkins.plugins.bitbucket.server.client.BitbucketServerAPIClient.getServerBranches(BitbucketServerAPIClient.java:588) <redacted> at com.cloudbees.jenkins.plugins.bitbucket.server.client.BitbucketServerAPIClient.getBranches(BitbucketServerAPIClient.java:579) at com.cloudbees.jenkins.plugins.bitbucket.BitbucketSCMSource.retrieve(BitbucketSCMSource.java:795) at jenkins.scm.api.SCMSource.fetch(SCMSource.java:582) at org.jenkinsci.plugins.workflow.multibranch.SCMBinder.create(SCMBinder.java:100) at org.jenkinsci.plugins.workflow.job.WorkflowRun.run(WorkflowRun.java:310) at hudson.model.ResourceController.execute(ResourceController.java:99) at hudson.model.Executor.run(Executor.java:432)
           
          I don't understand why it would try and use OAuth authentication when the credentials configured are username/password.
          Stephen Fry made changes -
          Description Original: Intermittently we get failures to get source or notifier of build status which show the following errors.

          com.cloudbees.jenkins.plugins.bitbucket.api.BitbucketRequestException: HTTP request error. Status: 401: . HttpResponseProxy

          {HTTP/1.1 401 [Server: nginx, Date: Fri, 17 Dec 2021 11:59:17 GMT, Content-Type: application/json;charset=UTF-8, Transfer-Encoding: chunked, Connection: keep-alive, X-AREQUESTID: @1E51M4Hx719x57504526x4, X-ASEN: SEN-17354076, Cache-Control: no-cache, no-transform, Vary: accept-encoding,x-auserid,cookie,x-ausername,accept-encoding, WWW-Authenticate: OAuth realm="https%3A%2F%2F<redacted>", X-Content-Type-Options: nosniff] org.apache.http.client.entity.DecompressingEntity@7ca853a7}

          at com.cloudbees.jenkins.plugins.bitbucket.server.client.BitbucketServerAPIClient.doRequest(BitbucketServerAPIClient.java:1095) at com.cloudbees.jenkins.plugins.bitbucket.server.client.BitbucketServerAPIClient.postRequest(BitbucketServerAPIClient.java:1048) at com.cloudbees.jenkins.plugins.bitbucket.server.client.BitbucketServerAPIClient.postRequest(BitbucketServerAPIClient.java:1036) at com.cloudbees.jenkins.plugins.bitbucket.server.client.BitbucketServerAPIClient.postBuildStatus(BitbucketServerAPIClient.java:511) at com.cloudbees.jenkins.plugins.bitbucket.BitbucketChangesetCommentNotifier.buildStatus(BitbucketChangesetCommentNotifier.java:50) at com.cloudbees.jenkins.plugins.bitbucket.BitbucketBuildStatusNotifications.createStatus(BitbucketBuildStatusNotifications.java:161) at com.cloudbees.jenkins.plugins.bitbucket.BitbucketBuildStatusNotifications.sendNotifications(BitbucketBuildStatusNotifications.java:203) at com.cloudbees.jenkins.plugins.bitbucket.BitbucketBuildStatusNotifications.access$100(BitbucketBuildStatusNotifications.java:59) at com.cloudbees.jenkins.plugins.bitbucket.BitbucketBuildStatusNotifications$JobCompletedListener.onCompleted(BitbucketBuildStatusNotifications.java:285) at hudson.model.listeners.RunListener.fireCompleted(RunListener.java:208) at org.jenkinsci.plugins.workflow.job.WorkflowRun.finish(WorkflowRun.java:625) at org.jenkinsci.plugins.workflow.job.WorkflowRun.access$800(WorkflowRun.java:138) at org.jenkinsci.plugins.workflow.job.WorkflowRun$GraphL.onNewHead(WorkflowRun.java:1045) at org.jenkinsci.plugins.workflow.cps.CpsFlowExecution.notifyListeners(CpsFlowExecution.java:1472) at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup$3.run(CpsThreadGroup.java:491) at org.jenkinsci.plugins.workflow.cps.CpsVmExecutorService$1.run(CpsVmExecutorService.java:38) at hudson.remoting.SingleLaneExecutorService$1.run(SingleLaneExecutorService.java:139) at jenkins.util.ContextResettingExecutorService$1.run(ContextResettingExecutorService.java:28) at jenkins.security.ImpersonatingExecutorService$1.run(ImpersonatingExecutorService.java:68) at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515) at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) at java.base/java.lang.Thread.run(Thread.java:829)

           
           com.cloudbees.jenkins.plugins.bitbucket.api.BitbucketRequestException: HTTP request error. Status: 401: .

           

          HttpResponseProxy {HTTP/1.1 401 [Server: nginx, Date: Thu, 16 Dec 2021 15:22:56 GMT, Content-Type: application/json;charset=UTF-8, Transfer-Encoding: chunked, Connection: keep-alive, X-AREQUESTID: @1E51M4Hx922x56159881x3, X-ASEN: SEN-17354076, Cache-Control: no-cache, no-transform, Vary: accept-encoding,x-auserid,cookie,x-ausername,accept-encoding, WWW-Authenticate: OAuth realm="https%3A%2F%2F<redacted>", X-Content-Type-Options: nosniff] org.apache.http.client.entity.DecompressingEntity@53042323} at com.cloudbees.jenkins.plugins.bitbucket.server.client.BitbucketServerAPIClient.getRequest(BitbucketServerAPIClient.java:883) at com.cloudbees.jenkins.plugins.bitbucket.server.client.BitbucketServerAPIClient.getResources(BitbucketServerAPIClient.java:835)<redacted> at com.cloudbees.jenkins.plugins.bitbucket.server.client.BitbucketServerAPIClient.getServerBranches(BitbucketServerAPIClient.java:588) <redacted> at com.cloudbees.jenkins.plugins.bitbucket.server.client.BitbucketServerAPIClient.getBranches(BitbucketServerAPIClient.java:579) at com.cloudbees.jenkins.plugins.bitbucket.BitbucketSCMSource.retrieve(BitbucketSCMSource.java:795) at jenkins.scm.api.SCMSource.fetch(SCMSource.java:582) at org.jenkinsci.plugins.workflow.multibranch.SCMBinder.create(SCMBinder.java:100) at org.jenkinsci.plugins.workflow.job.WorkflowRun.run(WorkflowRun.java:310) at hudson.model.ResourceController.execute(ResourceController.java:99) at hudson.model.Executor.run(Executor.java:432)
           
          I don't understand why it would try and use OAuth authentication when the credentials configured are username/password.
          New: Intermittently we get failures to get source or notifier of build status which show the following errors.

          com.cloudbees.jenkins.plugins.bitbucket.api.BitbucketRequestException: HTTP request error. Status: 401: . HttpResponseProxy

          {HTTP/1.1 401 [Server: nginx, Date: Fri, 17 Dec 2021 11:59:17 GMT, Content-Type: application/json;charset=UTF-8, Transfer-Encoding: chunked, Connection: keep-alive, X-AREQUESTID: @1E51M4Hx719x57504526x4, X-ASEN: <redacted>, Cache-Control: no-cache, no-transform, Vary: accept-encoding,x-auserid,cookie,x-ausername,accept-encoding, WWW-Authenticate: OAuth realm="https%3A%2F%2F<redacted>", X-Content-Type-Options: nosniff] org.apache.http.client.entity.DecompressingEntity@7ca853a7}

          at com.cloudbees.jenkins.plugins.bitbucket.server.client.BitbucketServerAPIClient.doRequest(BitbucketServerAPIClient.java:1095) at com.cloudbees.jenkins.plugins.bitbucket.server.client.BitbucketServerAPIClient.postRequest(BitbucketServerAPIClient.java:1048) at com.cloudbees.jenkins.plugins.bitbucket.server.client.BitbucketServerAPIClient.postRequest(BitbucketServerAPIClient.java:1036) at com.cloudbees.jenkins.plugins.bitbucket.server.client.BitbucketServerAPIClient.postBuildStatus(BitbucketServerAPIClient.java:511) at com.cloudbees.jenkins.plugins.bitbucket.BitbucketChangesetCommentNotifier.buildStatus(BitbucketChangesetCommentNotifier.java:50) at com.cloudbees.jenkins.plugins.bitbucket.BitbucketBuildStatusNotifications.createStatus(BitbucketBuildStatusNotifications.java:161) at com.cloudbees.jenkins.plugins.bitbucket.BitbucketBuildStatusNotifications.sendNotifications(BitbucketBuildStatusNotifications.java:203) at com.cloudbees.jenkins.plugins.bitbucket.BitbucketBuildStatusNotifications.access$100(BitbucketBuildStatusNotifications.java:59) at com.cloudbees.jenkins.plugins.bitbucket.BitbucketBuildStatusNotifications$JobCompletedListener.onCompleted(BitbucketBuildStatusNotifications.java:285) at hudson.model.listeners.RunListener.fireCompleted(RunListener.java:208) at org.jenkinsci.plugins.workflow.job.WorkflowRun.finish(WorkflowRun.java:625) at org.jenkinsci.plugins.workflow.job.WorkflowRun.access$800(WorkflowRun.java:138) at org.jenkinsci.plugins.workflow.job.WorkflowRun$GraphL.onNewHead(WorkflowRun.java:1045) at org.jenkinsci.plugins.workflow.cps.CpsFlowExecution.notifyListeners(CpsFlowExecution.java:1472) at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup$3.run(CpsThreadGroup.java:491) at org.jenkinsci.plugins.workflow.cps.CpsVmExecutorService$1.run(CpsVmExecutorService.java:38) at hudson.remoting.SingleLaneExecutorService$1.run(SingleLaneExecutorService.java:139) at jenkins.util.ContextResettingExecutorService$1.run(ContextResettingExecutorService.java:28) at jenkins.security.ImpersonatingExecutorService$1.run(ImpersonatingExecutorService.java:68) at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515) at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) at java.base/java.lang.Thread.run(Thread.java:829)

           
           com.cloudbees.jenkins.plugins.bitbucket.api.BitbucketRequestException: HTTP request error. Status: 401: .

           

          HttpResponseProxy

          {HTTP/1.1 401 [Server: nginx, Date: Thu, 16 Dec 2021 15:22:56 GMT, Content-Type: application/json;charset=UTF-8, Transfer-Encoding: chunked, Connection: keep-alive, X-AREQUESTID: @1E51M4Hx922x56159881x3, X-ASEN: <redacted>, Cache-Control: no-cache, no-transform, Vary: accept-encoding,x-auserid,cookie,x-ausername,accept-encoding, WWW-Authenticate: OAuth realm="https%3A%2F%2F<redacted>", X-Content-Type-Options: nosniff] org.apache.http.client.entity.DecompressingEntity@53042323}

           at com.cloudbees.jenkins.plugins.bitbucket.server.client.BitbucketServerAPIClient.getRequest(BitbucketServerAPIClient.java:883) at com.cloudbees.jenkins.plugins.bitbucket.server.client.BitbucketServerAPIClient.getResources(BitbucketServerAPIClient.java:835)<redacted> at com.cloudbees.jenkins.plugins.bitbucket.server.client.BitbucketServerAPIClient.getServerBranches(BitbucketServerAPIClient.java:588) <redacted> at com.cloudbees.jenkins.plugins.bitbucket.server.client.BitbucketServerAPIClient.getBranches(BitbucketServerAPIClient.java:579) at com.cloudbees.jenkins.plugins.bitbucket.BitbucketSCMSource.retrieve(BitbucketSCMSource.java:795) at jenkins.scm.api.SCMSource.fetch(SCMSource.java:582) at org.jenkinsci.plugins.workflow.multibranch.SCMBinder.create(SCMBinder.java:100) at org.jenkinsci.plugins.workflow.job.WorkflowRun.run(WorkflowRun.java:310) at hudson.model.ResourceController.execute(ResourceController.java:99) at hudson.model.Executor.run(Executor.java:432)
            
           I don't understand why it would try and use OAuth authentication when the credentials configured are username/password.
          Stephen Fry made changes -
          Description Original: Intermittently we get failures to get source or notifier of build status which show the following errors.

          com.cloudbees.jenkins.plugins.bitbucket.api.BitbucketRequestException: HTTP request error. Status: 401: . HttpResponseProxy

          {HTTP/1.1 401 [Server: nginx, Date: Fri, 17 Dec 2021 11:59:17 GMT, Content-Type: application/json;charset=UTF-8, Transfer-Encoding: chunked, Connection: keep-alive, X-AREQUESTID: @1E51M4Hx719x57504526x4, X-ASEN: <redacted>, Cache-Control: no-cache, no-transform, Vary: accept-encoding,x-auserid,cookie,x-ausername,accept-encoding, WWW-Authenticate: OAuth realm="https%3A%2F%2F<redacted>", X-Content-Type-Options: nosniff] org.apache.http.client.entity.DecompressingEntity@7ca853a7}

          at com.cloudbees.jenkins.plugins.bitbucket.server.client.BitbucketServerAPIClient.doRequest(BitbucketServerAPIClient.java:1095) at com.cloudbees.jenkins.plugins.bitbucket.server.client.BitbucketServerAPIClient.postRequest(BitbucketServerAPIClient.java:1048) at com.cloudbees.jenkins.plugins.bitbucket.server.client.BitbucketServerAPIClient.postRequest(BitbucketServerAPIClient.java:1036) at com.cloudbees.jenkins.plugins.bitbucket.server.client.BitbucketServerAPIClient.postBuildStatus(BitbucketServerAPIClient.java:511) at com.cloudbees.jenkins.plugins.bitbucket.BitbucketChangesetCommentNotifier.buildStatus(BitbucketChangesetCommentNotifier.java:50) at com.cloudbees.jenkins.plugins.bitbucket.BitbucketBuildStatusNotifications.createStatus(BitbucketBuildStatusNotifications.java:161) at com.cloudbees.jenkins.plugins.bitbucket.BitbucketBuildStatusNotifications.sendNotifications(BitbucketBuildStatusNotifications.java:203) at com.cloudbees.jenkins.plugins.bitbucket.BitbucketBuildStatusNotifications.access$100(BitbucketBuildStatusNotifications.java:59) at com.cloudbees.jenkins.plugins.bitbucket.BitbucketBuildStatusNotifications$JobCompletedListener.onCompleted(BitbucketBuildStatusNotifications.java:285) at hudson.model.listeners.RunListener.fireCompleted(RunListener.java:208) at org.jenkinsci.plugins.workflow.job.WorkflowRun.finish(WorkflowRun.java:625) at org.jenkinsci.plugins.workflow.job.WorkflowRun.access$800(WorkflowRun.java:138) at org.jenkinsci.plugins.workflow.job.WorkflowRun$GraphL.onNewHead(WorkflowRun.java:1045) at org.jenkinsci.plugins.workflow.cps.CpsFlowExecution.notifyListeners(CpsFlowExecution.java:1472) at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup$3.run(CpsThreadGroup.java:491) at org.jenkinsci.plugins.workflow.cps.CpsVmExecutorService$1.run(CpsVmExecutorService.java:38) at hudson.remoting.SingleLaneExecutorService$1.run(SingleLaneExecutorService.java:139) at jenkins.util.ContextResettingExecutorService$1.run(ContextResettingExecutorService.java:28) at jenkins.security.ImpersonatingExecutorService$1.run(ImpersonatingExecutorService.java:68) at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515) at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) at java.base/java.lang.Thread.run(Thread.java:829)

           
           com.cloudbees.jenkins.plugins.bitbucket.api.BitbucketRequestException: HTTP request error. Status: 401: .

           

          HttpResponseProxy

          {HTTP/1.1 401 [Server: nginx, Date: Thu, 16 Dec 2021 15:22:56 GMT, Content-Type: application/json;charset=UTF-8, Transfer-Encoding: chunked, Connection: keep-alive, X-AREQUESTID: @1E51M4Hx922x56159881x3, X-ASEN: <redacted>, Cache-Control: no-cache, no-transform, Vary: accept-encoding,x-auserid,cookie,x-ausername,accept-encoding, WWW-Authenticate: OAuth realm="https%3A%2F%2F<redacted>", X-Content-Type-Options: nosniff] org.apache.http.client.entity.DecompressingEntity@53042323}

           at com.cloudbees.jenkins.plugins.bitbucket.server.client.BitbucketServerAPIClient.getRequest(BitbucketServerAPIClient.java:883) at com.cloudbees.jenkins.plugins.bitbucket.server.client.BitbucketServerAPIClient.getResources(BitbucketServerAPIClient.java:835)<redacted> at com.cloudbees.jenkins.plugins.bitbucket.server.client.BitbucketServerAPIClient.getServerBranches(BitbucketServerAPIClient.java:588) <redacted> at com.cloudbees.jenkins.plugins.bitbucket.server.client.BitbucketServerAPIClient.getBranches(BitbucketServerAPIClient.java:579) at com.cloudbees.jenkins.plugins.bitbucket.BitbucketSCMSource.retrieve(BitbucketSCMSource.java:795) at jenkins.scm.api.SCMSource.fetch(SCMSource.java:582) at org.jenkinsci.plugins.workflow.multibranch.SCMBinder.create(SCMBinder.java:100) at org.jenkinsci.plugins.workflow.job.WorkflowRun.run(WorkflowRun.java:310) at hudson.model.ResourceController.execute(ResourceController.java:99) at hudson.model.Executor.run(Executor.java:432)
            
           I don't understand why it would try and use OAuth authentication when the credentials configured are username/password.
          New: Intermittently we get failures to get source or notify Bitbucket of build status which show the following errors.

          com.cloudbees.jenkins.plugins.bitbucket.api.BitbucketRequestException: HTTP request error. Status: 401: . HttpResponseProxy

          {HTTP/1.1 401 [Server: nginx, Date: Fri, 17 Dec 2021 11:59:17 GMT, Content-Type: application/json;charset=UTF-8, Transfer-Encoding: chunked, Connection: keep-alive, X-AREQUESTID: @1E51M4Hx719x57504526x4, X-ASEN: <redacted>, Cache-Control: no-cache, no-transform, Vary: accept-encoding,x-auserid,cookie,x-ausername,accept-encoding, WWW-Authenticate: OAuth realm="https%3A%2F%2F<redacted>", X-Content-Type-Options: nosniff] org.apache.http.client.entity.DecompressingEntity@7ca853a7}

          at com.cloudbees.jenkins.plugins.bitbucket.server.client.BitbucketServerAPIClient.doRequest(BitbucketServerAPIClient.java:1095) at com.cloudbees.jenkins.plugins.bitbucket.server.client.BitbucketServerAPIClient.postRequest(BitbucketServerAPIClient.java:1048) at com.cloudbees.jenkins.plugins.bitbucket.server.client.BitbucketServerAPIClient.postRequest(BitbucketServerAPIClient.java:1036) at com.cloudbees.jenkins.plugins.bitbucket.server.client.BitbucketServerAPIClient.postBuildStatus(BitbucketServerAPIClient.java:511) at com.cloudbees.jenkins.plugins.bitbucket.BitbucketChangesetCommentNotifier.buildStatus(BitbucketChangesetCommentNotifier.java:50) at com.cloudbees.jenkins.plugins.bitbucket.BitbucketBuildStatusNotifications.createStatus(BitbucketBuildStatusNotifications.java:161) at com.cloudbees.jenkins.plugins.bitbucket.BitbucketBuildStatusNotifications.sendNotifications(BitbucketBuildStatusNotifications.java:203) at com.cloudbees.jenkins.plugins.bitbucket.BitbucketBuildStatusNotifications.access$100(BitbucketBuildStatusNotifications.java:59) at com.cloudbees.jenkins.plugins.bitbucket.BitbucketBuildStatusNotifications$JobCompletedListener.onCompleted(BitbucketBuildStatusNotifications.java:285) at hudson.model.listeners.RunListener.fireCompleted(RunListener.java:208) at org.jenkinsci.plugins.workflow.job.WorkflowRun.finish(WorkflowRun.java:625) at org.jenkinsci.plugins.workflow.job.WorkflowRun.access$800(WorkflowRun.java:138) at org.jenkinsci.plugins.workflow.job.WorkflowRun$GraphL.onNewHead(WorkflowRun.java:1045) at org.jenkinsci.plugins.workflow.cps.CpsFlowExecution.notifyListeners(CpsFlowExecution.java:1472) at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup$3.run(CpsThreadGroup.java:491) at org.jenkinsci.plugins.workflow.cps.CpsVmExecutorService$1.run(CpsVmExecutorService.java:38) at hudson.remoting.SingleLaneExecutorService$1.run(SingleLaneExecutorService.java:139) at jenkins.util.ContextResettingExecutorService$1.run(ContextResettingExecutorService.java:28) at jenkins.security.ImpersonatingExecutorService$1.run(ImpersonatingExecutorService.java:68) at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515) at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) at java.base/java.lang.Thread.run(Thread.java:829)

           
           com.cloudbees.jenkins.plugins.bitbucket.api.BitbucketRequestException: HTTP request error. Status: 401: .

           

          HttpResponseProxy

          {HTTP/1.1 401 [Server: nginx, Date: Thu, 16 Dec 2021 15:22:56 GMT, Content-Type: application/json;charset=UTF-8, Transfer-Encoding: chunked, Connection: keep-alive, X-AREQUESTID: @1E51M4Hx922x56159881x3, X-ASEN: <redacted>, Cache-Control: no-cache, no-transform, Vary: accept-encoding,x-auserid,cookie,x-ausername,accept-encoding, WWW-Authenticate: OAuth realm="https%3A%2F%2F<redacted>", X-Content-Type-Options: nosniff] org.apache.http.client.entity.DecompressingEntity@53042323}

           at com.cloudbees.jenkins.plugins.bitbucket.server.client.BitbucketServerAPIClient.getRequest(BitbucketServerAPIClient.java:883) at com.cloudbees.jenkins.plugins.bitbucket.server.client.BitbucketServerAPIClient.getResources(BitbucketServerAPIClient.java:835)<redacted> at com.cloudbees.jenkins.plugins.bitbucket.server.client.BitbucketServerAPIClient.getServerBranches(BitbucketServerAPIClient.java:588) <redacted> at com.cloudbees.jenkins.plugins.bitbucket.server.client.BitbucketServerAPIClient.getBranches(BitbucketServerAPIClient.java:579) at com.cloudbees.jenkins.plugins.bitbucket.BitbucketSCMSource.retrieve(BitbucketSCMSource.java:795) at jenkins.scm.api.SCMSource.fetch(SCMSource.java:582) at org.jenkinsci.plugins.workflow.multibranch.SCMBinder.create(SCMBinder.java:100) at org.jenkinsci.plugins.workflow.job.WorkflowRun.run(WorkflowRun.java:310) at hudson.model.ResourceController.execute(ResourceController.java:99) at hudson.model.Executor.run(Executor.java:432)
            
           I don't understand why it would try and use OAuth authentication when the credentials configured are username/password.
          Stephen Fry made changes -
          Description Original: Intermittently we get failures to get source or notify Bitbucket of build status which show the following errors.

          com.cloudbees.jenkins.plugins.bitbucket.api.BitbucketRequestException: HTTP request error. Status: 401: . HttpResponseProxy

          {HTTP/1.1 401 [Server: nginx, Date: Fri, 17 Dec 2021 11:59:17 GMT, Content-Type: application/json;charset=UTF-8, Transfer-Encoding: chunked, Connection: keep-alive, X-AREQUESTID: @1E51M4Hx719x57504526x4, X-ASEN: <redacted>, Cache-Control: no-cache, no-transform, Vary: accept-encoding,x-auserid,cookie,x-ausername,accept-encoding, WWW-Authenticate: OAuth realm="https%3A%2F%2F<redacted>", X-Content-Type-Options: nosniff] org.apache.http.client.entity.DecompressingEntity@7ca853a7}

          at com.cloudbees.jenkins.plugins.bitbucket.server.client.BitbucketServerAPIClient.doRequest(BitbucketServerAPIClient.java:1095) at com.cloudbees.jenkins.plugins.bitbucket.server.client.BitbucketServerAPIClient.postRequest(BitbucketServerAPIClient.java:1048) at com.cloudbees.jenkins.plugins.bitbucket.server.client.BitbucketServerAPIClient.postRequest(BitbucketServerAPIClient.java:1036) at com.cloudbees.jenkins.plugins.bitbucket.server.client.BitbucketServerAPIClient.postBuildStatus(BitbucketServerAPIClient.java:511) at com.cloudbees.jenkins.plugins.bitbucket.BitbucketChangesetCommentNotifier.buildStatus(BitbucketChangesetCommentNotifier.java:50) at com.cloudbees.jenkins.plugins.bitbucket.BitbucketBuildStatusNotifications.createStatus(BitbucketBuildStatusNotifications.java:161) at com.cloudbees.jenkins.plugins.bitbucket.BitbucketBuildStatusNotifications.sendNotifications(BitbucketBuildStatusNotifications.java:203) at com.cloudbees.jenkins.plugins.bitbucket.BitbucketBuildStatusNotifications.access$100(BitbucketBuildStatusNotifications.java:59) at com.cloudbees.jenkins.plugins.bitbucket.BitbucketBuildStatusNotifications$JobCompletedListener.onCompleted(BitbucketBuildStatusNotifications.java:285) at hudson.model.listeners.RunListener.fireCompleted(RunListener.java:208) at org.jenkinsci.plugins.workflow.job.WorkflowRun.finish(WorkflowRun.java:625) at org.jenkinsci.plugins.workflow.job.WorkflowRun.access$800(WorkflowRun.java:138) at org.jenkinsci.plugins.workflow.job.WorkflowRun$GraphL.onNewHead(WorkflowRun.java:1045) at org.jenkinsci.plugins.workflow.cps.CpsFlowExecution.notifyListeners(CpsFlowExecution.java:1472) at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup$3.run(CpsThreadGroup.java:491) at org.jenkinsci.plugins.workflow.cps.CpsVmExecutorService$1.run(CpsVmExecutorService.java:38) at hudson.remoting.SingleLaneExecutorService$1.run(SingleLaneExecutorService.java:139) at jenkins.util.ContextResettingExecutorService$1.run(ContextResettingExecutorService.java:28) at jenkins.security.ImpersonatingExecutorService$1.run(ImpersonatingExecutorService.java:68) at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515) at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) at java.base/java.lang.Thread.run(Thread.java:829)

           
           com.cloudbees.jenkins.plugins.bitbucket.api.BitbucketRequestException: HTTP request error. Status: 401: .

           

          HttpResponseProxy

          {HTTP/1.1 401 [Server: nginx, Date: Thu, 16 Dec 2021 15:22:56 GMT, Content-Type: application/json;charset=UTF-8, Transfer-Encoding: chunked, Connection: keep-alive, X-AREQUESTID: @1E51M4Hx922x56159881x3, X-ASEN: <redacted>, Cache-Control: no-cache, no-transform, Vary: accept-encoding,x-auserid,cookie,x-ausername,accept-encoding, WWW-Authenticate: OAuth realm="https%3A%2F%2F<redacted>", X-Content-Type-Options: nosniff] org.apache.http.client.entity.DecompressingEntity@53042323}

           at com.cloudbees.jenkins.plugins.bitbucket.server.client.BitbucketServerAPIClient.getRequest(BitbucketServerAPIClient.java:883) at com.cloudbees.jenkins.plugins.bitbucket.server.client.BitbucketServerAPIClient.getResources(BitbucketServerAPIClient.java:835)<redacted> at com.cloudbees.jenkins.plugins.bitbucket.server.client.BitbucketServerAPIClient.getServerBranches(BitbucketServerAPIClient.java:588) <redacted> at com.cloudbees.jenkins.plugins.bitbucket.server.client.BitbucketServerAPIClient.getBranches(BitbucketServerAPIClient.java:579) at com.cloudbees.jenkins.plugins.bitbucket.BitbucketSCMSource.retrieve(BitbucketSCMSource.java:795) at jenkins.scm.api.SCMSource.fetch(SCMSource.java:582) at org.jenkinsci.plugins.workflow.multibranch.SCMBinder.create(SCMBinder.java:100) at org.jenkinsci.plugins.workflow.job.WorkflowRun.run(WorkflowRun.java:310) at hudson.model.ResourceController.execute(ResourceController.java:99) at hudson.model.Executor.run(Executor.java:432)
            
           I don't understand why it would try and use OAuth authentication when the credentials configured are username/password.
          New: Intermittently we get failures to get source or notify Bitbucket of build status which show the following errors.

          com.cloudbees.jenkins.plugins.bitbucket.api.BitbucketRequestException: HTTP request error. Status: 401: . HttpResponseProxy

          {HTTP/1.1 401 [Server: nginx, Date: Fri, 17 Dec 2021 11:59:17 GMT, Content-Type: application/json;charset=UTF-8, Transfer-Encoding: chunked, Connection: keep-alive, X-AREQUESTID: @1E51M4Hx719x57504526x4, X-ASEN: <redacted>, Cache-Control: no-cache, no-transform, Vary: accept-encoding,x-auserid,cookie,x-ausername,accept-encoding, WWW-Authenticate: OAuth realm="https%3A%2F%2F<redacted>", X-Content-Type-Options: nosniff] org.apache.http.client.entity.DecompressingEntity@7ca853a7}

          at com.cloudbees.jenkins.plugins.bitbucket.server.client.BitbucketServerAPIClient.doRequest(BitbucketServerAPIClient.java:1095) at com.cloudbees.jenkins.plugins.bitbucket.server.client.BitbucketServerAPIClient.postRequest(BitbucketServerAPIClient.java:1048) at com.cloudbees.jenkins.plugins.bitbucket.server.client.BitbucketServerAPIClient.postRequest(BitbucketServerAPIClient.java:1036) at com.cloudbees.jenkins.plugins.bitbucket.server.client.BitbucketServerAPIClient.postBuildStatus(BitbucketServerAPIClient.java:511) at com.cloudbees.jenkins.plugins.bitbucket.BitbucketChangesetCommentNotifier.buildStatus(BitbucketChangesetCommentNotifier.java:50) at com.cloudbees.jenkins.plugins.bitbucket.BitbucketBuildStatusNotifications.createStatus(BitbucketBuildStatusNotifications.java:161) at com.cloudbees.jenkins.plugins.bitbucket.BitbucketBuildStatusNotifications.sendNotifications(BitbucketBuildStatusNotifications.java:203) at com.cloudbees.jenkins.plugins.bitbucket.BitbucketBuildStatusNotifications.access$100(BitbucketBuildStatusNotifications.java:59) at com.cloudbees.jenkins.plugins.bitbucket.BitbucketBuildStatusNotifications$JobCompletedListener.onCompleted(BitbucketBuildStatusNotifications.java:285) at hudson.model.listeners.RunListener.fireCompleted(RunListener.java:208) at org.jenkinsci.plugins.workflow.job.WorkflowRun.finish(WorkflowRun.java:625) at org.jenkinsci.plugins.workflow.job.WorkflowRun.access$800(WorkflowRun.java:138) at org.jenkinsci.plugins.workflow.job.WorkflowRun$GraphL.onNewHead(WorkflowRun.java:1045) at org.jenkinsci.plugins.workflow.cps.CpsFlowExecution.notifyListeners(CpsFlowExecution.java:1472) at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup$3.run(CpsThreadGroup.java:491) at org.jenkinsci.plugins.workflow.cps.CpsVmExecutorService$1.run(CpsVmExecutorService.java:38) at hudson.remoting.SingleLaneExecutorService$1.run(SingleLaneExecutorService.java:139) at jenkins.util.ContextResettingExecutorService$1.run(ContextResettingExecutorService.java:28) at jenkins.security.ImpersonatingExecutorService$1.run(ImpersonatingExecutorService.java:68) at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515) at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) at java.base/java.lang.Thread.run(Thread.java:829)

           
           com.cloudbees.jenkins.plugins.bitbucket.api.BitbucketRequestException: HTTP request error. Status: 401: .

           

          HttpResponseProxy

          {HTTP/1.1 401 [Server: nginx, Date: Thu, 16 Dec 2021 15:22:56 GMT, Content-Type: application/json;charset=UTF-8, Transfer-Encoding: chunked, Connection: keep-alive, X-AREQUESTID: @1E51M4Hx922x56159881x3, X-ASEN: <redacted>, Cache-Control: no-cache, no-transform, Vary: accept-encoding,x-auserid,cookie,x-ausername,accept-encoding, WWW-Authenticate: OAuth realm="https%3A%2F%2F<redacted>", X-Content-Type-Options: nosniff] org.apache.http.client.entity.DecompressingEntity@53042323}

           at com.cloudbees.jenkins.plugins.bitbucket.server.client.BitbucketServerAPIClient.getRequest(BitbucketServerAPIClient.java:883) at com.cloudbees.jenkins.plugins.bitbucket.server.client.BitbucketServerAPIClient.getResources(BitbucketServerAPIClient.java:835)<redacted> at com.cloudbees.jenkins.plugins.bitbucket.server.client.BitbucketServerAPIClient.getServerBranches(BitbucketServerAPIClient.java:588) <redacted> at com.cloudbees.jenkins.plugins.bitbucket.server.client.BitbucketServerAPIClient.getBranches(BitbucketServerAPIClient.java:579) at com.cloudbees.jenkins.plugins.bitbucket.BitbucketSCMSource.retrieve(BitbucketSCMSource.java:795) at jenkins.scm.api.SCMSource.fetch(SCMSource.java:582) at org.jenkinsci.plugins.workflow.multibranch.SCMBinder.create(SCMBinder.java:100) at org.jenkinsci.plugins.workflow.job.WorkflowRun.run(WorkflowRun.java:310) at hudson.model.ResourceController.execute(ResourceController.java:99) at hudson.model.Executor.run(Executor.java:432)
            
           I don't understand why it would try and use OAuth authentication when the credentials configured are username/password.

          99% of the time both actions work fine.
          Nikolas Falco made changes -
          Assignee Original: Antonio Mansilla [ flagbit ] New: Nikolas Falco [ nfalco ]
          Stephen Fry made changes -
          Attachment New: bitbucket401.png [ 63831 ]
          Stephen Fry made changes -
          Attachment New: toal_builds.png [ 63832 ]
          Nikolas Falco made changes -
          Resolution New: Fixed [ 1 ]
          Status Original: Open [ 1 ] New: Closed [ 6 ]

            nfalco Nikolas Falco
            sfryffdc Stephen Fry
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: