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

Unable to update agent config Description

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Minor Minor
    • ec2-plugin
    • Jenkins/Controller is on Amazon Linux 2023.
      Agent/Slave is on Amazon Linux 2.
      Jenkins v2.467
      Amazon EC2 Plugin v1688.v8c07e01d657f

      Agent is created via the "Amazon EC2 Plugin".
      After the agent is up and running, navigate to the node in Jenkins UI:
      https://XXX/computer/YYY/configure
      And enter a new "Description". Save.

      UI shows the "Opps. A problem occurred while processing the request" error.
      Note, in the JSON that is being sent, the "Uptime" parameter key is an empty string. i.e. this bit taken from the full log below:

        "ec2Type": "On Demand",
        "": [
          "3 days 0 hr",
          "0"
        ],
        "publicDNS": "ZZZ.us-west-2.compute.amazonaws.com",

      Full log is attached (too long).  Here is the first bit...

      2024-08-19 13:46:04.831+0000 [id=645501]        WARNING o.e.j.s.h.ContextHandler$Context#log: Error while serving https://XXX/computer/YYY/configSubmit
      org.kohsuke.stapler.NoStaplerConstructorException: There's no @DataBoundConstructor on any constructor of class java.lang.Boolean
              at org.kohsuke.stapler.ClassDescriptor.loadConstructorParamNames(ClassDescriptor.java:291)
              at org.kohsuke.stapler.RequestImpl.instantiate(RequestImpl.java:950)
              at org.kohsuke.stapler.RequestImpl$TypePair.convertJSON(RequestImpl.java:841)
      Caused: java.lang.IllegalArgumentException: Failed to instantiate class java.lang.Boolean from {"metadataEndpointEnabled":true,"metadataTokensRequired":true,"metadataHopsLimit":"3"}
              at org.kohsuke.stapler.RequestImpl$TypePair.convertJSON(RequestImpl.java:845)
              at org.kohsuke.stapler.RequestImpl.bindJSON(RequestImpl.java:604)
              at org.kohsuke.stapler.RequestImpl.instantiate(RequestImpl.java:963)
      Caused: java.lang.IllegalArgumentException: Failed to convert the metadataSupported parameter of the constructor public hudson.plugins.ec2.EC2OndemandSlave(java.lang.String,java.lang.String,java.lang.String,java.lang.String,int,java.lang.String,hudson.model.Node$Mode,java.lang.String,java.lang.String,java.util.List,java.lang.String,java.lang.String,java.lang.String,boolean,java.lang.String,java.lang.String,java.lang.String,java.util.List,java.lang.String,int,hudson.plugins.ec2.AMITypeData,hudson.plugins.ec2.ConnectionStrategy,int,hudson.plugins.ec2.Tenancy,java.lang.Boolean,java.lang.Boolean,java.lang.Integer,java.lang.Boolean) throws hudson.model.Descriptor$FormException,java.io.IOException
              at org.kohsuke.stapler.RequestImpl.instantiate(RequestImpl.java:965)
              at org.kohsuke.stapler.RequestImpl$TypePair.convertJSON(RequestImpl.java:841)
      Caused: java.lang.IllegalArgumentException: Failed to instantiate class hudson.plugins.ec2.EC2OndemandSlave from {"name":"EC2 (vdm.qa.auto-node-static) - vdm.qa.auto-node-static (i-00ae1b2c81dbc5637)","spotInstanceRequestId":"","cloudName":"vdm.qa.auto-node-static","templateDescription":"vdm.qa.auto-node-static","instanceId":"i-00ae1b2c81dbc5637","ec2Type":"On Demand","":["3 days 0 hr","0"],"publicDNS":"ZZZ.us-west-2.compute.amazonaws.com","privateDNS":"172.19.106.55","nodeDescription":"hello","numExecutors":"1","labelString":"vdm.qa.auto-node-static","mode":"EXCLUSIVE","initScript":"#!/bin/sh\n#get public ip\npublic_ip=$(curl https://ipinfo.io/ip)\n#change hostname\nhost_name=a$(echo ${public_ip} | sed 's/\\.//g')\necho \"${host_name}.vdmdev.com\" > /etc/hostname\nhostname -F /etc/hostname\n#modify /etc/hosts\necho \"127.0.0.1 ${host_name}.vdmdev.com\" >> /etc/hosts\necho \"172.19.106.45 XXX\" >> /etc/hosts\nsudo yum -y install java-17-amazon-corretto\nunlink /etc/alternatives/java\nln -vs /usr/lib/jvm/java-1.8.0-amazon-corretto/bin/java /etc/alternatives/java","remoteFS":"/home/jenkins","remoteAdmin":"jenkins","stopOnTerminate":false,"idleTerminationMinutes":"60","tags":[\{"name":"jenkins_server_url","value":"https://XXX/"},\{"name":"Name","value":"VDM_QA_AUTO_NODE"},\{"name":"jenkins_slave_type","value":"demand_vdm.qa.auto-node-static"}],"usePrivateDnsName":false,"tenancy":"Default","amiType":{"rootCommandPrefix":"sudo","slaveCommandPrefix":"","slaveCommandSuffix":"","sshPort":"22","bootDelay":"","stapler-class":"hudson.plugins.ec2.UnixData","$class":"hudson.plugins.ec2.UnixData"},"maxTotalUses":"-1","nodeProperties":{"stapler-class-bag":"true"},"metadataSupported":{"metadataEndpointEnabled":true,"metadataTokensRequired":true,"metadataHopsLimit":"3"},"Submit":"","Jenkins-Crumb":"f254e1a74f30fe7089e4c82edbeb46d323353c106feddafe6b91a3fe48c36e5f"}
              at org.kohsuke.stapler.RequestImpl$TypePair.convertJSON(RequestImpl.java:845)
              at org.kohsuke.stapler.RequestImpl.bindJSON(RequestImpl.java:604)
              at org.kohsuke.stapler.RequestImpl.bindJSON(RequestImpl.java:599)
              at hudson.model.Descriptor.bindJSON(Descriptor.java:624)
              at hudson.model.Descriptor.newInstance(Descriptor.java:594)

      Note also that we are able to update the description via groovy without issue. i.e. this sort of thing works fine:

      def aSlave = hudson.model.Hudson.instance.getNode(nodename)
      aSlave.setNodeDescription('hello');

            thoulen FABRIZIO MANFREDI
            sasquatch451 Andrew McElroy
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: