• Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Minor Minor
    • ec2-plugin
    • None
    • Linux OS: 2.6.32-279.el6.x86_64
      yum install jenkins 1.579 and /etc/init.d/jenkins start
      Amazon EC2 Plugin 1.24

      I add 2 different eucalyptus clouds in Jenkins configuration, each cloud has a AMI
      When I goto nodes management page, I can see 2 buttons "Provision via EC2"
      I only can launch a slave for first cloud, but for second cloud, I meet an error message: "No such template: xxx"

          [JENKINS-24663] No such template for muiltipul eucalyptus cloud

          Vic Iglesias added a comment -

          I am also seeing this issue. As a (hokey) workaround you can reorder the cloud config sections and launch from either cloud.

          Vic Iglesias added a comment - I am also seeing this issue. As a (hokey) workaround you can reorder the cloud config sections and launch from either cloud.

          Francis Upton added a comment -

          Please try this with release 1.30; I think this might have been fixed with the fix to: JENKINS-32439

          Francis Upton added a comment - Please try this with release 1.30; I think this might have been fixed with the fix to: JENKINS-32439

          John Gallucci added a comment -

          We are having the same issue with two Eucalyptus clouds (both running v4.2.1) using the EC2 Plugin version 1.35. There also seems to be a related issue where a job is created and the slave is launched with the following error

          ERROR: The instance ID 'i-6b799381' does not exist (Service: AmazonEC2; Status Code: 400; Error Code: InvalidInstanceID.NotFound; Request ID: a170e6f9-6759-4c10-935d-145f08e0942f)
          com.amazonaws.AmazonServiceException: The instance ID 'i-6b799381' does not exist (Service: AmazonEC2; Status Code: 400; Error Code: InvalidInstanceID.NotFound; Request ID: a170e6f9-6759-4c10-935d-145f08e0942f)
          	at com.amazonaws.http.AmazonHttpClient.handleErrorResponse(AmazonHttpClient.java:1307)
          	at com.amazonaws.http.AmazonHttpClient.executeOneRequest(AmazonHttpClient.java:894)
          	at com.amazonaws.http.AmazonHttpClient.executeHelper(AmazonHttpClient.java:597)
          	at com.amazonaws.http.AmazonHttpClient.doExecute(AmazonHttpClient.java:363)
          	at com.amazonaws.http.AmazonHttpClient.executeWithTimer(AmazonHttpClient.java:329)
          	at com.amazonaws.http.AmazonHttpClient.execute(AmazonHttpClient.java:308)
          	at com.amazonaws.services.ec2.AmazonEC2Client.invoke(AmazonEC2Client.java:13032)
          	at com.amazonaws.services.ec2.AmazonEC2Client.describeInstances(AmazonEC2Client.java:9037)
          	at hudson.plugins.ec2.EC2Computer._describeInstanceOnce(EC2Computer.java:166)
          	at hudson.plugins.ec2.EC2Computer._describeInstance(EC2Computer.java:160)
          	at hudson.plugins.ec2.EC2Computer.getState(EC2Computer.java:125)
          	at hudson.plugins.ec2.EC2ComputerLauncher.launch(EC2ComputerLauncher.java:80)
          	at hudson.slaves.SlaveComputer$1.call(SlaveComputer.java:253)
          	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:1142)
          	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
          	at java.lang.Thread.run(Thread.java:745)
          

          John Gallucci added a comment - We are having the same issue with two Eucalyptus clouds (both running v4.2.1) using the EC2 Plugin version 1.35. There also seems to be a related issue where a job is created and the slave is launched with the following error ERROR: The instance ID 'i-6b799381' does not exist (Service: AmazonEC2; Status Code: 400; Error Code: InvalidInstanceID.NotFound; Request ID: a170e6f9-6759-4c10-935d-145f08e0942f) com.amazonaws.AmazonServiceException: The instance ID 'i-6b799381' does not exist (Service: AmazonEC2; Status Code: 400; Error Code: InvalidInstanceID.NotFound; Request ID: a170e6f9-6759-4c10-935d-145f08e0942f) at com.amazonaws.http.AmazonHttpClient.handleErrorResponse(AmazonHttpClient.java:1307) at com.amazonaws.http.AmazonHttpClient.executeOneRequest(AmazonHttpClient.java:894) at com.amazonaws.http.AmazonHttpClient.executeHelper(AmazonHttpClient.java:597) at com.amazonaws.http.AmazonHttpClient.doExecute(AmazonHttpClient.java:363) at com.amazonaws.http.AmazonHttpClient.executeWithTimer(AmazonHttpClient.java:329) at com.amazonaws.http.AmazonHttpClient.execute(AmazonHttpClient.java:308) at com.amazonaws.services.ec2.AmazonEC2Client.invoke(AmazonEC2Client.java:13032) at com.amazonaws.services.ec2.AmazonEC2Client.describeInstances(AmazonEC2Client.java:9037) at hudson.plugins.ec2.EC2Computer._describeInstanceOnce(EC2Computer.java:166) at hudson.plugins.ec2.EC2Computer._describeInstance(EC2Computer.java:160) at hudson.plugins.ec2.EC2Computer.getState(EC2Computer.java:125) at hudson.plugins.ec2.EC2ComputerLauncher.launch(EC2ComputerLauncher.java:80) at hudson.slaves.SlaveComputer$1.call(SlaveComputer.java:253) 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:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at java.lang.Thread.run(Thread.java:745)

          Stoke added a comment -

          Still have same issue on Amazon EC2 plugin 1.36, Jenkins version is 2.25 .

          The second still raised following issue.

          java.lang.Exception: No such template:xxx-fedora-23-xxx
          at org.kohsuke.stapler.HttpResponses.error(HttpResponses.java:83)
          at hudson.plugins.ec2.EC2Cloud.doProvision(EC2Cloud.java:336)
          at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
          at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
          at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
          at java.lang.reflect.Method.invoke(Method.java:498)
          at org.kohsuke.stapler.Function$InstanceFunction.invoke(Function.java:324)
          at org.kohsuke.stapler.Function.bindAndInvoke(Function.java:167)
          at org.kohsuke.stapler.Function.bindAndInvokeAndServeResponse(Function.java:100)
          at org.kohsuke.stapler.MetaClass$1.doDispatch(MetaClass.java:124)
          at org.kohsuke.stapler.NameBasedDispatcher.dispatch(NameBasedDispatcher.java:58)
          at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:746)
          at org.kohsuke.stapler.Stapler.invoke(Stapler.java:876)
          at org.kohsuke.stapler.MetaClass$5.doDispatch(MetaClass.java:233)
          at org.kohsuke.stapler.NameBasedDispatcher.dispatch(NameBasedDispatcher.java:58)
          at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:746)
          at org.kohsuke.stapler.Stapler.invoke(Stapler.java:876)
          at org.kohsuke.stapler.Stapler.invoke(Stapler.java:649)
          at org.kohsuke.stapler.Stapler.service(Stapler.java:238)
          at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
          at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:812)
          at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1669)
          at hudson.util.PluginServletFilter$1.doFilter(PluginServletFilter.java:135)
          at com.smartcodeltd.jenkinsci.plugin.assetbundler.filters.LessCSS.doFilter(LessCSS.ja

          Stoke added a comment - Still have same issue on Amazon EC2 plugin 1.36, Jenkins version is 2.25 . The second still raised following issue. java.lang.Exception: No such template:xxx-fedora-23-xxx at org.kohsuke.stapler.HttpResponses.error(HttpResponses.java:83) at hudson.plugins.ec2.EC2Cloud.doProvision(EC2Cloud.java:336) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.kohsuke.stapler.Function$InstanceFunction.invoke(Function.java:324) at org.kohsuke.stapler.Function.bindAndInvoke(Function.java:167) at org.kohsuke.stapler.Function.bindAndInvokeAndServeResponse(Function.java:100) at org.kohsuke.stapler.MetaClass$1.doDispatch(MetaClass.java:124) at org.kohsuke.stapler.NameBasedDispatcher.dispatch(NameBasedDispatcher.java:58) at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:746) at org.kohsuke.stapler.Stapler.invoke(Stapler.java:876) at org.kohsuke.stapler.MetaClass$5.doDispatch(MetaClass.java:233) at org.kohsuke.stapler.NameBasedDispatcher.dispatch(NameBasedDispatcher.java:58) at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:746) at org.kohsuke.stapler.Stapler.invoke(Stapler.java:876) at org.kohsuke.stapler.Stapler.invoke(Stapler.java:649) at org.kohsuke.stapler.Stapler.service(Stapler.java:238) at javax.servlet.http.HttpServlet.service(HttpServlet.java:790) at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:812) at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1669) at hudson.util.PluginServletFilter$1.doFilter(PluginServletFilter.java:135) at com.smartcodeltd.jenkinsci.plugin.assetbundler.filters.LessCSS.doFilter(LessCSS.ja

          Gareth Coffey added a comment -

          Ensure that you define a description above the AMI, in your cloud definition, after I defined that the error disappeared.
          If you are deploying into a VPC you must also make sure you set 'Subnet ID for VPC' in the Advanced cloud options.

          Gareth Coffey added a comment - Ensure that you define a description above the AMI, in your cloud definition, after I defined that the error disappeared. If you are deploying into a VPC you must also make sure you set 'Subnet ID for VPC' in the Advanced cloud options.

          Stoke added a comment -

          Yes, I'm sure I define a description, for my case, the description is "xxx-fedora-23-xxx".

          Stoke added a comment - Yes, I'm sure I define a description, for my case, the description is "xxx-fedora-23-xxx".

          Stoke added a comment -

          And it is not for VPC case, and response is ok when I clicked "Check AMI".

          Stoke added a comment - And it is not for VPC case, and response is ok when I clicked "Check AMI".

          Gareth Coffey added a comment -

          Ok, provisioning EC2 Classic should not matter.

          The error you are receiving is from this block of code ...
          https://github.com/jenkinsci/ec2-plugin/blob/master/src/main/java/hudson/plugins/ec2/EC2Cloud.java#L334-L337

              public HttpResponse doProvision(@QueryParameter String template) throws ServletException, IOException {
          ...
                  SlaveTemplate t = getTemplate(template);
                  if (t == null) {
                      throw HttpResponses.error(SC_BAD_REQUEST, "No such template: " + template);
                  }
          ...
              }
          

          The 'getTemplate' function does a lookup, based on the template name you select i.e. xxx-fedora-23-xxx, against the 'description' field for the templates you have defined.

          If you have the 'description' field populated then there should be no reason why it's not returning your template; the Java function equals() could be misinterpreting the hyphens in your template description so perhaps try removing them or replace with underscores.

          Also, have you tried forcing Jenkins to reload your config or tried a restart?

          Gareth Coffey added a comment - Ok, provisioning EC2 Classic should not matter. The error you are receiving is from this block of code ... https://github.com/jenkinsci/ec2-plugin/blob/master/src/main/java/hudson/plugins/ec2/EC2Cloud.java#L334-L337 public HttpResponse doProvision(@QueryParameter String template) throws ServletException, IOException { ... SlaveTemplate t = getTemplate(template); if (t == null ) { throw HttpResponses.error(SC_BAD_REQUEST, "No such template: " + template); } ... } The 'getTemplate' function does a lookup, based on the template name you select i.e. xxx-fedora-23-xxx, against the 'description' field for the templates you have defined. If you have the 'description' field populated then there should be no reason why it's not returning your template; the Java function equals() could be misinterpreting the hyphens in your template description so perhaps try removing them or replace with underscores. Also, have you tried forcing Jenkins to reload your config or tried a restart?

          Stoke added a comment -
          • My first config sections is use xxx-rhel-7.2-xxx as the "description" and it works.
          • Then I changed to "fedora-23" for the "description" in my second section and stop/start jenkins applicatoin, but still the same. First configuration is ok, but second one is failed.

          Logs:
          java.lang.Exception: No such template: fedora23
          at org.kohsuke.stapler.HttpResponses.error(HttpResponses.java:83)
          at hudson.plugins.ec2.EC2Cloud.doProvision(EC2Cloud.java:336)
          at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
          at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
          at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
          at java.lang.reflect.Method.invoke(Method.java:498)
          at org.kohsuke.stapler.Function$InstanceFunction.invoke(Function.java:324)
          at org.kohsuke.stapler.Function.bindAndInvoke(Function.java:167)
          at org.kohsuke.stapler.Function.bindAndInvokeAndServeResponse(Function.java:100)
          at org.kohsuke.stapler.MetaClass$1.doDispatch(MetaClass.java:124)
          at org.kohsuke.stapler.NameBasedDispatcher.dispatch(NameBasedDispatcher.java:58)
          at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:746)
          at org.kohsuke.stapler.Stapler.invoke(Stapler.java:876)
          at org.kohsuke.stapler.MetaClass$5.doDispatch(MetaClass.java:233)
          at org.kohsuke.stapler.NameBasedDispatcher.dispatch(NameBasedDispatcher.java:58)
          at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:746)
          at org.kohsuke.stapler.Stapler.invoke(Stapler.java:876)
          at org.kohsuke.stapler.Stapler.invoke(Stapler.java:649)
          at org.kohsuke.stapler.Stapler.service(Stapler.java:238)
          at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)

          Stoke added a comment - My first config sections is use xxx-rhel-7.2-xxx as the "description" and it works. Then I changed to "fedora-23" for the "description" in my second section and stop/start jenkins applicatoin, but still the same. First configuration is ok, but second one is failed. Logs: java.lang.Exception: No such template: fedora23 at org.kohsuke.stapler.HttpResponses.error(HttpResponses.java:83) at hudson.plugins.ec2.EC2Cloud.doProvision(EC2Cloud.java:336) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.kohsuke.stapler.Function$InstanceFunction.invoke(Function.java:324) at org.kohsuke.stapler.Function.bindAndInvoke(Function.java:167) at org.kohsuke.stapler.Function.bindAndInvokeAndServeResponse(Function.java:100) at org.kohsuke.stapler.MetaClass$1.doDispatch(MetaClass.java:124) at org.kohsuke.stapler.NameBasedDispatcher.dispatch(NameBasedDispatcher.java:58) at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:746) at org.kohsuke.stapler.Stapler.invoke(Stapler.java:876) at org.kohsuke.stapler.MetaClass$5.doDispatch(MetaClass.java:233) at org.kohsuke.stapler.NameBasedDispatcher.dispatch(NameBasedDispatcher.java:58) at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:746) at org.kohsuke.stapler.Stapler.invoke(Stapler.java:876) at org.kohsuke.stapler.Stapler.invoke(Stapler.java:649) at org.kohsuke.stapler.Stapler.service(Stapler.java:238) at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)

            francisu Francis Upton
            mysql1230 my sql
            Votes:
            1 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated: