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

Config as Code plugin throws exception when trying to read spotBlockReservationDurationStr from EC2 agent when spot instance enabled.

    Details

    • Type: Bug
    • Status: Fixed but Unreleased (View Workflow)
    • Priority: Minor
    • Resolution: Fixed
    • Labels:
      None
    • Environment:
      Jenkins docker container
      Jenkins Version: 2.189
      Config as Code Version: 1.27
      EC2-Plugin Version: 1.45
    • Similar Issues:

      Description

      When I generate the Jenkins JSON instead of geting the 'spotConfig' subsection I get. This only happens when I enable the spot instance config on a given Agent. This happens with both Linux and Windows agent types.
      This happens both when I enable the 'Set bid price' tick box and when I leave it disabled.
      This happens if the 'Spot Block Reservation Duration' is set or unset.
      Spot Block Reservation Duration

      Repo steps:

      • Install both plugins.
      • Setup an EC2 Agent.
      • Enable 'Use Spot Instance' tick box
      • Add a 'Spot Block Reservation Duration' (I have used 0 and 1 values, both show the issue).

      Exception:

      FAILED TO EXPORT
      hudson.plugins.ec2.SlaveTemplate#spotConfig: io.jenkins.plugins.casc.ConfiguratorException: Can't read attribute 'spotBlockReservationDurationStr' from hudson.plugins.ec2.SpotConfiguration@290b6a
      at io.jenkins.plugins.casc.Attribute._getValue(Attribute.java:392)
      at io.jenkins.plugins.casc.Attribute.getValue(Attribute.java:214)
      at io.jenkins.plugins.casc.impl.configurators.DataBoundConfigurator.describe(DataBoundConfigurator.java:283)
      at io.jenkins.plugins.casc.Attribute._describe(Attribute.java:260)
      at io.jenkins.plugins.casc.Attribute.describe(Attribute.java:239)
      at io.jenkins.plugins.casc.impl.configurators.DataBoundConfigurator.describe(DataBoundConfigurator.java:309)
      at io.jenkins.plugins.casc.Attribute._describe(Attribute.java:260)
      at io.jenkins.plugins.casc.Attribute.describe(Attribute.java:235)
      at io.jenkins.plugins.casc.impl.configurators.DataBoundConfigurator.describe(DataBoundConfigurator.java:309)
      at io.jenkins.plugins.casc.impl.configurators.HeteroDescribableConfigurator.lambda$convertToNode$de0cd4f8$1(HeteroDescribableConfigurator.java:283)
      at io.vavr.CheckedFunction0.lambda$unchecked$52349c75$1(CheckedFunction0.java:201)
      at io.jenkins.plugins.casc.impl.configurators.HeteroDescribableConfigurator.convertToNode(HeteroDescribableConfigurator.java:283)
      at io.jenkins.plugins.casc.impl.configurators.HeteroDescribableConfigurator.lambda$describe$5(HeteroDescribableConfigurator.java:107)
      at io.vavr.control.Option.map(Option.java:373)
      at io.jenkins.plugins.casc.impl.configurators.HeteroDescribableConfigurator.describe(HeteroDescribableConfigurator.java:107)
      at io.jenkins.plugins.casc.impl.configurators.HeteroDescribableConfigurator.describe(HeteroDescribableConfigurator.java:55)
      at io.jenkins.plugins.casc.Attribute._describe(Attribute.java:260)
      at io.jenkins.plugins.casc.Attribute.describe(Attribute.java:235)
      at io.jenkins.plugins.casc.Configurator.describe(Configurator.java:161)

        Attachments

          Activity

          Hide
          casz Joseph Petersen (old) added a comment -

          Such issues are better reported to the plugin your trying to configure

          Show
          casz Joseph Petersen (old) added a comment - Such issues are better reported to the plugin your trying to configure
          Hide
          multani Jonathan Ballet added a comment -
          Show
          multani Jonathan Ballet added a comment - https://github.com/jenkinsci/ec2-plugin/pull/443 should have fixed that issue.

            People

            • Assignee:
              thoulen FABRIZIO MANFREDI
              Reporter:
              canuck1987 Tim Brown
            • Votes:
              1 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: