NPE when updating a worker environment
Opened this issue · 2 comments
szantopeter commented
I got the following NPE
[WARNING] FAILURE
java.lang.NullPointerException
at java.lang.String$CaseInsensitiveComparator.compare(String.java:1192)
at java.lang.String$CaseInsensitiveComparator.compare(String.java:1186)
at java.util.TreeMap.getEntryUsingComparator(TreeMap.java:376)
at java.util.TreeMap.getEntry(TreeMap.java:345)
at java.util.TreeMap.containsKey(TreeMap.java:232)
at java.util.TreeSet.contains(TreeSet.java:234)
at br.com.ingenieux.mojo.beanstalk.util.EnvironmentHostnameUtil$1.apply(EnvironmentHostnameUtil.java:45)
at br.com.ingenieux.mojo.beanstalk.util.EnvironmentHostnameUtil$1.apply(EnvironmentHostnameUtil.java:42)
at com.google.common.base.Predicates$AndPredicate.apply(Predicates.java:338)
at com.google.common.collect.Iterators$7.computeNext(Iterators.java:645)
at com.google.common.collect.AbstractIterator.tryToComputeNext(AbstractIterator.java:141)
at com.google.common.collect.AbstractIterator.hasNext(AbstractIterator.java:136)
at com.google.common.collect.Iterators.size(Iterators.java:147)
at com.google.common.collect.Collections2$FilteredCollection.size(Collections2.java:221)
at br.com.ingenieux.mojo.beanstalk.AbstractBeanstalkMojo.handleResults(AbstractBeanstalkMojo.java:102)
at br.com.ingenieux.mojo.beanstalk.AbstractBeanstalkMojo.lookupEnvironment(AbstractBeanstalkMojo.java:97)
at br.com.ingenieux.mojo.beanstalk.AbstractNeedsEnvironmentMojo.configure(AbstractNeedsEnvironmentMojo.java:395)
at br.com.ingenieux.mojo.aws.AbstractAWSMojo.execute(AbstractAWSMojo.java:373)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:134)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:207)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:116)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:80)
at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:307)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:193)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:106)
at org.apache.maven.cli.MavenCli.execute(MavenCli.java:863)
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:288)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:199)
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:497)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
when calling
mvn beanstalk:upload-source-bundle beanstalk:create-application-version beanstalk:update-environment -X
The response from AWS is below
<Environments>
<member>
<SolutionStackName>64bit Amazon Linux 2016.09 v2.4.0 running Java 8</SolutionStackName>
<Description>spring-boot-aws-example</Description>
<Health>Green</Health>
<MinCapacityEnabled>false</MinCapacityEnabled>
<DateUpdated>2017-01-05T09:32:35.006Z</DateUpdated>
<AbortableOperationInProgress>false</AbortableOperationInProgress>
<Alerts/>
<DateCreated>2017-01-05T09:29:05.030Z</DateCreated>
<EnvironmentId>e-ayxggxizwy</EnvironmentId>
<VersionLabel>20170105092850</VersionLabel>
<Tier>
<Name>WebServer</Name>
<Type>Standard</Type>
<Version> </Version>
</Tier>
<EnvironmentName>szp-spring-boot-aws-example-dev-mvn</EnvironmentName>
<EndpointURL>awseb-e-a-AWSEBLoa-1T1PAORAB55PB-1682414751.us-east-1.elb.amazonaws.com</EndpointURL>
<CNAME>szp-spring-boot-aws-example-dev-mvn.us-east-1.elasticbeanstalk.com</CNAME>
<EnvironmentLinks/>
<ApplicationName>spring-boot-aws-example</ApplicationName>
<Status>Ready</Status>
</member>
<member>
<SolutionStackName>64bit Amazon Linux 2016.09 v2.4.0 running Java 8</SolutionStackName>
<Health>Grey</Health>
<MinCapacityEnabled>false</MinCapacityEnabled>
<DateUpdated>2017-01-05T09:31:37.667Z</DateUpdated>
<AbortableOperationInProgress>false</AbortableOperationInProgress>
<Alerts/>
<DateCreated>2017-01-05T09:13:07.851Z</DateCreated>
<EnvironmentId>e-mfpzrpbe2q</EnvironmentId>
<VersionLabel>20170103180325</VersionLabel>
<Tier>
<Name>Worker</Name>
<Type>SQS/HTTP</Type>
<Version> </Version>
</Tier>
<HealthStatus>Unknown</HealthStatus>
<EnvironmentName>Sample-env</EnvironmentName>
<EnvironmentLinks/>
<ApplicationName>spring-boot-aws-example</ApplicationName>
<Status>Terminated</Status>
</member>
</Environments>
The worker environment doesn't have a CName hence causing the NPE. By the way this environment is terminated so the code should ignore it anyway
aldrinleal commented
Can you try the code with the 1.5.1-SNAPSHOT version? It should be on sonatype-snapshots
szantopeter commented
tried and it works, thanks a lot! By the way with the 1.5.1-SNAPSHOT the version label become mandatory, not sure if this is intended.