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

Org Scan blows up when repository has no tags

    Details

    • Similar Issues:
    • Released As:
      2.4.2

      Description

      Given a GitHub Organization Folder that has the "Discover Tags" behavior; the scan blows up on every repository that doesn't have any tags.

      In our case, it caused a couple of repositories to lose all their build history.

      Proposing robot
      15:26:19 Connecting to https://github.example.com/api/v3 using ghenkins/****** (DO NOT USE)
      Examining example/robot
      
        Checking branches...
      
        Getting remote branches...
      
          Checking branch master
      
        Getting remote pull requests...
            'Jenkinsfile' not found
          Does not meet criteria
      
          Checking branch travis
            'Jenkinsfile' not found
          Does not meet criteria
      
        2 branches were processed
      
        Checking pull-requests...
      
        0 pull requests were processed
      
        Checking tags...
      
        Getting remote tags...
      ERROR: Failed to create or update a subproject robot
      org.kohsuke.github.GHException: Failed to retrieve https://github.example.com/api/v3/repos/example/robot/git/refs/tags
      	at org.kohsuke.github.Requester$PagingIterator.fetch(Requester.java:521)
      	at org.kohsuke.github.Requester$PagingIterator.hasNext(Requester.java:486)
      	at org.kohsuke.github.PagedIterator.fetch(PagedIterator.java:44)
      	at org.kohsuke.github.PagedIterator.hasNext(PagedIterator.java:32)
      	at org.jenkinsci.plugins.github_branch_source.GitHubSCMSource$LazyTags$1$1.hasNext(GitHubSCMSource.java:2178)
      	at org.jenkinsci.plugins.github_branch_source.GitHubSCMSource.retrieve(GitHubSCMSource.java:987)
      	at jenkins.scm.api.SCMSource._retrieve(SCMSource.java:357)
      	at jenkins.scm.api.SCMSource.fetch(SCMSource.java:311)
      	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 org.jenkinsci.plugins.github_branch_source.GitHubSCMNavigator.visitSources(GitHubSCMNavigator.java:964)
      	at jenkins.branch.OrganizationFolder.computeChildren(OrganizationFolder.java:458)
      	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:97)
      	at hudson.model.Executor.run(Executor.java:429)
      

      Workaround: Add at least one tag to all your repositories.

        Attachments

          Activity

          Hide
          varditn Vardit Natanson added a comment -

          Also experiencing the same behaviour. 

          We have Jenkins version 2.12.1 .

          Show
          varditn Vardit Natanson added a comment - Also experiencing the same behaviour.  We have Jenkins version 2.12.1 .
          Hide
          fferguson6 Fred Ferguson added a comment - - edited

          Same on

          Jenkins version: 2.131
          Github_Branch_Source Plugin version: 2.3.5 & 2.3.6

           

          Workaround of adding a single tag confirmed to work

          Show
          fferguson6 Fred Ferguson added a comment - - edited Same on Jenkins version: 2.131 Github_Branch_Source Plugin version: 2.3.5 & 2.3.6   Workaround of adding a single tag confirmed to work
          Hide
          lifeofguenter Gunter Grodotzki added a comment -

          I am also getting the error on projects that have tags?

            Getting remote tags...
          ERROR: [Fri Nov 16 00:49:03 UTC 2018] Could not fetch branches from source org.jenkinsci.plugins.github_branch_source.GitHubSCMNavigator::https://api.github.com::foobar::chef-wrapper-ntp
          org.kohsuke.github.GHException: Failed to retrieve https://api.github.com/repos/foobar/chef-wrapper-ntp/git/refs/tags
          	at org.kohsuke.github.Requester$PagingIterator.fetch(Requester.java:521)
          	at org.kohsuke.github.Requester$PagingIterator.hasNext(Requester.java:486)
          	at org.kohsuke.github.PagedIterator.fetch(PagedIterator.java:44)
          	at org.kohsuke.github.PagedIterator.hasNext(PagedIterator.java:32)
          	at org.jenkinsci.plugins.github_branch_source.GitHubSCMSource$LazyTags$1$1.hasNext(GitHubSCMSource.java:2222)
          	at org.jenkinsci.plugins.github_branch_source.GitHubSCMSource.retrieve(GitHubSCMSource.java:1016)
          	at jenkins.scm.api.SCMSource._retrieve(SCMSource.java:374)
          	at jenkins.scm.api.SCMSource.fetch(SCMSource.java:284)
          	at jenkins.branch.MultiBranchProject.computeChildren(MultiBranchProject.java:633)
          	at com.cloudbees.hudson.plugins.folder.computed.ComputedFolder.updateChildren(ComputedFolder.java:277)
          	at com.cloudbees.hudson.plugins.folder.computed.FolderComputation.run(FolderComputation.java:165)
          	at jenkins.branch.MultiBranchProject$BranchIndexing.run(MultiBranchProject.java:1024)
          	at hudson.model.ResourceController.execute(ResourceController.java:97)
          	at hudson.model.Executor.run(Executor.java:429)
          [Fri Nov 16 00:49:03 UTC 2018] Finished branch indexing. Indexing took 2.3 sec
          FATAL: Failed to recompute children of foobar » chef-wrapper-ntp
          org.kohsuke.github.GHException: Failed to retrieve https://api.github.com/repos/foobar/chef-wrapper-ntp/git/refs/tags
          	at org.kohsuke.github.Requester$PagingIterator.fetch(Requester.java:521)
          	at org.kohsuke.github.Requester$PagingIterator.hasNext(Requester.java:486)
          	at org.kohsuke.github.PagedIterator.fetch(PagedIterator.java:44)
          	at org.kohsuke.github.PagedIterator.hasNext(PagedIterator.java:32)
          	at org.jenkinsci.plugins.github_branch_source.GitHubSCMSource$LazyTags$1$1.hasNext(GitHubSCMSource.java:2222)
          	at org.jenkinsci.plugins.github_branch_source.GitHubSCMSource.retrieve(GitHubSCMSource.java:1016)
          	at jenkins.scm.api.SCMSource._retrieve(SCMSource.java:374)
          	at jenkins.scm.api.SCMSource.fetch(SCMSource.java:284)
          	at jenkins.branch.MultiBranchProject.computeChildren(MultiBranchProject.java:633)
          	at com.cloudbees.hudson.plugins.folder.computed.ComputedFolder.updateChildren(ComputedFolder.java:277)
          	at com.cloudbees.hudson.plugins.folder.computed.FolderComputation.run(FolderComputation.java:165)
          	at jenkins.branch.MultiBranchProject$BranchIndexing.run(MultiBranchProject.java:1024)
          	at hudson.model.ResourceController.execute(ResourceController.java:97)
          	at hudson.model.Executor.run(Executor.java:429)
          Finished: FAILURE
          Show
          lifeofguenter Gunter Grodotzki added a comment - I am also getting the error on projects that have tags? Getting remote tags... ERROR: [Fri Nov 16 00:49:03 UTC 2018] Could not fetch branches from source org.jenkinsci.plugins.github_branch_source.GitHubSCMNavigator::https://api.github.com::foobar::chef-wrapper-ntp org.kohsuke.github.GHException: Failed to retrieve https://api.github.com/repos/foobar/chef-wrapper-ntp/git/refs/tags at org.kohsuke.github.Requester$PagingIterator.fetch(Requester.java:521) at org.kohsuke.github.Requester$PagingIterator.hasNext(Requester.java:486) at org.kohsuke.github.PagedIterator.fetch(PagedIterator.java:44) at org.kohsuke.github.PagedIterator.hasNext(PagedIterator.java:32) at org.jenkinsci.plugins.github_branch_source.GitHubSCMSource$LazyTags$1$1.hasNext(GitHubSCMSource.java:2222) at org.jenkinsci.plugins.github_branch_source.GitHubSCMSource.retrieve(GitHubSCMSource.java:1016) at jenkins.scm.api.SCMSource._retrieve(SCMSource.java:374) at jenkins.scm.api.SCMSource.fetch(SCMSource.java:284) at jenkins.branch.MultiBranchProject.computeChildren(MultiBranchProject.java:633) at com.cloudbees.hudson.plugins.folder.computed.ComputedFolder.updateChildren(ComputedFolder.java:277) at com.cloudbees.hudson.plugins.folder.computed.FolderComputation.run(FolderComputation.java:165) at jenkins.branch.MultiBranchProject$BranchIndexing.run(MultiBranchProject.java:1024) at hudson.model.ResourceController.execute(ResourceController.java:97) at hudson.model.Executor.run(Executor.java:429) [Fri Nov 16 00:49:03 UTC 2018] Finished branch indexing. Indexing took 2.3 sec FATAL: Failed to recompute children of foobar » chef-wrapper-ntp org.kohsuke.github.GHException: Failed to retrieve https://api.github.com/repos/foobar/chef-wrapper-ntp/git/refs/tags at org.kohsuke.github.Requester$PagingIterator.fetch(Requester.java:521) at org.kohsuke.github.Requester$PagingIterator.hasNext(Requester.java:486) at org.kohsuke.github.PagedIterator.fetch(PagedIterator.java:44) at org.kohsuke.github.PagedIterator.hasNext(PagedIterator.java:32) at org.jenkinsci.plugins.github_branch_source.GitHubSCMSource$LazyTags$1$1.hasNext(GitHubSCMSource.java:2222) at org.jenkinsci.plugins.github_branch_source.GitHubSCMSource.retrieve(GitHubSCMSource.java:1016) at jenkins.scm.api.SCMSource._retrieve(SCMSource.java:374) at jenkins.scm.api.SCMSource.fetch(SCMSource.java:284) at jenkins.branch.MultiBranchProject.computeChildren(MultiBranchProject.java:633) at com.cloudbees.hudson.plugins.folder.computed.ComputedFolder.updateChildren(ComputedFolder.java:277) at com.cloudbees.hudson.plugins.folder.computed.FolderComputation.run(FolderComputation.java:165) at jenkins.branch.MultiBranchProject$BranchIndexing.run(MultiBranchProject.java:1024) at hudson.model.ResourceController.execute(ResourceController.java:97) at hudson.model.Executor.run(Executor.java:429) Finished: FAILURE
          Show
          stephenconnolly Stephen Connolly added a comment - culprit looks to be https://github.com/kohsuke/github-api/commit/a17ce04552ddd3f6bd8210c740184e6c7ad13ae4 I have asked rsandell to see if he can drive https://github.com/jenkinsci/github-branch-source-plugin/pull/191 over the finish line
          Hide
          swf Yves Schumann added a comment -

          I'm spotting this regardless if there are tags or not, which breaks a lot of stuff right now. 

          We're running Jenkins 2.152 and GitHub-Branch-Source-Plugin 2.4.1.

          Any ideas how to fix or a workaround?

          Show
          swf Yves Schumann added a comment - I'm spotting this regardless if there are tags or not, which breaks a lot of stuff right now.  We're running Jenkins 2.152 and GitHub-Branch-Source-Plugin 2.4.1. Any ideas how to fix or a workaround?
          Show
          stephenconnolly Stephen Connolly added a comment - https://github.com/jenkinsci/github-branch-source-plugin/commit/3079fd6d0609bf0a6387729c0da756ed08abfabc was merged... just waiting on rsandell to cut a release... or you could take the snapshot build from https://ci.jenkins.io/blue/organizations/jenkins/Plugins%2Fgithub-branch-source-plugin/detail/master/82/artifacts
          Hide
          kshultz Karl Shultz added a comment -

          rsandell - does the inclusion of this PR in 2.4.2 mean this bug has been fixed, and the ticket can be closed?

          Show
          kshultz Karl Shultz added a comment - rsandell - does the inclusion of this PR in 2.4.2 mean this bug has been fixed, and the ticket can be closed?
          Hide
          abayer Andrew Bayer added a comment -

          Apparently resolved in GitHub branch source 2.4.2.

          Show
          abayer Andrew Bayer added a comment - Apparently resolved in GitHub branch source 2.4.2.

            People

            • Assignee:
              Unassigned
              Reporter:
              docwhat Christian Höltje
            • Votes:
              6 Vote for this issue
              Watchers:
              16 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: