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

ECS plugin fails to use label expression

    XMLWordPrintable

Details

    • Bug
    • Status: Resolved (View Workflow)
    • Blocker
    • Resolution: Fixed
    • amazon-ecs-plugin
    • None
    • Tested on 2.107.1 and 2.89.2.

    Description

      When I have multiple images defined in the same cluster I want to differentiate them by labels, like 'aws&&chef' or 'aws&&terraform'. Unfortunately it seems this plugin fails to handle plugin expressions, see the error stack trace below:

      Mar 24, 2018 10:53:40 AM WARNING hudson.slaves.NodeProvisioner$2 run
      Unexpected exception encountered while provisioning agent ECS Slave aws linux debian
      java.lang.ClassCastException: hudson.model.labels.LabelExpression$And cannot be cast to hudson.model.labels.LabelAtom
      	at jenkins.model.Jenkins.getLabelAtom(Jenkins.java:1941)
      	at hudson.model.Label.parse(Label.java:592)
      	at hudson.model.Node.getAssignedLabels(Node.java:300)
      	at hudson.model.Slave.<init>(Slave.java:196)
      	at hudson.slaves.AbstractCloudSlave.<init>(AbstractCloudSlave.java:51)
      	at com.cloudbees.jenkins.plugins.amazonecs.ECSSlave.<init>(ECSSlave.java:95)
      	at com.cloudbees.jenkins.plugins.amazonecs.ECSCloud$ProvisioningCallback.call(ECSCloud.java:243)
      	at com.cloudbees.jenkins.plugins.amazonecs.ECSCloud$ProvisioningCallback.call(ECSCloud.java:221)
      	at jenkins.util.ContextResettingExecutorService$2.call(ContextResettingExecutorService.java:46)
      	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
      	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
      	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
      	at java.lang.Thread.run(Thread.java:748)

      Attachments

        Activity

          llibicpep Dee Kryvenko created issue -
          llibicpep Dee Kryvenko made changes -
          Field Original Value New Value
          Description When I have multiple images defined in the same cluster I want to differentiate them by labels, like 'aws&&chef' or 'aws&&terraform'. Unfortunately it seems this plugin fails to handle plugin expressions, see the error stack trace below:
          {code:java}
          Mar 23, 2018 10:03:28 PM WARNING hudson.slaves.NodeProvisioner$2 run
           Unexpected exception encountered while provisioning agent ECS Slave aws linux foo bar java.lang.ClassCastException: hudson.model.labels.LabelExpression$And cannot be cast to hudson.model.labels.LabelAtom at jenkins.model.Jenkins.getLabelAtom(Jenkins.java:1978) at hudson.model.Label.parse(Label.java:592) at hudson.model.Node.getAssignedLabels(Node.java:300) at hudson.model.Slave.<init>(Slave.java:196) at hudson.slaves.AbstractCloudSlave.<init>(AbstractCloudSlave.java:51) at com.cloudbees.jenkins.plugins.amazonecs.ECSSlave.<init>(ECSSlave.java:95) at com.cloudbees.jenkins.plugins.amazonecs.ECSCloud$ProvisioningCallback.call(ECSCloud.java:243) at com.cloudbees.jenkins.plugins.amazonecs.ECSCloud$ProvisioningCallback.call(ECSCloud.java:221) at jenkins.util.ContextResettingExecutorService$2.call(ContextResettingExecutorService.java:46) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at java.lang.Thread.run(Thread.java:748){code}
          When I have multiple images defined in the same cluster I want to differentiate them by labels, like 'aws&&chef' or 'aws&&terraform'. Unfortunately it seems this plugin fails to handle plugin expressions, see the error stack trace below:
          {code:java}
          Mar 24, 2018 10:53:40 AM WARNING hudson.slaves.NodeProvisioner$2 run
          Unexpected exception encountered while provisioning agent ECS Slave aws linux debian
          java.lang.ClassCastException: hudson.model.labels.LabelExpression$And cannot be cast to hudson.model.labels.LabelAtom
          at jenkins.model.Jenkins.getLabelAtom(Jenkins.java:1941)
          at hudson.model.Label.parse(Label.java:592)
          at hudson.model.Node.getAssignedLabels(Node.java:300)
          at hudson.model.Slave.<init>(Slave.java:196)
          at hudson.slaves.AbstractCloudSlave.<init>(AbstractCloudSlave.java:51)
          at com.cloudbees.jenkins.plugins.amazonecs.ECSSlave.<init>(ECSSlave.java:95)
          at com.cloudbees.jenkins.plugins.amazonecs.ECSCloud$ProvisioningCallback.call(ECSCloud.java:243)
          at com.cloudbees.jenkins.plugins.amazonecs.ECSCloud$ProvisioningCallback.call(ECSCloud.java:221)
          at jenkins.util.ContextResettingExecutorService$2.call(ContextResettingExecutorService.java:46)
          at java.util.concurrent.FutureTask.run(FutureTask.java:266)
          at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
          at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
          at java.lang.Thread.run(Thread.java:748){code}
          llibicpep Dee Kryvenko made changes -
          URL https://github.com/jenkinsci/amazon-ecs-plugin/pull/55
          Assignee Jan Roehrich [ roehrijn2 ] Dmytro Kryvenko [ llibicpep ]
          llibicpep Dee Kryvenko added a comment - - edited

          I think that would do it: https://github.com/jenkinsci/amazon-ecs-plugin/pull/55

          Tested on 2.107.1.

          llibicpep Dee Kryvenko added a comment - - edited I think that would do it:  https://github.com/jenkinsci/amazon-ecs-plugin/pull/55 Tested on 2.107.1.
          llibicpep Dee Kryvenko made changes -
          Status Open [ 1 ] In Progress [ 3 ]
          llibicpep Dee Kryvenko made changes -
          Status In Progress [ 3 ] In Review [ 10005 ]
          llibicpep Dee Kryvenko made changes -
          Resolution Fixed [ 1 ]
          Status In Review [ 10005 ] Resolved [ 5 ]

          People

            llibicpep Dee Kryvenko
            llibicpep Dee Kryvenko
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: