Jenkins war update caused issue when Ruby runtime plugin is installed

Initially got this error :

Error
AWT is not properly configured on this server. 
Perhaps you need to run your container with "-Djava.awt.headless=true"? 
See also: https://www.jenkins.io/redirect/troubleshooting/java.awt.headless

Fixed it using this : * sudo apt install fontconfig

Post this am getting the below error :

Help is appreciated

java.lang.NoClassDefFoundError: org/jruby/javasupport/proxy/InternalJavaProxy
at org.jenkinsci.jruby.JRubyMapper.serializedClass(JRubyMapper.java:20)
at hudson.util.xstream.MapperDelegate.serializedClass(MapperDelegate.java:41)
at com.thoughtworks.xstream.mapper.MapperWrapper.serializedClass(MapperWrapper.java:121)
at com.thoughtworks.xstream.core.TreeMarshaller.start(TreeMarshaller.java:82)
at com.thoughtworks.xstream.core.AbstractTreeMarshallingStrategy.marshal(AbstractTreeMarshallingStrategy.java:37)
at com.thoughtworks.xstream.XStream.marshal(XStream.java:1266)
at com.thoughtworks.xstream.XStream.marshal(XStream.java:1255)
at com.thoughtworks.xstream.XStream.toXML(XStream.java:1228)
at hudson.XmlFile.write(XmlFile.java:213)
at jenkins.model.Jenkins.save(Jenkins.java:3545)
at jenkins.model.Jenkins.(Jenkins.java:1005)
at hudson.model.Hudson.(Hudson.java:86)
at hudson.model.Hudson.(Hudson.java:82)
at hudson.WebAppMain$3.run(WebAppMain.java:247)
Caused: hudson.util.HudsonFailedToLoad
at hudson.WebAppMain$3.run(WebAppMain.java:261)

There may be deprecated plugins installed on your system that need to be removed.

The Jenkins project stopped distributing the Ruby runtime plugin, the Python runtime plugin, and plugins that depend on those two plugins in January 2022. You can find a detailed list of plugins and more information in the blog post:

1 Like

Thanks for pointing it out .

I had disabled ruby and python plugins and now am getting this error , while loading .

Restarted Jenkins, upgraded to Aug 2nd WAR file , still no luck .

A problem occurred while processing the request.

Logging ID=31aef4a2-31d8-430b-9fb6-c3f5fd008c50

That ID is written to the Jenkins log file with a stack trace. Read the Jenkins log to see if it guides you on your next step.

I assume that disabling the deprecated plugins is enough, but ultimately you’ll want to remove them completely. They are no longer usable.

The ruby runtime plugin does not support Java 11 at all. Jenkins weekly already requires Java 11 as its minimum Java version. Jenkins LTS 2.361.1 in September 2022 will require Java 11 as its minimum Java version.

Deprecating non-Java plugins has the full list of plugins you should remove.

The 2.361.1 version is unable to start in my setup due to the same exception as mentioned on beginning of this post:

java.lang.NoClassDefFoundError: org/jruby/javasupport/proxy/InternalJavaProxy
...
Caused: hudson.util.HudsonFailedToLoad
	at hudson.WebAppMain$3.run(WebAppMain.java:261)

I went through the list of Deprecating non-Java plugins mentioned by @halkeye above, but don’t have any of them.

Exported all our plugins via script (got from here):

def plugins = jenkins.model.Jenkins.instance.getPluginManager().getPlugins()
plugins.each {
    println "${it.getShortName()} (${it.getVersion()}) => ${it.getDependencies()}"
}

and tried to search for ruby… but nothing. What else can I do to find out which plugin has to be removed? Would appreciate if Jenkins could be bit more verbose to tell what’s wrong. Any help appreciated. Thx!

what is the full version of java are you using? (java -version)

Java version:

openjdk 11.0.16 2022-07-19
OpenJDK Runtime Environment (build 11.0.16+8-post-Debian-1deb11u1)
OpenJDK 64-Bit Server VM (build 11.0.16+8-post-Debian-1deb11u1, mixed mode, sharing)

List of jenkins plugins: jenkins plugin list - Pastebin.com

Can you show an ls of JENKINS_HOME/plugins?

It is unfortunate that the list of plugins you uploaded is not usable for anyone who wants to attempt to duplicate your configuration. Could you upload the plugin list again based on the system groovy script from “How to report an issue”? That provides the list in a format that others can use to assist.

Looking at the list of plugins you provided, it appears you’re not following the instructions in the upgrade guides. Specifically, the 2.277.1 upgrade guide recommends that you remove deprecated plugins and plugins with known security vulnerabilities.

Plugins to remove because they have known security issues

Plugins to remove because they are deprecated

  • analysis-core - superseded by warnings-ng
  • warnings - superseded by warnings-ng

Plugins to remove because you’re not using them

  • translation plugin - are you actually submitting local language translations to the Jenkins project? Probably not. Remove it
  • chucknorris
  • createjobadvanced

Plugins you should consider removing due to their age

Unknown plugins (remove in case they are the cause of the problem)

  • asqatasun
  • sitespeed
  • seleniumhq
  • hudson-jirareporter-plugin
  • hudson-apiv2-plugin
2 Likes

Thx @MarkEWaite ! I’ve removed all the plugins you’ve mentioned, but guess the one which caused my issues wasn’t listed in my previous posts:

The ruby-runtime was there! Got listed when I was searching for hudson-apiv2-plugin, then started to dig around… Solved it by removing $JENKINS_HOME/plugins/ruby-runtime*. Can do now the update to 2.361.1.

Thx for all the support, appreciate it!

3 Likes

Thank you very much Peter ! You just saved me: I had the same issue, and removing $JENKINS_HOME/plugins/ruby-runtime* solved my problem too.

2 Likes

Hi, removing ruby plugin solved the problem, login page is now coming up.
But ruby plugin is required for gitlab hook plugin. How can we make that work,
I am using jdk 11 and want to upgrade Jenkins.
Appreciate your help.

@ahuh @phamrak

1 Like

You can’t make the GitLab hook plugin or any other plugin that requires the Ruby runtime work on a Jenkins controller running Java 11. However, there are much better solutions that the GitLab hook plugin to connect Jenkins controllers to GitLab.

Alternatives include:

Those plugins are much better maintained that the GitLab hook plugin and offer a much better user experience.

2 Likes

@MarkEWaite Thanks a lot for your reply !!