Whirr
  1. Whirr
  2. WHIRR-660

provide a useful error message if whirr.instance-templates is not in a cluster spec

    Details

    • Type: Improvement Improvement
    • Status: Resolved
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 0.9.0
    • Fix Version/s: 0.8.2, 0.9.0
    • Component/s: core
    • Labels:
      None
    • Environment:

      ec2

      Description

      If you try to bring up a cluster without whirr.instance-templates defined, you get a stack trace. This special case should be detected and converted into a human-comprehensible error.

      1. WHIRR-660.patch
        2 kB
        Andrew Bayer

        Activity

        Hide
        Steve Loughran added a comment -

        Stack trace

        2012-09-19 11:31:10,677 INFO  [org.apache.whirr.actions.BootstrapClusterAction] (main) Bootstrapping cluster
        2012-09-19 11:31:10,682 ERROR [org.apache.whirr.ClusterController] (main) Unable to start the cluster. Terminating all nodes.
        java.lang.IndexOutOfBoundsException: index (0) must be less than size (0)
        	at com.google.common.base.Preconditions.checkElementIndex(Preconditions.java:305)
        	at com.google.common.base.Preconditions.checkElementIndex(Preconditions.java:284)
        	at com.google.common.collect.Iterables.get(Iterables.java:732)
        	at org.apache.whirr.actions.ScriptBasedClusterAction.execute(ScriptBasedClusterAction.java:129)
        	at org.apache.whirr.ClusterController.bootstrapCluster(ClusterController.java:137)
        	at org.apache.whirr.ClusterController.launchCluster(ClusterController.java:113)
        	at org.apache.whirr.service.hdp.integration.HdpHadoopServiceTest.setUp(HdpHadoopServiceTest.java:91)
        	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        	at java.lang.reflect.Method.invoke(Method.java:597)
        	at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44)
        	at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
        	at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41)
        	at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:27)
        	at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:31)
        	at org.junit.runners.ParentRunner.run(ParentRunner.java:236)
        	at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:234)
        	at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:133)
        	at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:114)
        	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        	at java.lang.reflect.Method.invoke(Method.java:597)
        	at org.apache.maven.surefire.util.ReflectionUtils.invokeMethodWithArray(ReflectionUtils.java:188)
        	at org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.invoke(ProviderFactory.java:166)
        
        
        Show
        Steve Loughran added a comment - Stack trace 2012-09-19 11:31:10,677 INFO [org.apache.whirr.actions.BootstrapClusterAction] (main) Bootstrapping cluster 2012-09-19 11:31:10,682 ERROR [org.apache.whirr.ClusterController] (main) Unable to start the cluster. Terminating all nodes. java.lang.IndexOutOfBoundsException: index (0) must be less than size (0) at com.google.common.base.Preconditions.checkElementIndex(Preconditions.java:305) at com.google.common.base.Preconditions.checkElementIndex(Preconditions.java:284) at com.google.common.collect.Iterables.get(Iterables.java:732) at org.apache.whirr.actions.ScriptBasedClusterAction.execute(ScriptBasedClusterAction.java:129) at org.apache.whirr.ClusterController.bootstrapCluster(ClusterController.java:137) at org.apache.whirr.ClusterController.launchCluster(ClusterController.java:113) at org.apache.whirr.service.hdp.integration.HdpHadoopServiceTest.setUp(HdpHadoopServiceTest.java:91) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44) at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15) at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41) at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:27) at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:31) at org.junit.runners.ParentRunner.run(ParentRunner.java:236) at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:234) at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:133) at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:114) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.apache.maven.surefire.util.ReflectionUtils.invokeMethodWithArray(ReflectionUtils.java:188) at org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.invoke(ProviderFactory.java:166)
        Hide
        Andrew Bayer added a comment -

        Simple patch and test - throw an IllegalArgumentException if we get an empty InstanceTemplate list.

        Show
        Andrew Bayer added a comment - Simple patch and test - throw an IllegalArgumentException if we get an empty InstanceTemplate list.
        Hide
        Steve Loughran added a comment -

        looks good to me, +1

        Show
        Steve Loughran added a comment - looks good to me, +1
        Hide
        Andrew Bayer added a comment -

        Committed.

        Show
        Andrew Bayer added a comment - Committed.
        Hide
        Andrew Bayer added a comment -

        Pushed to branch-0.8.

        Show
        Andrew Bayer added a comment - Pushed to branch-0.8.

          People

          • Assignee:
            Andrew Bayer
            Reporter:
            Steve Loughran
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development