[JIRA] (JENKINS-57683) ClassCastException in GitHub Branch Source scanning repository

10 views
Skip to first unread message

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

unread,
May 25, 2019, 3:12:03 PM5/25/19
to jenkinsc...@googlegroups.com
Mark Waite created an issue
 
Jenkins / Bug JENKINS-57683
ClassCastException in GitHub Branch Source scanning repository
Issue Type: Bug Bug
Assignee: Unassigned
Attachments: config.xml
Components: github-branch-source-plugin
Created: 2019-05-25 19:11
Environment: Jenkins 2.176.1 LTS release candidate
GitHub Branch Source Plugin 2.5.3
Git plugin 4.0 pre-release
Git client plugin 3.0 pre-release
Priority: Minor Minor
Reporter: Mark Waite

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.

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, 3:13:02 PM5/25/19
to jenkinsc...@googlegroups.com
Mark Waite updated an issue
Change By: Mark Waite
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:

{noformat}
{noformat}

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.


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.

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

unread,
May 25, 2019, 3:51:02 PM5/25/19
to jenkinsc...@googlegroups.com


As far as I can tell, the same problem is also visible in GitHub Branch Source 2.5.1 and 2.5.2.

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

unread,
May 25, 2019, 3:52:02 PM5/25/19
to jenkinsc...@googlegroups.com

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

unread,
May 25, 2019, 4:29:02 PM5/25/19
to jenkinsc...@googlegroups.com
Mark Waite updated an issue
Change By: Mark Waite
Component/s: git-plugin
Component/s: github-branch-source-plugin

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

unread,
May 25, 2019, 4:30:02 PM5/25/19
to jenkinsc...@googlegroups.com
Mark Waite assigned an issue to Mark Waite
Change By: Mark Waite
Assignee: Liam Newman Mark Waite

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

unread,
May 25, 2019, 4:42:03 PM5/25/19
to jenkinsc...@googlegroups.com
Mark Waite updated an issue
GitHub Branch Source Git plugin 2 4 . 5.3 0 pre-release reports a class cast exception when scanning in a multibranch pipeline definition for the hello-world-plugin.
I'm reasonably confident this The code that is throwing that exception was working correctly before I upgraded to GitHub Branch Source Plugin 2 added in [089a6ec|https://github . 5 com/jenkinsci/git-plugin/pull/696/commits/089a6ecf41c5a928dc78ecfc1024ad2029955afe] as part of [pull request 696|https://github . 3, but it may not have been checked for several weeks com/jenkinsci/git-plugin/pull/696] .   Thus, it could have been broken by an earlier change, not specific   I suspect that more logic is needed in [this line|https://github.com/jenkinsci/git-plugin/pull/696/commits/089a6ecf41c5a928dc78ecfc1024ad2029955afe#diff-8dfe27475624ffa72985974b8348bffdR54] to 2 check that the passed in SCMSourceContext is a GitSCMSourceContext before setting the pruneRefs value . 5.3.

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.

As far as I can tell, The failure does not seem to be related to the same problem is also visible in GitHub Branch Source 2 plugin . 5.1 and 2.5.2.

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

unread,
May 25, 2019, 4:45:02 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 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.
Reply all
Reply to author
Forward
0 new messages