Jenkins upgrade from 2.346.3 to 2.361.1

After upgrading our Jenkins instance from 2.346.3 to 2.361.1 LTS we are seeing some errors on startup resulting in Jenkins failing to load.

First and foremost we have some old plugins installed, but disabled - so we see warnings/errors for these:

2022-09-22 16:05:07.209+0000 [id=33]    INFO    ruby.RubyRuntimePlugin#start: Injecting JRuby into XStream
2022-09-22 16:05:07.477+0000 [id=33]    WARNING jenkins.model.Jenkins$5#runTask: Loading plugin ruby-runtime v0.12 (ruby-runtime) failed perhaps due to plugin dependency issues
java.lang.RuntimeException: unsupported Java version: 11
        at org.jruby.RubyInstanceConfig.initGlobalJavaVersion(RubyInstanceConfig.java:1674)
        at org.jruby.RubyInstanceConfig.<clinit>(RubyInstanceConfig.java:1387)
Caused: java.lang.ExceptionInInitializerError
        at org.jruby.embed.internal.AbstractLocalContextProvider.<init>(AbstractLocalContextProvider.java:42)
        at org.jruby.embed.internal.SingleThreadLocalContextProvider.<init>(SingleThreadLocalContextProvider.java:43)
        at org.jruby.embed.ScriptingContainer.getProviderInstance(ScriptingContainer.java:242)
        at org.jruby.embed.ScriptingContainer.<init>(ScriptingContainer.java:226)
        at org.jruby.embed.ScriptingContainer.<init>(ScriptingContainer.java:192)
        at org.kohsuke.stapler.jelly.jruby.JRubyFacet.<init>(JRubyFacet.java:65)
        at ruby.RubyRuntimePlugin.registerJRubyFacet(RubyRuntimePlugin.java:39)
        at ruby.RubyRuntimePlugin.start(RubyRuntimePlugin.java:30)
        at hudson.ClassicPluginStrategy.startPlugin(ClassicPluginStrategy.java:417)
        at hudson.ClassicPluginStrategy.load(ClassicPluginStrategy.java:406)
Caused: java.io.IOException: Failed to initialize
        at hudson.ClassicPluginStrategy.load(ClassicPluginStrategy.java:409)
        at hudson.PluginManager$2$1$1.run(PluginManager.java:544)
        at org.jvnet.hudson.reactor.TaskGraphBuilder$TaskImpl.run(TaskGraphBuilder.java:175)
        at org.jvnet.hudson.reactor.Reactor.runTask(Reactor.java:305)
        at jenkins.model.Jenkins$5.runTask(Jenkins.java:1160)
        at org.jvnet.hudson.reactor.Reactor$2.run(Reactor.java:222)
        at org.jvnet.hudson.reactor.Reactor$Node.run(Reactor.java:121)
        at jenkins.security.ImpersonatingExecutorService$1.run(ImpersonatingExecutorService.java:70)
        at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
        at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
        at java.base/java.lang.Thread.run(Unknown Source)
2022-09-22 16:05:07.558+0000 [id=29]    SEVERE  jenkins.InitReactorRunner$1#onTaskFailed: Failed Loading plugin pyenv plugin v0.0.7 (pyenv)
java.io.IOException: Failed to load: pyenv plugin (pyenv 0.0.7)
 - Plugin is missing: ruby-runtime (0.10)
        at hudson.PluginWrapper.resolvePluginDependencies(PluginWrapper.java:994)
        at hudson.PluginManager$2$1$1.run(PluginManager.java:543)
        at org.jvnet.hudson.reactor.TaskGraphBuilder$TaskImpl.run(TaskGraphBuilder.java:175)
        at org.jvnet.hudson.reactor.Reactor.runTask(Reactor.java:305)
        at jenkins.model.Jenkins$5.runTask(Jenkins.java:1160)
        at org.jvnet.hudson.reactor.Reactor$2.run(Reactor.java:222)
        at org.jvnet.hudson.reactor.Reactor$Node.run(Reactor.java:121)
        at jenkins.security.ImpersonatingExecutorService$1.run(ImpersonatingExecutorService.java:70)
        at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
        at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
        at java.base/java.lang.Thread.run(Unknown Source)

Whilst these are disabled - they were installed by engineers before me, hence I don’t know whether they are plugins in their own right, or simply dependencies of other plugins, but in either case they are disabled so I don’t believe they would cause us an issue in starting Jenkins.

The error I think we can pertain to the failure to start is as follows:

2022-09-22 16:05:28.620+0000 [id=23]    SEVERE  hudson.util.BootFailure#publish: Failed to initialize Jenkins
java.lang.ClassCastException: class java.lang.Integer cannot be cast to class hudson.slaves.NodeProperty (java.lang.Integer is in module java.base of loader 'bootstrap'; hudson.slaves.NodeProperty is in unnamed module of loader org.eclipse.jetty.webapp.WebAppClassLoader @6bb75258)
        at hudson.model.Node.getNodeProperty(Node.java:496)
        at org.jenkinsci.plugins.matrixauth.AmbiguityMonitor$NodeContributor.record(AmbiguityMonitor.java:135)
        at java.base/java.util.ArrayList.forEach(Unknown Source)
        at org.jenkinsci.plugins.matrixauth.AmbiguityMonitor.recordAgents(AmbiguityMonitor.java:269)
Caused: java.lang.reflect.InvocationTargetException
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
        at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
        at java.base/java.lang.reflect.Method.invoke(Unknown Source)
        at hudson.init.TaskMethodFinder.invoke(TaskMethodFinder.java:109)
Caused: java.lang.Error
        at hudson.init.TaskMethodFinder.invoke(TaskMethodFinder.java:115)
        at hudson.init.TaskMethodFinder$TaskImpl.run(TaskMethodFinder.java:185)
        at org.jvnet.hudson.reactor.Reactor.runTask(Reactor.java:305)
        at jenkins.model.Jenkins$5.runTask(Jenkins.java:1160)
        at org.jvnet.hudson.reactor.Reactor$2.run(Reactor.java:222)
        at org.jvnet.hudson.reactor.Reactor$Node.run(Reactor.java:121)
        at jenkins.security.ImpersonatingExecutorService$1.run(ImpersonatingExecutorService.java:70)
        at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
        at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
        at java.base/java.lang.Thread.run(Unknown Source)
Caused: org.jvnet.hudson.reactor.ReactorException
        at org.jvnet.hudson.reactor.Reactor.execute(Reactor.java:291)
        at jenkins.InitReactorRunner.run(InitReactorRunner.java:49)
        at jenkins.model.Jenkins.executeReactor(Jenkins.java:1195)
        at jenkins.model.Jenkins.<init>(Jenkins.java:985)
        at hudson.model.Hudson.<init>(Hudson.java:86)
        at hudson.model.Hudson.<init>(Hudson.java:82)
        at hudson.WebAppMain$3.run(WebAppMain.java:247)
Caused: hudson.util.HudsonFailedToLoad
        at hudson.WebAppMain$3.run(WebAppMain.java:264)

I would be grateful for any assistance since I cannot find any other occurrences of this error on stackoverflow, google or in the Jenkins community and therefore I do not know what it means or where to look for a fix.

TIA!

the jruby based plugins have long since been abandoned, and we eventually removed support for them in core. I’m actually impressed you managed to get that far into loading htem.

Looks like a bug, with a work around (edit your config.xml). Not sure why its only failing now though, maybe some legacy code was finally removed.

1 Like

Thanks for the comment - I removed the plugins in the end, didn’t bother with the xml change - this seemed to do the trick.