We have multiple Jenkins controllers for different products. One 2 of those controllers, a new behaviour has emerged. When I create a new node through the GUI (using the "Permanent Node" option, not copying an existing node), I can get the new node to work. It connects properly, everything looks good in the GUI.
But, when I go to edit the config, I get an error like:
A problem occurred while processing the request, Logging ID=f10cac89-d3a5-47fd-9598-cf08f6b39ba0
Here is the detail from the Jenkins log:
Caught unhandled exception with ID f10cac89-d3a5-47fd-9598-cf08f6b39ba0
java.lang.NullPointerException: Cannot invoke "hudson.model.Describable.getDescriptor()" because "t" is null
at hudson.util.DescribableList.get(DescribableList.java:134)
at hudson.util.DescribableList.rebuild(DescribableList.java:175)
at hudson.model.Node$1.onConvert(Node.java:590)
at hudson.model.Descriptor$NewInstanceBindInterceptor.onConvert(Descriptor.java:740)
at org.kohsuke.stapler.RequestImpl$TypePair.convertJSON(RequestImpl.java:777)
at org.kohsuke.stapler.RequestImpl.bindJSON(RequestImpl.java:620)
at org.kohsuke.stapler.RequestImpl.injectSetters(RequestImpl.java:1046)
at org.kohsuke.stapler.RequestImpl.instantiate(RequestImpl.java:990)
at org.kohsuke.stapler.RequestImpl$TypePair.convertJSON(RequestImpl.java:861)
at org.kohsuke.stapler.RequestImpl.bindJSON(RequestImpl.java:620)
at org.kohsuke.stapler.RequestImpl.bindJSON(RequestImpl.java:615)
at hudson.model.Descriptor.bindJSON(Descriptor.java:662)
at hudson.model.Descriptor.newInstanceImpl(Descriptor.java:620)
Caused: java.lang.LinkageError: Failed to instantiate class hudson.slaves.DumbSlave from {"name":"renbe-dev-tuttlj-leap15a","nodeDescription":"Hi","":["Hi","hudson.plugins.sshslaves.SSHLauncher","0"],"numExecutors":"1","remoteFS":"/home/jenkins/a","labelString":"","mode":"EXCLUSIVE","launcher":{"oldCommand":"","stapler-class":"hudson.plugins.sshslaves.SSHLauncher","$class":"hudson.plugins.sshslaves.SSHLauncher","host":"tuttlj-leap15.domain.com","includeUser":"false","credentialsId":"jenkins-node-ssh","":"2","sshHostKeyVerificationStrategy":{"requireInitialManualTrust":false,"stapler-class":"hudson.plugins.sshslaves.verifiers.ManuallyTrustedKeyVerificationStrategy","$class":"hudson.plugins.sshslaves.verifiers.ManuallyTrustedKeyVerificationStrategy"},"port":"22","javaPath":"","jvmOptions":"","prefixStartSlaveCmd":"","suffixStartSlaveCmd":"","launchTimeoutSeconds":"60","maxNumRetries":"10","retryWaitTime":"15","tcpNoDelay":true,"workDir":""},"retentionStrategy":{"stapler-class":"hudson.slaves.RetentionStrategy$Always","$class":"hudson.slaves.RetentionStrategy$Always"},"nodeProperties":{"stapler-class-bag":"true","hudson-plugins-jobConfigHistory-NodeLocalConfiguration":{"changeReasonComment":""}},"Submit":"","core:apply":"","Jenkins-Crumb":"ed71f273b79d021e6edc77f7e46e1c5b0b89e0bbdf844fb2e62975c9e21a7aba"}
I eventually looked at the node's config file in ~jenkins/nodes:
<?xml version='1.1' encoding='UTF-8'?>
<slave>
<name>renbe-dev-tuttlj-leap15a</name>
<description></description>
<remoteFS>/home/jenkins/a</remoteFS>
<numExecutors>1</numExecutors>
<mode>EXCLUSIVE</mode>
<retentionStrategy class="hudson.slaves.RetentionStrategy$Always"/>
<launcher class="hudson.plugins.sshslaves.SSHLauncher" plugin="[email protected]_c555">
<host>tuttlj-leap15.domain.com</host>
<port>22</port>
<credentialsId>jenkins-node-ssh</credentialsId>
<launchTimeoutSeconds>60</launchTimeoutSeconds>
<maxNumRetries>10</maxNumRetries>
<retryWaitTime>15</retryWaitTime>
<sshHostKeyVerificationStrategy class="hudson.plugins.sshslaves.verifiers.ManuallyTrustedKeyVerificationStrategy">
<requireInitialManualTrust>false</requireInitialManualTrust>
</sshHostKeyVerificationStrategy>
<tcpNoDelay>true</tcpNoDelay>
</launcher>
<label></label>
<nodeProperties>
<null/>
</nodeProperties>
If I create a new node through the filesystem with a similar XML but changing the tag to simply:
<nodeProperties/>
then the node works.
Something is causing that "null" value in the nodeProperties which is OK on node creation but is not OK when editing the config later.
This is happening on 2 Jenkins controllers with similar but not identical plugins, but is not happening on a 3rd controller which has vastly different plugins. All 3 are running Jenkins v2.492.3 so I don't believe it's a Jenkins controller issue, I think it has to be a plugin issue, but I don't know which one would cause the illegal null in the XML.
The answer https://stackoverflow.com/a/76389838/13563 to a similar error report tells me that others have run into this, but it doesn't provide a solution.