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

Could not send notifications to Bitbucket Server, when access to source repository of pull request is not granted

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Major Major
    • None
    • Jenkins 2.479.2
      Bitbucket Branch Source plugin 933.v7119e94e8f56
      Bitbucket Server 7

      The Bitbucket Branch Source plugin version 930.ve6a_885b_3558f or later is unable to send build status notifications to Bitbucket Server, when Jenkins is building a pull request from a fork, and read access to the source repository of the PR has not been granted in Bitbucket. (If read access to the target repository of the PR had not been granted, then Jenkins would not even know about the PR.) This error did not occur in Bitbucket Branch Source 922.va_71d0e0b_7b_8d.

      The Jenkins console log shows:

      [Bitbucket] Notifying pull request build result
      ERROR: Could not send notifications
      com.cloudbees.jenkins.plugins.bitbucket.api.BitbucketRequestException: HTTP request error. Status: 401: .
      HttpResponseProxy{HTTP/1.1 401  [X-AREQUESTID: @1NS3KNXx914x317527x0, X-AUSERID: [REDACTED], X-AUSERNAME: [REDACTED], Cache-Control: no-cache, no-transform, Vary: x-ausername,x-auserid,cookie,accept-encoding, X-Content-Type-Options: nosniff, WWW-Authenticate: OAuth realm="https%3A%2F%2Fbitbucket.[REDACTED]", Content-Type: application/json;charset=UTF-8, Transfer-Encoding: chunked, Date: Mon, 09 Dec 2024 13:14:04 GMT, Keep-Alive: timeout=20, Connection: keep-alive] org.apache.http.client.entity.DecompressingEntity@28ea3beb}
      	at PluginClassLoader for cloudbees-bitbucket-branch-source//com.cloudbees.jenkins.plugins.bitbucket.server.client.BitbucketServerAPIClient.doRequest(BitbucketServerAPIClient.java:1097)
      	at PluginClassLoader for cloudbees-bitbucket-branch-source//com.cloudbees.jenkins.plugins.bitbucket.server.client.BitbucketServerAPIClient.postRequest(BitbucketServerAPIClient.java:1078)
      	at PluginClassLoader for cloudbees-bitbucket-branch-source//com.cloudbees.jenkins.plugins.bitbucket.server.client.BitbucketServerAPIClient.postRequest(BitbucketServerAPIClient.java:1074)
      	at PluginClassLoader for cloudbees-bitbucket-branch-source//com.cloudbees.jenkins.plugins.bitbucket.server.client.BitbucketServerAPIClient.postBuildStatus(BitbucketServerAPIClient.java:521)
      	at PluginClassLoader for cloudbees-bitbucket-branch-source//com.cloudbees.jenkins.plugins.bitbucket.BitbucketChangesetCommentNotifier.buildStatus(BitbucketChangesetCommentNotifier.java:50)
      	at PluginClassLoader for cloudbees-bitbucket-branch-source//com.cloudbees.jenkins.plugins.bitbucket.BitbucketBuildStatusNotifications.createStatus(BitbucketBuildStatusNotifications.java:173)
      	at PluginClassLoader for cloudbees-bitbucket-branch-source//com.cloudbees.jenkins.plugins.bitbucket.BitbucketBuildStatusNotifications.sendNotifications(BitbucketBuildStatusNotifications.java:237)
      	at PluginClassLoader for cloudbees-bitbucket-branch-source//com.cloudbees.jenkins.plugins.bitbucket.BitbucketBuildStatusNotifications$JobCheckoutListener.onCheckout(BitbucketBuildStatusNotifications.java:296)
      	at PluginClassLoader for workflow-scm-step//org.jenkinsci.plugins.workflow.steps.scm.SCMStep.checkout(SCMStep.java:182)
      	at PluginClassLoader for workflow-scm-step//org.jenkinsci.plugins.workflow.steps.scm.SCMStep$StepExecutionImpl.run(SCMStep.java:101)
      	at PluginClassLoader for workflow-scm-step//org.jenkinsci.plugins.workflow.steps.scm.SCMStep$StepExecutionImpl.run(SCMStep.java:88)
      	at PluginClassLoader for workflow-step-api//org.jenkinsci.plugins.workflow.steps.SynchronousNonBlockingStepExecution.lambda$start$0(SynchronousNonBlockingStepExecution.java:47)
      	at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:539)
      	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
      	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
      	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
      	at java.base/java.lang.Thread.run(Thread.java:840)
      

      Desired changes:

      • Document the need to grant this access.
      • Make the plugin show which repository it attempted to access, when it gets this HTTP 401 error.

            kon Kalle Niemitalo
            kon Kalle Niemitalo
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: