Whirr
  1. Whirr
  2. WHIRR-232

NPE for stopped instances on EC2

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 0.4.0
    • Component/s: None
    • Labels:
      None

      Description

      When running an integration test on EC2 I get:

      java.lang.NullPointerException
              at org.apache.whirr.cluster.actions.ConfigureClusterAction$1.apply(ConfigureClusterAction.java:102)
              at org.apache.whirr.cluster.actions.ConfigureClusterAction$1.apply(ConfigureClusterAction.java:98)
              at com.google.common.base.Predicates$AndPredicate.apply(Predicates.java:324)
              at com.google.common.collect.Iterators$7.computeNext(Iterators.java:616)
              at com.google.common.collect.AbstractIterator.tryToComputeNext(AbstractIterator.java:137)
              at com.google.common.collect.AbstractIterator.hasNext(AbstractIterator.java:132)
              at com.google.common.collect.Iterators.size(Iterators.java:129)
              at com.google.common.collect.Collections2$FilteredCollection.size(Collections2.java:203)
              at com.google.common.collect.Iterables.size(Iterables.java:79)
              at org.jclouds.compute.internal.BaseComputeService.nodesMatchingFilterAndNotTerminatedExceptionIfNotFound(BaseComputeService.java:309)
              at org.jclouds.compute.internal.BaseComputeService.runScriptOnNodesMatching(BaseComputeService.java:536)
              at org.apache.whirr.cluster.actions.ConfigureClusterAction.doAction(ConfigureClusterAction.java:81)
              at org.apache.whirr.cluster.actions.ScriptBasedClusterAction.execute(ScriptBasedClusterAction.java:74)
              at org.apache.whirr.service.Service.launchCluster(Service.java:74)
              at org.apache.whirr.service.cassandra.integration.CassandraServiceTest.setUp(CassandraServiceTest.java:65)
              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.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:76)
              at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)
              at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193)
              at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52)
              at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191)
              at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42)
              at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184)
              at org.junit.runners.ParentRunner.run(ParentRunner.java:236)
              at org.apache.maven.surefire.junit4.JUnit4TestSet.execute(JUnit4TestSet.java:59)
              at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.executeTestSet(AbstractDirectoryTestSuite.java:115)
              at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.execute(AbstractDirectoryTestSuite.java:102)
              at org.apache.maven.surefire.Surefire.run(Surefire.java:180)
              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.booter.SurefireBooter.runSuitesInProcess(SurefireBooter.java:350)
              at org.apache.maven.surefire.booter.SurefireBooter.main(SurefireBooter.java:1021)
      

        Activity

        Hide
        Adrian Cole added a comment -

        this can happen if the group parsed from the node is null, meaning it was started outside of whirr, or otherwise doesn't match.

        Show
        Adrian Cole added a comment - this can happen if the group parsed from the node is null, meaning it was started outside of whirr, or otherwise doesn't match.
        Hide
        Adrian Cole added a comment -

        +1

        tested patch by launching a vanilla instance using ec2 console (which won't match a group) and running a cassandra test

        Show
        Adrian Cole added a comment - +1 tested patch by launching a vanilla instance using ec2 console (which won't match a group) and running a cassandra test
        Hide
        Tom White added a comment -

        Thanks for taking a look, Adrian. Yes, this is what happened. There were some instances that were started outside Whirr (they were in the stopped state, but this wasn't the problem). With this patch the integration test passed, so I'll go ahead and commit.

        Show
        Tom White added a comment - Thanks for taking a look, Adrian. Yes, this is what happened. There were some instances that were started outside Whirr (they were in the stopped state, but this wasn't the problem). With this patch the integration test passed, so I'll go ahead and commit.
        Hide
        Tom White added a comment -

        I've just committed this.

        Show
        Tom White added a comment - I've just committed this.

          People

          • Assignee:
            Tom White
            Reporter:
            Tom White
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development