| GitHub Branch Source plugin 2.5.3 reports a class cast exception when scanning in a multibranch pipeline definition for the hello-world-plugin. The stack trace is:
Started by user Mark Waite
[Sat May 25 13:03:00 MDT 2019] Starting branch indexing...
13:03:00 Connecting to https://api.github.com using MarkEWaite/****** (MarkEWaite github username/password)
Examining MarkEWaite/hello-world-plugin
ERROR: [Sat May 25 13:03:01 MDT 2019] Could not fetch branches from source 8b33b746-db40-4839-901f-d94e4a4f3148
java.lang.ClassCastException: org.jenkinsci.plugins.github_branch_source.GitHubSCMSourceContext cannot be cast to jenkins.plugins.git.GitSCMSourceContext
at jenkins.plugins.git.traits.PruneStaleBranchTrait.decorateContext(PruneStaleBranchTrait.java:54)
at jenkins.scm.api.trait.SCMSourceTrait.applyToContext(SCMSourceTrait.java:53)
at jenkins.scm.api.trait.SCMSourceContext.withTrait(SCMSourceContext.java:221)
at jenkins.scm.api.trait.SCMSourceContext.withTraits(SCMSourceContext.java:246)
at org.jenkinsci.plugins.github_branch_source.GitHubSCMSource.retrieve(GitHubSCMSource.java:888)
at jenkins.scm.api.SCMSource._retrieve(SCMSource.java:373)
at jenkins.scm.api.SCMSource.fetch(SCMSource.java:283)
at jenkins.branch.MultiBranchProject.computeChildren(MultiBranchProject.java:634)
at com.cloudbees.hudson.plugins.folder.computed.ComputedFolder.updateChildren(ComputedFolder.java:277)
at com.cloudbees.hudson.plugins.folder.computed.FolderComputation.run(FolderComputation.java:164)
at jenkins.branch.MultiBranchProject$BranchIndexing.run(MultiBranchProject.java:1025)
at hudson.model.ResourceController.execute(ResourceController.java:97)
at hudson.model.Executor.run(Executor.java:429)
[Sat May 25 13:03:01 MDT 2019] Finished branch indexing. Indexing took 0.36 sec
FATAL: Failed to recompute children of Hello World Plugin Folder » hello world pipeline (GitHub)
java.lang.ClassCastException: org.jenkinsci.plugins.github_branch_source.GitHubSCMSourceContext cannot be cast to jenkins.plugins.git.GitSCMSourceContext
at jenkins.plugins.git.traits.PruneStaleBranchTrait.decorateContext(PruneStaleBranchTrait.java:54)
at jenkins.scm.api.trait.SCMSourceTrait.applyToContext(SCMSourceTrait.java:53)
at jenkins.scm.api.trait.SCMSourceContext.withTrait(SCMSourceContext.java:221)
at jenkins.scm.api.trait.SCMSourceContext.withTraits(SCMSourceContext.java:246)
at org.jenkinsci.plugins.github_branch_source.GitHubSCMSource.retrieve(GitHubSCMSource.java:888)
at jenkins.scm.api.SCMSource._retrieve(SCMSource.java:373)
at jenkins.scm.api.SCMSource.fetch(SCMSource.java:283)
at jenkins.branch.MultiBranchProject.computeChildren(MultiBranchProject.java:634)
at com.cloudbees.hudson.plugins.folder.computed.ComputedFolder.updateChildren(ComputedFolder.java:277)
at com.cloudbees.hudson.plugins.folder.computed.FolderComputation.run(FolderComputation.java:164)
at jenkins.branch.MultiBranchProject$BranchIndexing.run(MultiBranchProject.java:1025)
at hudson.model.ResourceController.execute(ResourceController.java:97)
at hudson.model.Executor.run(Executor.java:429)
Finished: FAILURE
Job definition is included as config.xml I'm reasonably confident this was working correctly before I upgraded to GitHub Branch Source Plugin 2.5.3, but it may not have been checked for several weeks. Thus, it could have been broken by an earlier change, not specific to 2.5.3. |