Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-76018

Creating a new node (not from a copy) causes an invalid XML tag value

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Minor Minor
    • None
    • Jenkins v2.492.3
      Job Config History plugin v1352.va_201a_8389340
    • 1356.ve360da_6c523a_

      After upgrading this plugin from v1305.vf20a_356586b_8 to v1352.va_201a_8389340, there is a problem with the config.xml file created when a new (original) node is created (not from copying an existing node).

      The node config looks something like this:

      <?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="ssh-slaves@3.1071.v0d059c7b_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>
      

      The resulting node will work, if all of the config is correct.  However, you cannot edit that node config, attempting to save edits to that config cause this error:

      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"}
      

      The root cause is this part of the config.XML file:

        <nodeProperties>
          <null/>
        </nodeProperties>
      

      That part should simply be:

        <nodeProperties/>
      

      I have tested this on multiple Jenkins controllers, and all of the ones with v.1352.va_201a_8389340 of the plugin have this problem. Those that are reverted to v.1305.vf20a_356586b_8 work fine, where the XML looks like the last/simplest snippet above.

            mawinter69 Markus Winter
            jtuttle James
            Votes:
            1 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: