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

EC2 plugin 1.37 fails to provision previously defined slaves

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Minor Minor
    • ec2-plugin
    • Jenkins 2.73.1, EC2 Plugin 1.37

      With the EC2 plugin version 1.37, existing stopped instances are not started again during provisioning with the following message in the Jenkins log when the instance cap is reached:

      Cannot provision - no capacity for instances: -1

      reverting to version 1.36 fixes the issue.

          [JENKINS-47130] EC2 plugin 1.37 fails to provision previously defined slaves

          Ken Rachynski added a comment -

          I just ran into this issue myself after weeks of avoiding upgrading to 1.37 (I forgot today). I went to recreate my cloud and things got messy real fast so I just changed one item (in my case switching from T2Large to T2Micro) and saved the configuration. This was enough to allow the plugin to start my agents up successfully.

          Ken Rachynski added a comment - I just ran into this issue myself after weeks of avoiding upgrading to 1.37 (I forgot today). I went to recreate my cloud and things got messy real fast so I just changed one item (in my case switching from T2Large to T2Micro) and saved the configuration. This was enough to allow the plugin to start my agents up successfully.

          Vishal K added a comment -

          krachynski, thanks for info. That trick worked for me as well.

          Vishal K added a comment - krachynski , thanks for info. That trick worked for me as well.

          Francis Upton added a comment -

          It's a bug in 1.37 that things don't work when there is an upgrade. I need to reproduce this so I can see what went into 1.37 to break this.

          Francis Upton added a comment - It's a bug in 1.37 that things don't work when there is an upgrade. I need to reproduce this so I can see what went into 1.37 to break this.

          Ken Rachynski added a comment -

          I failed to record my configuration before I made that change so I'm not sure what the plugin writes on save that fixes it.

           

          Ken Rachynski added a comment - I failed to record my configuration before I made that change so I'm not sure what the plugin writes on save that fixes it.  

          David Li added a comment -

          Same is with 1.38

          David Li added a comment - Same is with 1.38

          Ken Rachynski added a comment -

          Further comment. I have a failing agent right now because the 'root command prefix' which I attempted to set as 'sudo' is not being saved in the configuration. It rather looks like I need to uninstall the entire thing and start over now.

          Ken Rachynski added a comment - Further comment. I have a failing agent right now because the 'root command prefix' which I attempted to set as 'sudo' is not being saved in the configuration. It rather looks like I need to uninstall the entire thing and start over now.

          Ryan Smith added a comment -

          I upgraded from 1.36 to 1.38, and nodes stopped automatically launching.  I was able to manually trigger node launches by going to Nodes and using the "Provision via" drop down.

           

          Reading the note above from Ken Rachynski on 2017-11-24 12:38, I changed the EC2 ami configs from m3.large to m3.xlarge, saved, and then changed them back to m3.large, saved.  And immediately following that instances started auto launching and taking work.

          Ryan Smith added a comment - I upgraded from 1.36 to 1.38, and nodes stopped automatically launching.  I was able to manually trigger node launches by going to Nodes and using the "Provision via" drop down.   Reading the note above from Ken Rachynski on 2017-11-24 12:38, I changed the EC2 ami configs from m3.large to m3.xlarge, saved, and then changed them back to m3.large, saved.  And immediately following that instances started auto launching and taking work.

          Francis Upton added a comment -

          I see the problem here. This was caused by the "node" field that was added to the SlaveTemplate https://github.com/jenkinsci/ec2-plugin/pull/232. The initial value of "node" was set to "true", allowing it to be provisioned normally. However, any serialized SlaveTemplates would (incorrectly) have the value of "false" which caused them to be ignored during the normal provisioning. The work of the PR did not consider this case.

          Francis Upton added a comment - I see the problem here. This was caused by the "node" field that was added to the SlaveTemplate https://github.com/jenkinsci/ec2-plugin/pull/232 . The initial value of "node" was set to "true", allowing it to be provisioned normally. However, any serialized SlaveTemplates would (incorrectly) have the value of "false" which caused them to be ignored during the normal provisioning. The work of the PR did not consider this case.

          Code changed in jenkins
          User: Francis Upton IV
          Path:
          src/main/java/hudson/plugins/ec2/EC2Cloud.java
          src/main/java/hudson/plugins/ec2/EC2Step.java
          src/main/java/hudson/plugins/ec2/SlaveTemplate.java
          src/test/java/hudson/plugins/ec2/EC2StepTest.java
          http://jenkins-ci.org/commit/ec2-plugin/a80c336bfc12ee28828981bdceae88842daabb07
          Log:
          JENKINS-50105 EC2 Step provisioning incorrectly specifies a label
          JENKINS-47130 EC2 plugin 1.37 fails to provision previously defined slaves

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Francis Upton IV Path: src/main/java/hudson/plugins/ec2/EC2Cloud.java src/main/java/hudson/plugins/ec2/EC2Step.java src/main/java/hudson/plugins/ec2/SlaveTemplate.java src/test/java/hudson/plugins/ec2/EC2StepTest.java http://jenkins-ci.org/commit/ec2-plugin/a80c336bfc12ee28828981bdceae88842daabb07 Log: JENKINS-50105 EC2 Step provisioning incorrectly specifies a label JENKINS-47130 EC2 plugin 1.37 fails to provision previously defined slaves

          Code changed in jenkins
          User: Francis Upton IV
          Path:
          src/main/java/hudson/plugins/ec2/EC2Cloud.java
          src/main/java/hudson/plugins/ec2/EC2Step.java
          src/main/java/hudson/plugins/ec2/SlaveTemplate.java
          src/test/java/hudson/plugins/ec2/EC2StepTest.java
          http://jenkins-ci.org/commit/ec2-plugin/affb7f407cd024accdf4e9093b07efada117814d
          Log:
          JENKINS-50105 EC2 Step provisioning incorrectly specifies a label (#268)

          JENKINS-47130 EC2 plugin 1.37 fails to provision previously defined slaves

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Francis Upton IV Path: src/main/java/hudson/plugins/ec2/EC2Cloud.java src/main/java/hudson/plugins/ec2/EC2Step.java src/main/java/hudson/plugins/ec2/SlaveTemplate.java src/test/java/hudson/plugins/ec2/EC2StepTest.java http://jenkins-ci.org/commit/ec2-plugin/affb7f407cd024accdf4e9093b07efada117814d Log: JENKINS-50105 EC2 Step provisioning incorrectly specifies a label (#268) JENKINS-47130 EC2 plugin 1.37 fails to provision previously defined slaves

            francisu Francis Upton
            vineus Vincent de Lagabbe
            Votes:
            3 Vote for this issue
            Watchers:
            16 Start watching this issue

              Created:
              Updated:
              Resolved: