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

Error when building SCMFileSystem when using BitbucketSCMSource

    XMLWordPrintable

    Details

    • Similar Issues:

      Description

      When the ignore committer strategy plugin is enabled in a Bitbucket Team/Project and a new build is triggered through a hook, the following error is seen in the Jenkins log (with Git plugin v3.9.1):
      Jun 27, 2018 9:15:28 AM SEVERE au.com.versent.jenkins.plugins.ignoreCommitterStrategy.IgnoreCommitterStrategy isAutomaticBuild
      Error retrieving SCMFileSystem

       

      For reference, with Git plugin v3.6.4 an exception seen was:
      Jun 26, 2018 5:11:21 PM SEVERE au.com.versent.jenkins.plugins.ignoreCommitterStrategy.IgnoreCommitterStrategy isAutomaticBuild
      Exception java.lang.ClassCastException: com.cloudbees.jenkins.plugins.bitbucket.BitbucketSCMSource cannot be cast to jenkins.plugins.git.AbstractGitSCMSource at jenkins.plugins.git.GitSCMFileSystem$BuilderImpl.build(GitSCMFileSystem.java:366) at au.com.versent.jenkins.plugins.ignoreCommitterStrategy.IgnoreCommitterStrategy.isAutomaticBuild(IgnoreCommitterStrategy.java:91) at jenkins.branch.BranchBuildStrategy.automaticBuild(BranchBuildStrategy.java:130) at jenkins.branch.MultiBranchProject.isAutomaticBuild(MultiBranchProject.java:2231) at jenkins.branch.MultiBranchProject.access$1200(MultiBranchProject.java:125) at jenkins.branch.MultiBranchProject$SCMHeadObserverImpl.observe(MultiBranchProject.java:2184) at jenkins.scm.api.SCMHeadObserver$Wrapped.observe(SCMHeadObserver.java:638) at jenkins.scm.api.SCMHeadEvent$Validated.observe(SCMHeadEvent.java:296) at jenkins.scm.api.trait.SCMSourceRequest.process(SCMSourceRequest.java:359) at com.cloudbees.jenkins.plugins.bitbucket.BitbucketSCMSource.retrieveBranches(BitbucketSCMSource.java:762) at com.cloudbees.jenkins.plugins.bitbucket.BitbucketSCMSource.retrieve(BitbucketSCMSource.java:573) at jenkins.scm.api.SCMSource._retrieve(SCMSource.java:357) at jenkins.scm.api.SCMSource.fetch(SCMSource.java:311) at jenkins.branch.MultiBranchProject$SCMEventListenerImpl.processHeadCreate(MultiBranchProject.java:1346) at jenkins.branch.MultiBranchProject$SCMEventListenerImpl.onSCMHeadEvent(MultiBranchProject.java:1180) at jenkins.scm.api.SCMHeadEvent$DispatcherImpl.fire(SCMHeadEvent.java:247) at jenkins.scm.api.SCMHeadEvent$DispatcherImpl.fire(SCMHeadEvent.java:230) at jenkins.scm.api.SCMEvent$Dispatcher.run(SCMEvent.java:481) at jenkins.security.ImpersonatingScheduledExecutorService$1.run(ImpersonatingScheduledExecutorService.java:58) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180) at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293) 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)

        Attachments

          Activity

          Hide
          bb3rn4rd Bernard Baltrusaitis added a comment -

          Hi Mark Broadbent, thanks for the ticket and apologise for the long delay. The problem is that Bitbucket is supporting both mercurial and git, and therefore I could not cast an instance of `SCMSource` to git explicitly, however, I  think I found another solution how to build a correct `SCMFileSystem`. The fix is released and available in version 1.0.4. If interested you can get yourself familiar with the change here: https://github.com/jenkinsci/ignore-committer-strategy-plugin/commit/6c358b066329a59ede2f725092fa3936ea62246d#diff-5745fd8aa809a6f56235ef23f769fcffR92

          Show
          bb3rn4rd Bernard Baltrusaitis added a comment - Hi Mark Broadbent , thanks for the ticket and apologise for the long delay. The problem is that Bitbucket is supporting both mercurial and git, and therefore I could not cast an instance of `SCMSource` to git explicitly, however, I  think I found another solution how to build a correct `SCMFileSystem`. The fix is released and available in version 1.0.4.  If interested you can get yourself familiar with the change here:  https://github.com/jenkinsci/ignore-committer-strategy-plugin/commit/6c358b066329a59ede2f725092fa3936ea62246d#diff-5745fd8aa809a6f56235ef23f769fcffR92
          Hide
          mark_broadbent Mark Broadbent added a comment -

          Thank you for providing a fix to the problem, I can confirm that with v1.0.4 to plugin works as expected.

          Show
          mark_broadbent Mark Broadbent added a comment - Thank you for providing a fix to the problem, I can confirm that with v1.0.4 to plugin works as expected.

            People

            Assignee:
            bb3rn4rd Bernard Baltrusaitis
            Reporter:
            mark_broadbent Mark Broadbent
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: