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

Bitbucket branch source fail randomly

    XMLWordPrintable

Details

    Description

      I have a Bitbucket team with a lot of projects and a lot of branches.

      When I try to use Scan organization folder it fail every time in a different place. Maybe it brakes where the previously run will work correctly.

      I have tried also to create a lot of multibranch projects (obviously it is not the right way to do it, just for testing) but when they become 10/15 they starting to give me errors when they try to scan again the bitbucket repo.

      Above the example of two stack trace of my exceptions:

      Connecting to https://bitbucket.org using user/****** (bitbucket credentials)
      ERROR: [Wed Nov 15 10:08:18 CET 2017] Could not refresh actions for navigator com.cloudbees.jenkins.plugins.bitbucket.BitbucketSCMNavigator@18be5b54
      org.apache.commons.httpclient.ConnectionPoolTimeoutException: Timeout waiting for connection
         at org.apache.commons.httpclient.MultiThreadedHttpConnectionManager.doGetConnection(MultiThreadedHttpConnectionManager.java:497)
         at org.apache.commons.httpclient.MultiThreadedHttpConnectionManager.getConnectionWithTimeout(MultiThreadedHttpConnectionManager.java:416)
         at org.apache.commons.httpclient.HttpMethodDirector.executeMethod(HttpMethodDirector.java:153)
         at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:397)
         at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:323)
         at com.cloudbees.jenkins.plugins.bitbucket.client.BitbucketCloudApiClient.executeMethod(BitbucketCloudApiClient.java:534)
         at com.cloudbees.jenkins.plugins.bitbucket.client.BitbucketCloudApiClient.getRequestAsInputStream(BitbucketCloudApiClient.java:556)
      Caused: java.io.IOException: Communication error for url: https://api.bitbucket.org/2.0/teams/weareradicalbit
         at com.cloudbees.jenkins.plugins.bitbucket.client.BitbucketCloudApiClient.getRequestAsInputStream(BitbucketCloudApiClient.java:570)
         at com.cloudbees.jenkins.plugins.bitbucket.client.BitbucketCloudApiClient.getRequest(BitbucketCloudApiClient.java:575)
         at com.cloudbees.jenkins.plugins.bitbucket.client.BitbucketCloudApiClient.getTeam(BitbucketCloudApiClient.java:452)
      Caused: java.io.IOException: I/O error when parsing response from URL: https://api.bitbucket.org/2.0/teams/weareradicalbit
         at com.cloudbees.jenkins.plugins.bitbucket.client.BitbucketCloudApiClient.getTeam(BitbucketCloudApiClient.java:457)
         at com.cloudbees.jenkins.plugins.bitbucket.BitbucketSCMNavigator.retrieveActions(BitbucketSCMNavigator.java:516)
         at jenkins.scm.api.SCMNavigator.fetchActions(SCMNavigator.java:315)
         at jenkins.branch.OrganizationFolder.computeChildren(OrganizationFolder.java:410)
         at com.cloudbees.hudson.plugins.folder.computed.ComputedFolder.updateChildren(ComputedFolder.java:276)
         at com.cloudbees.hudson.plugins.folder.computed.FolderComputation.run(FolderComputation.java:165)
         at jenkins.branch.OrganizationFolder$OrganizationScan.run(OrganizationFolder.java:910)
         at hudson.model.ResourceController.execute(ResourceController.java:98)
         at hudson.model.Executor.run(Executor.java:405)
      [Wed Nov 15 10:08:18 CET 2017] Consulting Bitbucket Team/Project
      Connecting to https://bitbucket.org using user/****** (bitbucket credentials)
      ERROR: [Wed Nov 15 10:08:28 CET 2017] Could not fetch sources from navigator com.cloudbees.jenkins.plugins.bitbucket.BitbucketSCMNavigator@18be5b54
      org.apache.commons.httpclient.ConnectionPoolTimeoutException: Timeout waiting for connection
         at org.apache.commons.httpclient.MultiThreadedHttpConnectionManager.doGetConnection(MultiThreadedHttpConnectionManager.java:497)
         at org.apache.commons.httpclient.MultiThreadedHttpConnectionManager.getConnectionWithTimeout(MultiThreadedHttpConnectionManager.java:416)
         at org.apache.commons.httpclient.HttpMethodDirector.executeMethod(HttpMethodDirector.java:153)
         at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:397)
         at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:323)
         at com.cloudbees.jenkins.plugins.bitbucket.client.BitbucketCloudApiClient.executeMethod(BitbucketCloudApiClient.java:534)
         at com.cloudbees.jenkins.plugins.bitbucket.client.BitbucketCloudApiClient.getRequestAsInputStream(BitbucketCloudApiClient.java:556)
      Caused: java.io.IOException: Communication error for url: https://api.bitbucket.org/2.0/teams/weareradicalbit
         at com.cloudbees.jenkins.plugins.bitbucket.client.BitbucketCloudApiClient.getRequestAsInputStream(BitbucketCloudApiClient.java:570)
         at com.cloudbees.jenkins.plugins.bitbucket.client.BitbucketCloudApiClient.getRequest(BitbucketCloudApiClient.java:575)
         at com.cloudbees.jenkins.plugins.bitbucket.client.BitbucketCloudApiClient.getTeam(BitbucketCloudApiClient.java:452)
      Caused: java.io.IOException: I/O error when parsing response from URL: https://api.bitbucket.org/2.0/teams/weareradicalbit
         at com.cloudbees.jenkins.plugins.bitbucket.client.BitbucketCloudApiClient.getTeam(BitbucketCloudApiClient.java:457)
         at com.cloudbees.jenkins.plugins.bitbucket.BitbucketSCMNavigator.visitSources(BitbucketSCMNavigator.java:469)
         at jenkins.branch.OrganizationFolder.computeChildren(OrganizationFolder.java:459)
         at com.cloudbees.hudson.plugins.folder.computed.ComputedFolder.updateChildren(ComputedFolder.java:276)
         at com.cloudbees.hudson.plugins.folder.computed.FolderComputation.run(FolderComputation.java:165)
         at jenkins.branch.OrganizationFolder$OrganizationScan.run(OrganizationFolder.java:910)
         at hudson.model.ResourceController.execute(ResourceController.java:98)
         at hudson.model.Executor.run(Executor.java:405)
      [Wed Nov 15 10:08:28 CET 2017] Finished organization scan. Scan took 20 sec
      FATAL: Failed to recompute children of Radicalbit
      java.io.IOException: I/O error when parsing response from URL: https://api.bitbucket.org/2.0/teams/weareradicalbit
         at com.cloudbees.jenkins.plugins.bitbucket.client.BitbucketCloudApiClient.getTeam(BitbucketCloudApiClient.java:457)
         at com.cloudbees.jenkins.plugins.bitbucket.BitbucketSCMNavigator.visitSources(BitbucketSCMNavigator.java:469)
         at jenkins.branch.OrganizationFolder.computeChildren(OrganizationFolder.java:459)
         at com.cloudbees.hudson.plugins.folder.computed.ComputedFolder.updateChildren(ComputedFolder.java:276)
         at com.cloudbees.hudson.plugins.folder.computed.FolderComputation.run(FolderComputation.java:165)
         at jenkins.branch.OrganizationFolder$OrganizationScan.run(OrganizationFolder.java:910)
         at hudson.model.ResourceController.execute(ResourceController.java:98)
         at hudson.model.Executor.run(Executor.java:405)
      Caused by: java.io.IOException: Communication error for url: https://api.bitbucket.org/2.0/teams/weareradicalbit
         at com.cloudbees.jenkins.plugins.bitbucket.client.BitbucketCloudApiClient.getRequestAsInputStream(BitbucketCloudApiClient.java:570)
         at com.cloudbees.jenkins.plugins.bitbucket.client.BitbucketCloudApiClient.getRequest(BitbucketCloudApiClient.java:575)
         at com.cloudbees.jenkins.plugins.bitbucket.client.BitbucketCloudApiClient.getTeam(BitbucketCloudApiClient.java:452)
         ... 7 more
      Caused by: org.apache.commons.httpclient.ConnectionPoolTimeoutException: Timeout waiting for connection
         at org.apache.commons.httpclient.MultiThreadedHttpConnectionManager.doGetConnection(MultiThreadedHttpConnectionManager.java:497)
         at org.apache.commons.httpclient.MultiThreadedHttpConnectionManager.getConnectionWithTimeout(MultiThreadedHttpConnectionManager.java:416)
         at org.apache.commons.httpclient.HttpMethodDirector.executeMethod(HttpMethodDirector.java:153)
         at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:397)
         at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:323)
         at com.cloudbees.jenkins.plugins.bitbucket.client.BitbucketCloudApiClient.executeMethod(BitbucketCloudApiClient.java:534)
         at com.cloudbees.jenkins.plugins.bitbucket.client.BitbucketCloudApiClient.getRequestAsInputStream(BitbucketCloudApiClient.java:556)
         ... 9 more
      Finished: FAILURE
      
      Connecting to https://bitbucket.org using user/****** (bitbucket credentials)
      ERROR: [Wed Nov 15 10:47:20 CET 2017] Could not fetch sources from navigator com.cloudbees.jenkins.plugins.bitbucket.BitbucketSCMNavigator@18be5b54
      org.apache.commons.httpclient.ConnectionPoolTimeoutException: Timeout waiting for connection
      	at org.apache.commons.httpclient.MultiThreadedHttpConnectionManager.doGetConnection(MultiThreadedHttpConnectionManager.java:497)
      	at org.apache.commons.httpclient.MultiThreadedHttpConnectionManager.getConnectionWithTimeout(MultiThreadedHttpConnectionManager.java:416)
      	at org.apache.commons.httpclient.HttpMethodDirector.executeMethod(HttpMethodDirector.java:153)
      	at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:397)
      	at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:323)
      	at com.cloudbees.jenkins.plugins.bitbucket.client.BitbucketCloudApiClient.executeMethod(BitbucketCloudApiClient.java:545)
      	at com.cloudbees.jenkins.plugins.bitbucket.client.BitbucketCloudApiClient.getRequestAsInputStream(BitbucketCloudApiClient.java:556)
      Caused: java.io.IOException: Communication error for url: https://api.bitbucket.org/2.0/repositories/weareradicalbit/cyber-security-demo-core
      	at com.cloudbees.jenkins.plugins.bitbucket.client.BitbucketCloudApiClient.getRequestAsInputStream(BitbucketCloudApiClient.java:570)
      	at com.cloudbees.jenkins.plugins.bitbucket.client.BitbucketCloudApiClient.getRequest(BitbucketCloudApiClient.java:575)
      	at com.cloudbees.jenkins.plugins.bitbucket.client.BitbucketCloudApiClient.getRepository(BitbucketCloudApiClient.java:251)
      	at com.cloudbees.jenkins.plugins.bitbucket.BitbucketSCMSource.getRepositoryType(BitbucketSCMSource.java:496)
      	at com.cloudbees.jenkins.plugins.bitbucket.BitbucketSCMSource.retrieve(BitbucketSCMSource.java:540)
      	at jenkins.scm.api.SCMSource._retrieve(SCMSource.java:355)
      	at jenkins.scm.api.SCMSource.fetch(SCMSource.java:309)
      	at jenkins.branch.MultiBranchProjectFactory$BySCMSourceCriteria.recognizes(MultiBranchProjectFactory.java:263)
      	at jenkins.branch.OrganizationFolder$SCMSourceObserverImpl$1.recognizes(OrganizationFolder.java:1346)
      	at jenkins.branch.OrganizationFolder$SCMSourceObserverImpl$1.complete(OrganizationFolder.java:1361)
      	at jenkins.scm.api.trait.SCMNavigatorRequest.process(SCMNavigatorRequest.java:256)
      	at jenkins.scm.api.trait.SCMNavigatorRequest.process(SCMNavigatorRequest.java:206)
      	at com.cloudbees.jenkins.plugins.bitbucket.BitbucketSCMNavigator.visitSources(BitbucketSCMNavigator.java:481)
      	at jenkins.branch.OrganizationFolder.computeChildren(OrganizationFolder.java:459)
      	at com.cloudbees.hudson.plugins.folder.computed.ComputedFolder.updateChildren(ComputedFolder.java:276)
      	at com.cloudbees.hudson.plugins.folder.computed.FolderComputation.run(FolderComputation.java:165)
      	at jenkins.branch.OrganizationFolder$OrganizationScan.run(OrganizationFolder.java:910)
      	at hudson.model.ResourceController.execute(ResourceController.java:98)
      	at hudson.model.Executor.run(Executor.java:405)
      [Wed Nov 15 10:47:20 CET 2017] Finished organization scan. Scan took 6 min 1 sec
      FATAL: Failed to recompute children of Radicalbit
      java.io.IOException: Communication error for url: https://api.bitbucket.org/2.0/repositories/weareradicalbit/cyber-security-demo-core
      	at com.cloudbees.jenkins.plugins.bitbucket.client.BitbucketCloudApiClient.getRequestAsInputStream(BitbucketCloudApiClient.java:570)
      	at com.cloudbees.jenkins.plugins.bitbucket.client.BitbucketCloudApiClient.getRequest(BitbucketCloudApiClient.java:575)
      	at com.cloudbees.jenkins.plugins.bitbucket.client.BitbucketCloudApiClient.getRepository(BitbucketCloudApiClient.java:251)
      	at com.cloudbees.jenkins.plugins.bitbucket.BitbucketSCMSource.getRepositoryType(BitbucketSCMSource.java:496)
      	at com.cloudbees.jenkins.plugins.bitbucket.BitbucketSCMSource.retrieve(BitbucketSCMSource.java:540)
      	at jenkins.scm.api.SCMSource._retrieve(SCMSource.java:355)
      	at jenkins.scm.api.SCMSource.fetch(SCMSource.java:309)
      	at jenkins.branch.MultiBranchProjectFactory$BySCMSourceCriteria.recognizes(MultiBranchProjectFactory.java:263)
      	at jenkins.branch.OrganizationFolder$SCMSourceObserverImpl$1.recognizes(OrganizationFolder.java:1346)
      	at jenkins.branch.OrganizationFolder$SCMSourceObserverImpl$1.complete(OrganizationFolder.java:1361)
      	at jenkins.scm.api.trait.SCMNavigatorRequest.process(SCMNavigatorRequest.java:256)
      	at jenkins.scm.api.trait.SCMNavigatorRequest.process(SCMNavigatorRequest.java:206)
      	at com.cloudbees.jenkins.plugins.bitbucket.BitbucketSCMNavigator.visitSources(BitbucketSCMNavigator.java:481)
      	at jenkins.branch.OrganizationFolder.computeChildren(OrganizationFolder.java:459)
      	at com.cloudbees.hudson.plugins.folder.computed.ComputedFolder.updateChildren(ComputedFolder.java:276)
      	at com.cloudbees.hudson.plugins.folder.computed.FolderComputation.run(FolderComputation.java:165)
      	at jenkins.branch.OrganizationFolder$OrganizationScan.run(OrganizationFolder.java:910)
      	at hudson.model.ResourceController.execute(ResourceController.java:98)
      	at hudson.model.Executor.run(Executor.java:405)
      Caused by: org.apache.commons.httpclient.ConnectionPoolTimeoutException: Timeout waiting for connection
      	at org.apache.commons.httpclient.MultiThreadedHttpConnectionManager.doGetConnection(MultiThreadedHttpConnectionManager.java:497)
      	at org.apache.commons.httpclient.MultiThreadedHttpConnectionManager.getConnectionWithTimeout(MultiThreadedHttpConnectionManager.java:416)
      	at org.apache.commons.httpclient.HttpMethodDirector.executeMethod(HttpMethodDirector.java:153)
      	at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:397)
      	at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:323)
      	at com.cloudbees.jenkins.plugins.bitbucket.client.BitbucketCloudApiClient.executeMethod(BitbucketCloudApiClient.java:545)
      	at com.cloudbees.jenkins.plugins.bitbucket.client.BitbucketCloudApiClient.getRequestAsInputStream(BitbucketCloudApiClient.java:556)
      	... 18 more
      Finished: FAILURE
      

      Attachments

        Issue Links

          Activity

            craig_riecke Craig Riecke added a comment -

            +1.  We're affected as well.  

            craig_riecke Craig Riecke added a comment - +1.  We're affected as well.  
            qorrect Charlie Sando added a comment - - edited

            +1 , also affected

            qorrect Charlie Sando added a comment - - edited +1 , also affected
            neoandroid Jordi Miguel added a comment -

            With the two PR linked in this issue merged and the related issue solved too the bug detailed in this ticket gets fixed.

            neoandroid Jordi Miguel added a comment - With the two PR linked in this issue merged and the related issue solved too the bug detailed in this ticket gets fixed.
            karan_mehta Karan Mehta added a comment - - edited

            Still facing this issue. Can you help us with the fix version of this?

            karan_mehta Karan Mehta added a comment - - edited Still facing this issue. Can you help us with the fix version of this?
            neoandroid Jordi Miguel added a comment - - edited

            Without more context it's hard to know where is the problem you're facing. At first glance it doesn't look like the same error that this ticket was tracking. From my point of view it look more like a network problem in your infrastructure.

            I would suggest that you try to discard that it's not something related to another part of the stack aside of this jenkins pluign, some ideas to look at: network connectivity, OS limits, DNS resolution, ...

            If you still think that the problem is on the jenkins plugin I recommend that you open a new ticket and show up also on the GitHub [repo|https://github.com/jenkinsci/bitbucket-branch-source-plugin/] and have a look at the open issues there. Also you can try to ask for help through the "issues" section.

            neoandroid Jordi Miguel added a comment - - edited Without more context it's hard to know where is the problem you're facing. At first glance it doesn't look like the same error that this ticket was tracking. From my point of view it look more like a network problem in your infrastructure. I would suggest that you try to discard that it's not something related to another part of the stack aside of this jenkins pluign, some ideas to look at: network connectivity, OS limits, DNS resolution, ... If you still think that the problem is on the jenkins plugin I recommend that you open a new ticket and show up also on the GitHub [repo| https://github.com/jenkinsci/bitbucket-branch-source-plugin/ ] and have a look at the open issues there. Also you can try to ask for help through the "issues" section.

            People

              neoandroid Jordi Miguel
              maocorte Mauro Cortellazzi
              Votes:
              8 Vote for this issue
              Watchers:
              18 Start watching this issue

              Dates

                Created:
                Updated: