[JIRA] (JENKINS-57694) BuildChooser logs a missing descriptor message

2 views
Skip to first unread message

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

unread,
May 26, 2019, 10:54:02 PM5/26/19
to jenkinsc...@googlegroups.com
Mark Waite created an issue
 
Jenkins / Bug JENKINS-57694
BuildChooser logs a missing descriptor message
Issue Type: Bug Bug
Assignee: Mark Waite
Components: git-plugin
Created: 2019-05-27 02:53
Environment: Jenkins 2.176.1-rc
Git plugin 4.0 pre-release
Git client 3.0 pre-release
Priority: Minor Minor
Reporter: Mark Waite

The git plugin 4.0 logs the following stack trace:

May 26, 2019 8:50:01 PM hudson.triggers.SCMTrigger$Runner runPolling
SEVERE: Failed to record SCM polling for org.jenkinsci.plugins.workflow.job.WorkflowJob@3e088f1b[Bugs-Pipeline-Checks/jenkins-bugs-multibranch-pipeline-no-localbranch/JENKINS-43468]
java.lang.AssertionError: class jenkins.plugins.git.AbstractGitSCMSource$SpecificRevisionBuildChooser is missing its descriptor
	at jenkins.model.Jenkins.getDescriptorOrDie(Jenkins.java:1541)
	at hudson.plugins.git.util.BuildChooser.getDescriptor(BuildChooser.java:229)
	at hudson.plugins.git.util.BuildChooser.getDisplayName(BuildChooser.java:49)
	at hudson.plugins.git.GitSCM.compareRemoteRevisionWithImpl(GitSCM.java:679)
	at hudson.plugins.git.GitSCM.compareRemoteRevisionWith(GitSCM.java:668)
	at org.jenkinsci.plugins.workflow.job.WorkflowJob.poll(WorkflowJob.java:617)
	at hudson.triggers.SCMTrigger$Runner.runPolling(SCMTrigger.java:603)
	at hudson.triggers.SCMTrigger$Runner.run(SCMTrigger.java:649)
	at hudson.util.SequentialExecutionQueue$QueueEntry.run(SequentialExecutionQueue.java:119)
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
	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)
Add Comment Add Comment
 
This message was sent by Atlassian Jira (v7.11.2#711002-sha1:fdc329d)

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

unread,
Sep 7, 2019, 9:24:02 PM9/7/19
to jenkinsc...@googlegroups.com
Mark Waite updated an issue
Change By: Mark Waite
The git plugin 4.0 logs the following stack trace:

{noformat}

May 26, 2019 8:50:01 PM hudson.triggers.SCMTrigger$Runner runPolling
SEVERE: Failed to record SCM polling for org.jenkinsci.plugins.workflow.job.WorkflowJob@3e088f1b[Bugs-Pipeline-Checks/jenkins-bugs-multibranch-pipeline-no-localbranch/JENKINS-43468]
java.lang.AssertionError: class jenkins.plugins.git.AbstractGitSCMSource$SpecificRevisionBuildChooser is missing its descriptor
at jenkins.model.Jenkins.getDescriptorOrDie(Jenkins.java:1541)
at hudson.plugins.git.util.BuildChooser.getDescriptor(BuildChooser.java:229)
at hudson.plugins.git.util.BuildChooser.getDisplayName(BuildChooser.java:49)
at hudson.plugins.git.GitSCM.compareRemoteRevisionWithImpl(GitSCM.java:679)
at hudson.plugins.git.GitSCM.compareRemoteRevisionWith(GitSCM.java:668)
at org.jenkinsci.plugins.workflow.job.WorkflowJob.poll(WorkflowJob.java:617)
at hudson.triggers.SCMTrigger$Runner.runPolling(SCMTrigger.java:603)
at hudson.triggers.SCMTrigger$Runner.run(SCMTrigger.java:649)
at hudson.util.SequentialExecutionQueue$QueueEntry.run(SequentialExecutionQueue.java:119)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
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)
{noformat}

It also reports:

{noformat}
1) Error injecting constructor, java.lang.IncompatibleClassChangeError: jenkins.plugins.git.AbstractGitSCMSource$SpecificRevisionBuildChooser and jenkins.plugins.git.AbstractGitSCMSource$SpecificRevisionBuildChooser$DescriptorImpl disagree on InnerClasses attribute
  at jenkins.plugins.git.AbstractGitSCMSource$SpecificRevisionBuildChooser$DescriptorImpl.<init>(AbstractGitSCMSource.java:416)

1 error
at com.google.inject.internal.ProviderToInternalFactoryAdapter.get(ProviderToInternalFactoryAdapter.java:52)
at com.google.inject.internal.SingletonScope$1.get(SingletonScope.java:145)
at hudson.ExtensionFinder$GuiceFinder$FaultTolerantScope$1.get(ExtensionFinder.java:432)
at com.google.inject.internal.InternalFactoryToProviderAdapter.get(InternalFactoryToProviderAdapter.java:41)
at com.google.inject.internal.InjectorImpl$2$1.call(InjectorImpl.java:1016)
at com.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.java:1092)
at com.google.inject.internal.InjectorImpl$2.get(InjectorImpl.java:1012)
at hudson.ExtensionFinder$GuiceFinder._find(ExtensionFinder.java:394)
at hudson.ExtensionFinder$GuiceFinder.find(ExtensionFinder.java:385)
at hudson.ClassicPluginStrategy.findComponents(ClassicPluginStrategy.java:493)
at hudson.ExtensionList.load(ExtensionList.java:380)
at hudson.ExtensionList.ensureLoaded(ExtensionList.java:318)
at hudson.ExtensionList.iterator(ExtensionList.java:172)
at jenkins.model.Jenkins.getDescriptorByType(Jenkins.java:1539)
at hudson.plugins.git.GitSCM.onLoaded(GitSCM.java:1873)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at hudson.init.TaskMethodFinder.invoke(TaskMethodFinder.java:104)
at hudson.init.TaskMethodFinder$TaskImpl.run(TaskMethodFinder.java:175)
at org.jvnet.hudson.reactor.Reactor.runTask(Reactor.java:296)
at jenkins.model.Jenkins$5.runTask(Jenkins.java:1083)
at org.jvnet.hudson.reactor.Reactor$2.run(Reactor.java:214)
at org.jvnet.hudson.reactor.Reactor$Node.run(Reactor.java:117)

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

rene.scheibe@gmail.com (JIRA)

unread,
Sep 8, 2019, 7:09:02 AM9/8/19
to jenkinsc...@googlegroups.com
René Scheibe commented on Bug JENKINS-57694
 
Re: BuildChooser logs a missing descriptor message

Hi Mark Waite, can you also provide the exact job setup in the issue description? Otherwise it's very hard to reproduce this. I guess currently it's more a note for yourself.

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

unread,
Sep 8, 2019, 7:19:02 AM9/8/19
to jenkinsc...@googlegroups.com

The Docker image which shows the problem is defined in my docker-lfs repository. Build the lts-with-plugins branch with docker build and run it with docker run

rene.scheibe@gmail.com (JIRA)

unread,
Sep 8, 2019, 7:22:02 AM9/8/19
to jenkinsc...@googlegroups.com

With the current state of the master branch (commit d1d765a5fabb407d6a8dd6264641df3233ac33c3) I ran mvn hpi:run to reproduce this.

I just tried to create a new multi-branch pipeline via "Jenkins" - "New Item" - "multibranch-test" - "Multibranch Pipeline" - "OK" and got this:

Sep 08, 2019 1:14:17 PM hudson.ExpressionFactory2$JexlExpression evaluate
WARNING: Caught exception evaluating: h.filterDescriptors(it,attrs.descriptors) in /jenkins/job/multibranch-test/configure. Reason: java.lang.NullPointerException: Descriptor list is null for context 'class org.jenkinsci.plugins.workflow.multibranch.WorkflowMultiBranchProject' in thread 'Handling GET /jenkins/job/multibranch-test/configure from 127.0.0.1 : qtp2091047140-1088 AbstractFolder/configure.jelly FolderLibraries/DescriptorImpl/config.jelly LibraryConfiguration/config.jelly SCMRetriever/DescriptorImpl/config.jelly MultiSCM/DescriptorImpl/config.jelly'
java.lang.NullPointerException: Descriptor list is null for context 'class org.jenkinsci.plugins.workflow.multibranch.WorkflowMultiBranchProject' in thread 'Handling GET /jenkins/job/multibranch-test/configure from 127.0.0.1 : qtp2091047140-1088 AbstractFolder/configure.jelly FolderLibraries/DescriptorImpl/config.jelly LibraryConfiguration/config.jelly SCMRetriever/DescriptorImpl/config.jelly MultiSCM/DescriptorImpl/config.jelly'
	at hudson.model.DescriptorVisibilityFilter.apply(DescriptorVisibilityFilter.java:73)
	at hudson.Functions.filterDescriptors(Functions.java:1888)
        ... 

Are you aware of this and can reproduce it?

rene.scheibe@gmail.com (JIRA)

unread,
Sep 8, 2019, 7:34:02 AM9/8/19
to jenkinsc...@googlegroups.com
René Scheibe edited a comment on Bug JENKINS-57694
With the current state of the master branch (commit d1d765a5fabb407d6a8dd6264641df3233ac33c3) I ran {{mvn hpi:run}} to reproduce this.

I just tried to create a new multi-branch pipeline via "Jenkins" - "New Item" - "multibranch-test" - "Multibranch Pipeline" - "OK" and got this:
{code:java}

Sep 08, 2019 1:14:17 PM hudson.ExpressionFactory2$JexlExpression evaluate
WARNING: Caught exception evaluating: h.filterDescriptors(it,attrs.descriptors) in /jenkins/job/multibranch-test/configure. Reason: java.lang.NullPointerException: Descriptor list is null for context 'class org.jenkinsci.plugins.workflow.multibranch.WorkflowMultiBranchProject' in thread 'Handling GET /jenkins/job/multibranch-test/configure from 127.0.0.1 : qtp2091047140-1088 AbstractFolder/configure.jelly FolderLibraries/DescriptorImpl/config.jelly LibraryConfiguration/config.jelly SCMRetriever/DescriptorImpl/config.jelly MultiSCM/DescriptorImpl/config.jelly'
java.lang.NullPointerException: Descriptor list is null for context 'class org.jenkinsci.plugins.workflow.multibranch.WorkflowMultiBranchProject' in thread 'Handling GET /jenkins/job/multibranch-test/configure from 127.0.0.1 : qtp2091047140-1088 AbstractFolder/configure.jelly FolderLibraries/DescriptorImpl/config.jelly LibraryConfiguration/config.jelly SCMRetriever/DescriptorImpl/config.jelly MultiSCM/DescriptorImpl/config.jelly'
at hudson.model.DescriptorVisibilityFilter.apply(DescriptorVisibilityFilter.java:73)
at hudson.Functions.filterDescriptors(Functions.java:1888)
        ... {code}
Are you aware of this and can reproduce it?
This seems to be reported in ENKINS-47494 already.

rene.scheibe@gmail.com (JIRA)

unread,
Sep 8, 2019, 7:35:04 AM9/8/19
to jenkinsc...@googlegroups.com
Are you aware of this and can reproduce it? This seems to be reported in ENKINS JENKINS -47494 already.

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

unread,
Sep 8, 2019, 7:37:01 AM9/8/19
to jenkinsc...@googlegroups.com
Mark Waite edited a comment on Bug JENKINS-57694
The second message in the report (java.lang.IncompatibleClassChangeError) is generated when I run the git plugin unit tests.  It does not cause any test to fail, but it is very suspicious to me that there is something wrong that I haven't yet understood.

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

unread,
Sep 8, 2019, 7:37:02 AM9/8/19
to jenkinsc...@googlegroups.com

The second message in the report is generated when I run the git plugin unit tests. It does not cause any test to fail, but it is very suspicious to me that there is something wrong that I haven't yet understood.

rene.scheibe@gmail.com (JIRA)

unread,
Sep 8, 2019, 7:44:02 AM9/8/19
to jenkinsc...@googlegroups.com
René Scheibe edited a comment on Bug JENKINS-57694
With the current state of the master branch (commit d1d765a5fabb407d6a8dd6264641df3233ac33c3) I ran {{mvn hpi:run}} to reproduce this.

I just tried to create a new multi-branch pipeline via "Jenkins" - "New Item" - "multibranch-test" - "Multibranch Pipeline" - "OK" and got this:
{code:java}
Sep 08, 2019 1:14:17 PM hudson.ExpressionFactory2$JexlExpression evaluate
WARNING: Caught exception evaluating: h.filterDescriptors(it,attrs.descriptors) in /jenkins/job/multibranch-test/configure. Reason: java.lang.NullPointerException: Descriptor list is null for context 'class org.jenkinsci.plugins.workflow.multibranch.WorkflowMultiBranchProject' in thread 'Handling GET /jenkins/job/multibranch-test/configure from 127.0.0.1 : qtp2091047140-1088 AbstractFolder/configure.jelly FolderLibraries/DescriptorImpl/config.jelly LibraryConfiguration/config.jelly SCMRetriever/DescriptorImpl/config.jelly MultiSCM/DescriptorImpl/config.jelly'
java.lang.NullPointerException: Descriptor list is null for context 'class org.jenkinsci.plugins.workflow.multibranch.WorkflowMultiBranchProject' in thread 'Handling GET /jenkins/job/multibranch-test/configure from 127.0.0.1 : qtp2091047140-1088 AbstractFolder/configure.jelly FolderLibraries/DescriptorImpl/config.jelly LibraryConfiguration/config.jelly SCMRetriever/DescriptorImpl/config.jelly MultiSCM/DescriptorImpl/config.jelly'
at hudson.model.DescriptorVisibilityFilter.apply(DescriptorVisibilityFilter.java:73)
at hudson.Functions.filterDescriptors(Functions.java:1888)
        ... {code}
Are you aware of this and can reproduce it? This seems to be reported in JENKINS-47494 already.

That's confusing a bit. It does not occur anymore when I temporarily remove the {{multiple-scms}} test dependency from pom.xml. Ok, so that's understood.

rene.scheibe@gmail.com (JIRA)

unread,
Sep 8, 2019, 4:44:02 PM9/8/19
to jenkinsc...@googlegroups.com

For the IncompatibleClassChangeError issue I have a fix. I linked the respective pull request.

rene.scheibe@gmail.com (JIRA)

unread,
Sep 10, 2019, 5:53:03 PM9/10/19
to jenkinsc...@googlegroups.com

Hi Mark Waite I performed an analysis regarding the first message you reported:

java.lang.AssertionError: class jenkins.plugins.git.AbstractGitSCMSource$SpecificRevisionBuildChooser is missing its descriptor

 

I think it's failing after pull request #709 from Jesse Glick. In there the Descriptor was removed for obvious reasons.

The call chain is as follows:

call 1: https://github.com/jenkinsci/git-plugin/blob/git-4.0.0-beta10/src/main/java/hudson/plugins/git/GitSCM.java#L679

listener.getLogger().println("Using strategy: " + getBuildChooser().getDisplayName()); 

call 2: https://github.com/jenkinsci/git-plugin/blob/git-4.0.0-beta10/src/main/java/hudson/plugins/git/util/BuildChooser.java#L49

public final String getDescriptorOrDie() {
    return getDescriptor().getDisplayName();
} 

call 3: https://github.com/jenkinsci/git-plugin/blob/git-4.0.0-beta10/src/main/java/hudson/plugins/git/util/BuildChooser.java#L229

public BuildChooserDescriptor getDescriptor() {
    return (BuildChooserDescriptor)Jenkins.getInstance().getDescriptorOrDie(getClass()); <--- FAILING HERE: getDescriptorOrDie(...)
} 

 

One quick option to fix this could be to overwrite BuildChooser#getDisplayName (requires to make it non-final) in SpecificRevisionBuildChooser directly. I guess there are better ones but I am not so much into this code.

Mark Waite and Jesse Glick what are you thoughts on this?

This message was sent by Atlassian Jira (v7.13.6#713006-sha1:cc4451f)
Atlassian logo

rene.scheibe@gmail.com (JIRA)

unread,
Sep 10, 2019, 5:56:04 PM9/10/19
to jenkinsc...@googlegroups.com
René Scheibe edited a comment on Bug JENKINS-57694
Hi [~markewaite] , I performed an analysis regarding the first message you reported:
{code:java}
java.lang.AssertionError: class jenkins.plugins.git.AbstractGitSCMSource$SpecificRevisionBuildChooser is missing its descriptor{code}
 

I think it's failing after pull request [#709|https://github.com/jenkinsci/git-plugin/pull/709] from [~jglick]. In there the {{Descriptor}} was removed for obvious reasons.


The call chain is as follows:

call 1: [https://github.com/jenkinsci/git-plugin/blob/git-4.0.0-beta10/src/main/java/hudson/plugins/git/GitSCM.java#L679]
{code:java}
listener.getLogger().println("Using strategy: " + getBuildChooser().getDisplayName()); {code}
call 2: [https://github.com/jenkinsci/git-plugin/blob/git-4.0.0-beta10/src/main/java/hudson/plugins/git/util/BuildChooser.java#L49]
{code:java}
public final String
getDescriptorOrDie getDisplayName () {
    return getDescriptor().getDisplayName();
} {code}
call 3: [https://github.com/jenkinsci/git-plugin/blob/git-4.0.0-beta10/src/main/java/hudson/plugins/git/util/BuildChooser.java#L229]
{code:java}

public BuildChooserDescriptor getDescriptor() {
    return (BuildChooserDescriptor)Jenkins.getInstance().getDescriptorOrDie(getClass()); <--- FAILING HERE: getDescriptorOrDie(...)
} {code}
 

One quick option to fix this could be to overwrite {{BuildChooser#getDisplayName}} (requires to make it non-{{final}}) in {{SpecificRevisionBuildChooser}} directly. I guess there are better ones but I am not so much into this code.

[~markewaite] and [~jglick] what are you thoughts on this?

jglick@cloudbees.com (JIRA)

unread,
Sep 10, 2019, 6:15:03 PM9/10/19
to jenkinsc...@googlegroups.com

One fix:

public final String getDisplayName() {
    Descriptor<?> d = Jenkins.get().getDescriptor(getClass());
    return d != null ? d.getDisplayName() : getClass().getSimpleName();
}

Or override getDescriptor in the ones which have no statically registered instance. Or just deprecate BuildChooser.getDisplayName and always print the class name; a build log is not really the right place for localized text anyway.

rene.scheibe@gmail.com (JIRA)

unread,
Sep 12, 2019, 4:14:02 PM9/12/19
to jenkinsc...@googlegroups.com

What about adding the Descriptor again with isApplicable(...) always returning false? So it's not selectable in the UI but provides the counterpart to the Describable. I have add a draft pull request https://github.com/jenkinsci/git-plugin/pull/760 for it.

rene.scheibe@gmail.com (JIRA)

unread,
Sep 12, 2019, 4:16:02 PM9/12/19
to jenkinsc...@googlegroups.com
René Scheibe edited a comment on Bug JENKINS-57694
What about adding the {{Descriptor}} again with {{isApplicable(...)}} always returning {{false}}? So it's not selectable in the UI but provides the counterpart to the {{Describable}}. I have add added a draft pull request [https://github.com/jenkinsci/git-plugin/pull/760] for it.

jglick@cloudbees.com (JIRA)

unread,
Sep 12, 2019, 4:20:04 PM9/12/19
to jenkinsc...@googlegroups.com

Better to use one of the other fixes, I think. isApplicable should be checked in the config GUI, but may not block the descriptor from appearing elsewhere, such as Pipeline Syntax.

rene.scheibe@gmail.com (JIRA)

unread,
Sep 12, 2019, 4:43:01 PM9/12/19
to jenkinsc...@googlegroups.com

Ok, thanks for the feedback.

I'll follow your suggestion to adapt getDisplayName() as you have a better overview of the complete code base.

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

unread,
Sep 13, 2019, 3:13:02 PM9/13/19
to jenkinsc...@googlegroups.com
Mark Waite assigned an issue to Unassigned
 
Change By: Mark Waite
Assignee: Mark Waite

rene.scheibe@gmail.com (JIRA)

unread,
Sep 15, 2019, 11:45:03 AM9/15/19
to jenkinsc...@googlegroups.com

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

unread,
Sep 15, 2019, 11:48:03 AM9/15/19
to jenkinsc...@googlegroups.com

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

unread,
Sep 15, 2019, 11:48:04 AM9/15/19
to jenkinsc...@googlegroups.com
Mark Waite resolved as Fixed
 

Merged to master branch for delivery after git plugin 4.0.0-beta11

Change By: Mark Waite
Status: Open Resolved
Resolution: Fixed

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