timja / jenkins-gh-issues-poc-06-18

0 stars 0 forks source link

[JENKINS-21158] Loading of non-describable extensions with missing optional dependencies leads toWarnings inside Jenkins log #10882

Open timja opened 10 years ago

timja commented 10 years ago

// This issue has been originally created by Per Arnold Blaasmo for RoleMacro extensions in Ownership plugin.

Seems that ClassicPluginStrategy improperly searches for extensions, which use optional dependencies of plugin. It leads to warnings inside plugin loading procedures.

Reproduction steps:

Analysis results:

Class loading stack trace:

ClassLoaderReflectionToolkit.findClass:44
PluginManager$UberClassLoader.findClass:969
ClassLoader.loadClass:423
ClassLoader.loadClass:356
Hidden Source Calls
ExtensionFinder$Sezpoz.scout:666
ClassicPluginStrategy.findComponents:310
....

The log fills up with the following warnings from the ownership plugin:

Dec 27, 2013 11:18:35 AM hudson.ExtensionFinder$Sezpoz scout
WARNING: Failed to scout com.synopsys.arc.jenkins.plugins.ownership.security.rolestrategy.CoOwnerRoleMacroNoSid
java.lang.InstantiationException: /storage/hudson-home/plugins/ownership/WEB-INF/lib/classes.jar might need to be rebuilt: java.lang.ClassNotFoundException: com.synopsys.arc.jenkins.plugins.ownership.security.rolestrategy.CoOwnerRoleMacroNoSid
at net.java.sezpoz.IndexItem.element(IndexItem.java:144)
at hudson.ExtensionFinder$Sezpoz.scout(ExtensionFinder.java:666)
at hudson.ClassicPluginStrategy.findComponents(ClassicPluginStrategy.java:310)
at hudson.ExtensionList.load(ExtensionList.java:295)
at hudson.ExtensionList.ensureLoaded(ExtensionList.java:248)
at hudson.ExtensionList.iterator(ExtensionList.java:138)
at hudson.ClassicPluginStrategy.findComponents(ClassicPluginStrategy.java:309)
at hudson.ExtensionList.load(ExtensionList.java:295)
at hudson.ExtensionList.ensureLoaded(ExtensionList.java:248)
at hudson.ExtensionList.getComponents(ExtensionList.java:149)
at hudson.DescriptorExtensionList.load(DescriptorExtensionList.java:182)
at hudson.ExtensionList.ensureLoaded(ExtensionList.java:248)
at hudson.ExtensionList.iterator(ExtensionList.java:138)
at org.jenkinsci.plugins.xunit.AliasInitializer.addAliases(AliasInitializer.java:23)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at hudson.init.TaskMethodFinder.invoke(TaskMethodFinder.java:105)
at hudson.init.TaskMethodFinder$TaskImpl.run(TaskMethodFinder.java:169)
at org.jvnet.hudson.reactor.Reactor.runTask(Reactor.java:282)
at jenkins.model.Jenkins$7.runTask(Jenkins.java:897)
at org.jvnet.hudson.reactor.Reactor$2.run(Reactor.java:210)
at org.jvnet.hudson.reactor.Reactor$Node.run(Reactor.java:117)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:744)
Caused by: java.lang.ClassNotFoundException: com.synopsys.arc.jenkins.plugins.ownership.security.rolestrategy.CoOwnerRoleMacroNoSid
at hudson.PluginManager$UberClassLoader.findClass(PluginManager.java:984)
at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
at net.java.sezpoz.IndexItem.element(IndexItem.java:134)
... 26 more


Originally reported by pablaasmo, imported from: Loading of non-describable extensions with missing optional dependencies leads toWarnings inside Jenkins log
  • status: Open
  • priority: Major
  • resolution: Unresolved
  • imported: 2022/01/10
timja commented 10 years ago

oleg_nenashev:

Hello,

timja commented 10 years ago

pablaasmo:

Jenkins: 1.544
Ownership plugin: 0.3.1
Role-stratgy plugin: do not use it

timja commented 10 years ago

oleg_nenashev:

Have you seen the issue before the update to 1.544?
I test the plugin on 1.509.3, 1.509.4 and 1.532.1, so there can be issues in "Latest and Sometimes Stable" versions.

The issue is quite similar to JENKINS-17425, but it requires some investigation.

timja commented 10 years ago

pablaasmo:

I am not sure which version of Jenkins it started to appear?
But I think it was before 1.544. I think it might have been a couple of versions before.
I will try to see if I can dig out some more info.

timja commented 10 years ago

oleg_nenashev:

I confirm the issue. It appears when role-strategy plugin is not installed.
All classes in the log implement RoleMacro extension from this plugin. This dependency is optional, so class loading issues should be a normal case.

I'll check changes in PluginManager classes and the re-assign the issue to Jenkins Core

timja commented 10 years ago

oleg_nenashev:

I've updated the issue's description and re-assigned it to the Jenkins core.
Hopefully, somebody will continue its analysis.

timja commented 2 years ago

[Originally related to: JENKINS-17425]