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

Legitimate errors during BitBucket API invocation are not reflected in "Scan Organization Folder Log

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Minor Minor
    • None
    • Jenkins 2.89.4, BitBucket Branch Source plugin 2.2.10

      I have a Jenkins webserver setup locally, its URL was configured as http://mbp.local:8080/

      I have created Bitbucket Team/Project. While scanning for suitable branches to build, Jenkins legitimately failed when trying to invoke Bitbucket API, as local Jenkins server was inaccessible.

      However, and that was really confusing and hard to debug, Scan Organization Folder Log was clean (see below as well). This was especially confusing, because other type of errors (such as lack of permissions on the team user) were correctly reported in Scan Organization Folder Log. It took me a while to figure out that I may have to look for such errors elsewhere. 

      While this is minor issue, I think it is important to log it properly, as misconfiguration of reverse proxy and other issues with Jenkins visibility from the outside are not uncommon. 

      1 branches were processed (query completed) Proposing hello-jenkins Connecting to

      https://bitbucket.org

      using sbat/****** Repository type: Mercurial Looking up MYORG/hello-jenkins for branches Checking branch default from Jellimatic/hello-jenkins 'Jenkinsfile' found Met criteria

      WARNING: Could not register hooks for MYORG/hello-jenkins
      com.cloudbees.jenkins.plugins.bitbucket.api.BitbucketRequestException: HTTP request error. Status: 400: Bad Request.
      HttpResponseProxy{HTTP/1.1 400 Bad Request [Server: nginx, Vary: Authorization, Content-Type: application/json; charset=utf-8, X-OAuth-Scopes: webhook, pullrequest, project, team, Strict-Transport-Security: max-age=31536000; includeSubDomains; preload, Date: Mon, 26 Mar 2018 09:11:59 GMT, X-Served-By: app-143, ETag: "f787536008f2855bc4a6ce0916e084c7", X-Static-Version: 665ec9cf9a4f, X-Accepted-OAuth-Scopes: webhook, X-Credential-Type: apppassword, X-Render-Time: 0.0546479225159, Connection: close, X-Request-Count: 389, X-Frame-Options: SAMEORIGIN, X-Version: 665ec9cf9a4f, Content-Length: 90] ResponseEntityProxy{[Content-Type: application/json; charset=utf-8,Content-Length: 90,Chunked: false]}}
      at com.cloudbees.jenkins.plugins.bitbucket.client.BitbucketCloudApiClient.doRequest(BitbucketCloudApiClient.java:762)
      at com.cloudbees.jenkins.plugins.bitbucket.client.BitbucketCloudApiClient.postRequest(BitbucketCloudApiClient.java:812)
      at com.cloudbees.jenkins.plugins.bitbucket.client.BitbucketCloudApiClient.registerCommitWebHook(BitbucketCloudApiClient.java:456)
      at com.cloudbees.jenkins.plugins.bitbucket.hooks.WebhookAutoRegisterListener.registerHooks(WebhookAutoRegisterListener.java:160)
      at com.cloudbees.jenkins.plugins.bitbucket.hooks.WebhookAutoRegisterListener.access$000(WebhookAutoRegisterListener.java:64)
      at com.cloudbees.jenkins.plugins.bitbucket.hooks.WebhookAutoRegisterListener$1.doRun(WebhookAutoRegisterListener.java:110)
      at hudson.triggers.SafeTimerTask.run(SafeTimerTask.java:51)
      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)

            Unassigned Unassigned
            sbat Sergey Batishchev
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated: