We see an interesting behavior with the node config.xml with latest LTS Jenkins version in combination with Java17 and Java21.
In short:
The config.xml of a node gets corrupted after saving the configurations if a specific path is followed (see repro steps).
Repro steps:
Jenkins running with Java 17 (or even 21) version.
1.) Connect node to Jenkins
1.1) -> config.xml still fine
2.) Set node temporarily offline in Jenkins UI (no cause provided = null)
2.1) -> config.xml still fine
3.) In terminal cut / disconnect node (kill java connection)
3.1) -> config.xml still fine (in node UI overview has changed to "agent broken connection")
4.) Open node configuration and just press save. Save works, but throws an exception in the system log. The file is now corrupted.
4.1) -> config.xml file of node is corrupted.
Checkt config.xml path: <jenkins_url>/computer/<node>/config.xml
Corrupted config.xml of node:
<?xml version="1.1" encoding="UTF-8"?> <slave> <temporaryOfflineCause class=" hudson.slaves.OfflineCause$ChannelTermination "> <timestamp>1732105207072</timestamp> <cause class="java.nio.channels.ClosedChannelException"
non-valid xml format in this case. (Not more is saved to the file).
Exception in Jenkins System Log:
Unable to complete save, temporary offline status will not be persisted: java.lang.RuntimeException: Failed to serialize hudson.model.Node#temporaryOfflineCause for class hudson.slaves.DumbSlave
Exception:
java.lang.reflect.InaccessibleObjectException: Unable to make field private static final long java.nio.channels.ClosedChannelException.serialVersionUID accessible: module java.base does not "opens java.nio.channels" to unnamed module @28194a50 ... (full exception to long to enter here)
Works still fine with Java11. But since enforcement of Java 17 from the latest LTS version, we run into this problem.