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

No enum constant hudson.plugins.ec2.ConnectionStrategy.Private IP

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major Major
    • ec2-plugin
    • None
    • Jenkins v2.204.6
      ec2-plugin: v1.50.3

      After saving a config with ec2 cloud instances configured, if I close the configuration page, go back, and try to make changes I get

      java.lang.IllegalArgumentException: No enum constant hudson.plugins.ec2.ConnectionStrategy.Private IP
      at java.base/java.lang.Enum.valueOf(Enum.java:240)
      at org.kohsuke.stapler.RequestImpl$TypePair.convertJSON(RequestImpl.java:733)
      at org.kohsuke.stapler.RequestImpl.bindJSON(RequestImpl.java:478)
      at org.kohsuke.stapler.RequestImpl.instantiate(RequestImpl.java:778)
      Caused: java.lang.IllegalArgumentException: Failed to convert the connectionStrategy parameter of the constructor public hudson.plugins.ec2.SlaveTemplate(java.lang.String,java.lang.String,hudson.plugins.ec2.SpotConfiguration,java.lang.String,java.lang.String,com.amazonaws.services.ec2.model.InstanceType,boolean,java.lang.String,hudson.model.Node$Mode,java.lang.String,java.lang.String,java.lang.String,java.lang.String,java.lang.String,java.lang.String,hudson.plugins.ec2.AMITypeData,java.lang.String,boolean,java.lang.String,java.util.List,java.lang.String,int,int,java.lang.String,java.lang.String,boolean,boolean,boolean,java.lang.String,boolean,java.lang.String,boolean,boolean,boolean,hudson.plugins.ec2.ConnectionStrategy,int,java.util.List,hudson.plugins.ec2.HostKeyVerificationStrategyEnum)
      at org.kohsuke.stapler.RequestImpl.instantiate(RequestImpl.java:780)
      at org.kohsuke.stapler.RequestImpl.access$200(RequestImpl.java:83)
      at org.kohsuke.stapler.RequestImpl$TypePair.convertJSON(RequestImpl.java:678)
      Caused: java.lang.IllegalArgumentException: Failed to instantiate class hudson.plugins.ec2.SlaveTemplate from {"description"

      ...

      "associatePublicIp":false,"connectionStrategy":"Private IP","connectBySSHProcess":false,"hostKeyVerificationStrategy":"CHECK_NEW_SOFT","maxTotalUses":"100","nodeProperties":{"stapler-class-bag":"true"}}
      at org.kohsuke.stapler.RequestImpl$TypePair.convertJSON(RequestImpl.java:681)

       

      If I delete all of the configs I can recreate them, but I can't edit them once I close out of the configuration page.

       

      what's happening:

      on first submit it's sending the value "PRIVATE_IP", but when it loads the configuration page after the initial save it picks up the value "Private IP" which it can't translate back to PRIVATE_IP.

       

      same thing happens with https://github.com/jenkinsci/ec2-plugin/blob/master/src/main/java/hudson/plugins/ec2/HostKeyVerificationStrategyEnum.java

       

      looking at https://github.com/jenkinsci/ec2-plugin/blob/da14631cc9406d8d5dae5dd25ecfe5d642b86679/src/main/resources/hudson/plugins/ec2/SlaveTemplate/config.jelly#L192 it looks like it needs to be updated to match something more like https://github.com/svanoort/workflow-multibranch-plugin/blob/66d5b9be3bec7fac6daed71e90217a8da868ba5a/src/main/resources/org/jenkinsci/plugins/workflow/multibranch/DurabilityHintBranchProperty/config.jelly

            thoulen FABRIZIO MANFREDI
            randomvoids Kyle L
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: