[JIRA] (JENKINS-57683) ClassCastException in git plugin on GitHub branch scan

18 views
Skip to first unread message

mark.earl.waite@gmail.com (JIRA)

unread,
May 25, 2019, 7:01:02 PM5/25/19
to jenkinsc...@googlegroups.com
Mark Waite updated an issue
 
Jenkins / Bug JENKINS-57683
ClassCastException in git plugin on GitHub branch scan
Change By: Mark Waite
Summary: ClassCastException in git plugin on GitHub Branch Source scanning repository branch scan
Add Comment Add Comment
 
This message was sent by Atlassian Jira (v7.11.2#711002-sha1:fdc329d)

mark.earl.waite@gmail.com (JIRA)

unread,
May 25, 2019, 8:17:03 PM5/25/19
to jenkinsc...@googlegroups.com
Mark Waite updated an issue
Git plugin 4.0 pre-release reports a class cast exception when scanning in a multibranch pipeline definition for the hello-world-plugin.

The stack trace is:

{noformat}
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
{noformat}

Job definition is included as  [^config.xml]

The code that is throwing that exception was added in git plugin commit [089a6ec|https://github.com/jenkinsci/git-plugin/pull/696/commits/089a6ecf41c5a928dc78ecfc1024ad2029955afe] as part of [pull request 696|https://github.com/jenkinsci/git-plugin/pull/696].  I suspect that more logic is needed in [this line|https://github.com/jenkinsci/git-plugin/pull/696/commits/089a6ecf41c5a928dc78ecfc1024ad2029955afe#diff-8dfe27475624ffa72985974b8348bffdR54] to check that the passed in SCMSourceContext is a GitSCMSourceContext before setting the pruneRefs value.

The job requires credentials and is part of a Docker image definition that I use for testing.  I can share temporary access to that repository with one or two others if necessary.

The failure does not seem to be related to the GitHub Branch Source plugin.

mark.earl.waite@gmail.com (JIRA)

unread,
May 25, 2019, 11:42:02 PM5/25/19
to jenkinsc...@googlegroups.com
Mark Waite started work on Bug JENKINS-57683
 
Change By: Mark Waite
Status: Open In Progress

mark.earl.waite@gmail.com (JIRA)

unread,
May 25, 2019, 11:43:04 PM5/25/19
to jenkinsc...@googlegroups.com

mark.earl.waite@gmail.com (JIRA)

unread,
May 26, 2019, 8:20:01 PM5/26/19
to jenkinsc...@googlegroups.com
 

Was only a problem in unreleased versions of the git plugin. Will be fixed in the next pre-release of git plugin 4.0, likely named 4.0.0-beta11.

Change By: Mark Waite
Status: In Review Resolved
Resolution: Fixed

mark.earl.waite@gmail.com (JIRA)

unread,
May 28, 2019, 3:13:42 PM5/28/19
to jenkinsc...@googlegroups.com
Mark Waite closed an issue as Fixed
Change By: Mark Waite
Status: Resolved Closed

mark.earl.waite@gmail.com (JIRA)

unread,
Jul 5, 2019, 7:46:11 PM7/5/19
to jenkinsc...@googlegroups.com

mark.earl.waite@gmail.com (JIRA)

unread,
Jul 5, 2019, 7:46:11 PM7/5/19
to jenkinsc...@googlegroups.com
 

Fixed in Git plugin 4.0.0-beta10 released July 5, 2019

Change By: Mark Waite
Status: Closed Fixed but Unreleased

mark.earl.waite@gmail.com (JIRA)

unread,
Oct 20, 2019, 2:37:10 PM10/20/19
to jenkinsc...@googlegroups.com
This message was sent by Atlassian Jira (v7.13.6#713006-sha1:cc4451f)
Atlassian logo

mark.earl.waite@gmail.com (JIRA)

unread,
Nov 2, 2019, 8:48:04 AM11/2/19
to jenkinsc...@googlegroups.com
 

Included in git plugin 4.0.0 released Nov 2, 2019

Change By: Mark Waite
Status: Fixed but Unreleased Closed
Reply all
Reply to author
Forward
0 new messages