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

Handle when default branch is not found

XMLWordPrintable

      Problem
      When a Bitbucket server's repository is scanned and the repository has no browsers, the endpoint describing the branch will fail (404) causing the scan to fail.

      Scope

      • Do not set the default branch and silently continue

      Error

      ERROR: [Tue Jul 18 11:04:30 EDT 2017] Could not update folder level actions from source 24e70d6e-8882-498f-88ed-638cfc5cbf20
      java.io.IOException: I/O error when accessing URL: /rest/api/1.0/projects/PROJECT_1/repos/repo-2/branches/default
      	at com.cloudbees.jenkins.plugins.bitbucket.server.client.BitbucketServerAPIClient.getDefaultBranch(BitbucketServerAPIClient.java:345)
      	at com.cloudbees.jenkins.plugins.bitbucket.BitbucketSCMSource.retrieveActions(BitbucketSCMSource.java:967)
      	at jenkins.scm.api.SCMSource.fetchActions(SCMSource.java:746)
      	at jenkins.branch.MultiBranchProject.computeChildren(MultiBranchProject.java:587)
      	at com.cloudbees.hudson.plugins.folder.computed.ComputedFolder.updateChildren(ComputedFolder.java:266)
      	at com.cloudbees.hudson.plugins.folder.computed.FolderComputation.run(FolderComputation.java:162)
      	at jenkins.branch.MultiBranchProject$BranchIndexing.run(MultiBranchProject.java:969)
      	at hudson.model.ResourceController.execute(ResourceController.java:98)
      	at hudson.model.Executor.run(Executor.java:410)
      Caused by: java.io.FileNotFoundException: URL: /rest/api/1.0/projects/PROJECT_1/repos/repo-2/branches/default
      	at com.cloudbees.jenkins.plugins.bitbucket.server.client.BitbucketServerAPIClient.getRequest(BitbucketServerAPIClient.java:508)
      	at com.cloudbees.jenkins.plugins.bitbucket.server.client.BitbucketServerAPIClient.getDefaultBranch(BitbucketServerAPIClient.java:342)
      	... 8 more
      [Tue Jul 18 11:04:30 EDT 2017] Finished branch indexing. Indexing took 67 ms
      FATAL: Failed to recompute children of repo-2
      java.io.IOException: I/O error when accessing URL: /rest/api/1.0/projects/PROJECT_1/repos/repo-2/branches/default
      	at com.cloudbees.jenkins.plugins.bitbucket.server.client.BitbucketServerAPIClient.getDefaultBranch(BitbucketServerAPIClient.java:345)
      	at com.cloudbees.jenkins.plugins.bitbucket.BitbucketSCMSource.retrieveActions(BitbucketSCMSource.java:967)
      	at jenkins.scm.api.SCMSource.fetchActions(SCMSource.java:746)
      	at jenkins.branch.MultiBranchProject.computeChildren(MultiBranchProject.java:587)
      	at com.cloudbees.hudson.plugins.folder.computed.ComputedFolder.updateChildren(ComputedFolder.java:266)
      	at com.cloudbees.hudson.plugins.folder.computed.FolderComputation.run(FolderComputation.java:162)
      	at jenkins.branch.MultiBranchProject$BranchIndexing.run(MultiBranchProject.java:969)
      	at hudson.model.ResourceController.execute(ResourceController.java:98)
      	at hudson.model.Executor.run(Executor.java:410)
      Caused by: java.io.FileNotFoundException: URL: /rest/api/1.0/projects/PROJECT_1/repos/repo-2/branches/default
      	at com.cloudbees.jenkins.plugins.bitbucket.server.client.BitbucketServerAPIClient.getRequest(BitbucketServerAPIClient.java:508)
      	at com.cloudbees.jenkins.plugins.bitbucket.server.client.BitbucketServerAPIClient.getDefaultBranch(BitbucketServerAPIClient.java:342)
      	... 8 more
      Finished: FAILURE
      

            jamesdumay James Dumay
            jamesdumay James Dumay
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: