[ 
https://issues.apache.org/jira/browse/BROOKLYN-510?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16030951#comment-16030951
 ] 

ASF GitHub Bot commented on BROOKLYN-510:
-----------------------------------------

Github user aledsage commented on a diff in the pull request:

    https://github.com/apache/brooklyn-server/pull/713#discussion_r119322416
  
    --- Diff: 
locations/jclouds/src/main/java/org/apache/brooklyn/location/jclouds/JcloudsLocation.java
 ---
    @@ -936,8 +937,7 @@ protected MachineLocation obtainOnce(ConfigBag setup) 
throws NoMachinesAvailable
                         } else {
                             LOG.warn("Using DEPRECATED flag OPEN_IPTABLES 
(will not be supported in future versions) for {} at {}", machineLocation, 
this);
     
    -                        @SuppressWarnings("unchecked")
    -                        Iterable<Integer> inboundPorts = 
(Iterable<Integer>) setup.get(INBOUND_PORTS);
    +                        Iterable<Integer> inboundPorts = 
Ints.asList(template.getOptions().getInboundPorts());
     
                             if (inboundPorts == null || 
Iterables.isEmpty(inboundPorts)) {
    --- End diff --
    
    Very minor: we could now get rid of the null check, given `Ints.asList()` 
(and `template.getOptions().getInboundPorts()`) will never return null.
    
    Also, we don't need to convert it to an `Iterable<Integer>`. We could leave 
it as a `int[]`, and change the line below to `inboundPorts.length == 0`. No 
strong feelings.
    
    But will merge as-is.


> Brooklyn fails to provision with inboundPorts specified
> -------------------------------------------------------
>
>                 Key: BROOKLYN-510
>                 URL: https://issues.apache.org/jira/browse/BROOKLYN-510
>             Project: Brooklyn
>          Issue Type: Bug
>            Reporter: Duncan Godwin
>
> When the following blueprint is deployed:
> {code}
> location: gce-centos7
> services:
> - type: org.apache.brooklyn.entity.software.base.VanillaSoftwareProcess
>   provisioning.properties:
>     inboundPorts:
>     - 22
>     - 9100-9200
> {code}
> It fails to provision a machine, failing with the following exception:
> {code}
> Failed after 5m 24s: Error invoking start at 
> VanillaSoftwareProcessImpl{id=trch7s35q2}: Failed to get VM after 2 attempts. 
> - First cause is java.lang.ClassCastException: java.lang.String cannot be 
> cast to java.lang.Integer (listed in primary trace); plus 1 more (e.g. the 
> last is java.lang.ClassCastException: java.lang.String cannot be cast to 
> java.lang.Integer): java.lang.String cannot be cast to java.lang.Integer
> org.apache.brooklyn.util.exceptions.PropagatedRuntimeException: Error 
> invoking start at VanillaSoftwareProcessImpl{id=trch7s35q2}: Failed to get VM 
> after 2 attempts. - First cause is java.lang.ClassCastException: 
> java.lang.String cannot be cast to java.lang.Integer (listed in primary 
> trace); plus 1 more (e.g. the last is java.lang.ClassCastException: 
> java.lang.String cannot be cast to java.lang.Integer): java.lang.String 
> cannot be cast to java.lang.Integer
>       at 
> org.apache.brooklyn.util.exceptions.Exceptions.propagate(Exceptions.java:130)
>       at 
> org.apache.brooklyn.util.core.task.ParallelTask.runJobs(ParallelTask.java:93)
>       at 
> org.apache.brooklyn.util.core.task.CompoundTask$1.call(CompoundTask.java:83)
>       at 
> org.apache.brooklyn.util.core.task.CompoundTask$1.call(CompoundTask.java:81)
>       at 
> org.apache.brooklyn.util.core.task.BasicExecutionManager$SubmissionCallable.call(BasicExecutionManager.java:529)
>       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)
> Caused by: java.util.concurrent.ExecutionException: 
> org.apache.brooklyn.core.mgmt.internal.EffectorUtils$EffectorCallPropagatedRuntimeException:
>  Error invoking start at VanillaSoftwareProcessImpl{id=trch7s35q2}: Failed to 
> get VM after 2 attempts. - First cause is java.lang.ClassCastException: 
> java.lang.String cannot be cast to java.lang.Integer (listed in primary 
> trace); plus 1 more (e.g. the last is java.lang.ClassCastException: 
> java.lang.String cannot be cast to java.lang.Integer): java.lang.String 
> cannot be cast to java.lang.Integer
>       at java.util.concurrent.FutureTask.report(FutureTask.java:122)
>       at java.util.concurrent.FutureTask.get(FutureTask.java:192)
>       at 
> com.google.common.util.concurrent.ForwardingFuture.get(ForwardingFuture.java:63)
>       at org.apache.brooklyn.util.core.task.BasicTask.get(BasicTask.java:375)
>       at 
> org.apache.brooklyn.util.core.task.ParallelTask.runJobs(ParallelTask.java:76)
>       ... 7 more
> Caused by: 
> org.apache.brooklyn.core.mgmt.internal.EffectorUtils$EffectorCallPropagatedRuntimeException:
>  Error invoking start at VanillaSoftwareProcessImpl{id=trch7s35q2}: Failed to 
> get VM after 2 attempts. - First cause is java.lang.ClassCastException: 
> java.lang.String cannot be cast to java.lang.Integer (listed in primary 
> trace); plus 1 more (e.g. the last is java.lang.ClassCastException: 
> java.lang.String cannot be cast to java.lang.Integer): java.lang.String 
> cannot be cast to java.lang.Integer
>       at 
> org.apache.brooklyn.core.mgmt.internal.EffectorUtils$EffectorCallPropagatedRuntimeException.propagate(EffectorUtils.java:316)
>       at 
> org.apache.brooklyn.core.mgmt.internal.EffectorUtils$EffectorCallPropagatedRuntimeException.access$100(EffectorUtils.java:283)
>       at 
> org.apache.brooklyn.core.mgmt.internal.EffectorUtils.handleEffectorException(EffectorUtils.java:324)
>       at 
> org.apache.brooklyn.core.effector.EffectorTasks$EffectorBodyTaskFactory$2.handleException(EffectorTasks.java:90)
>       at 
> org.apache.brooklyn.util.core.task.DynamicSequentialTask.handleException(DynamicSequentialTask.java:473)
>       at 
> org.apache.brooklyn.util.core.task.DynamicSequentialTask$DstJob.call(DynamicSequentialTask.java:421)
>       ... 5 more
> Caused by: org.apache.brooklyn.util.exceptions.PropagatedRuntimeException: 
> Failed to get VM after 2 attempts. - First cause is 
> java.lang.ClassCastException: java.lang.String cannot be cast to 
> java.lang.Integer (listed in primary trace); plus 1 more (e.g. the last is 
> java.lang.ClassCastException: java.lang.String cannot be cast to 
> java.lang.Integer): java.lang.String cannot be cast to java.lang.Integer
>       at 
> org.apache.brooklyn.util.exceptions.Exceptions.propagate(Exceptions.java:130)
>       at 
> org.apache.brooklyn.util.core.task.BasicTask.getUnchecked(BasicTask.java:386)
>       at org.apache.brooklyn.util.core.task.Tasks$2.get(Tasks.java:293)
>       at 
> org.apache.brooklyn.entity.software.base.lifecycle.MachineLifecycleEffectorTasks.preStartAtMachineAsync(MachineLifecycleEffectorTasks.java:459)
>       at 
> org.apache.brooklyn.entity.software.base.lifecycle.MachineLifecycleEffectorTasks.startInLocation(MachineLifecycleEffectorTasks.java:370)
>       at 
> org.apache.brooklyn.entity.software.base.lifecycle.MachineLifecycleEffectorTasks.startInLocations(MachineLifecycleEffectorTasks.java:352)
>       at 
> org.apache.brooklyn.entity.software.base.lifecycle.MachineLifecycleEffectorTasks.start(MachineLifecycleEffectorTasks.java:341)
>       at 
> org.apache.brooklyn.entity.software.base.lifecycle.MachineLifecycleEffectorTasks$StartEffectorBody.call(MachineLifecycleEffectorTasks.java:242)
>       at 
> org.apache.brooklyn.entity.software.base.lifecycle.MachineLifecycleEffectorTasks$StartEffectorBody.call(MachineLifecycleEffectorTasks.java:229)
>       at 
> org.apache.brooklyn.core.effector.EffectorTasks$EffectorBodyTaskFactory$1.call(EffectorTasks.java:82)
>       at 
> org.apache.brooklyn.util.core.task.DynamicSequentialTask$DstJob.call(DynamicSequentialTask.java:363)
>       ... 5 more
> Caused by: java.util.concurrent.ExecutionException: 
> org.apache.brooklyn.util.exceptions.CompoundRuntimeException: Failed to get 
> VM after 2 attempts. - First cause is java.lang.ClassCastException: 
> java.lang.String cannot be cast to java.lang.Integer (listed in primary 
> trace); plus 1 more (e.g. the last is java.lang.ClassCastException: 
> java.lang.String cannot be cast to java.lang.Integer)
>       at java.util.concurrent.FutureTask.report(FutureTask.java:122)
>       at java.util.concurrent.FutureTask.get(FutureTask.java:192)
>       at 
> com.google.common.util.concurrent.ForwardingFuture.get(ForwardingFuture.java:63)
>       at org.apache.brooklyn.util.core.task.BasicTask.get(BasicTask.java:375)
>       at 
> org.apache.brooklyn.util.core.task.BasicTask.getUnchecked(BasicTask.java:384)
>       ... 14 more
> Caused by: org.apache.brooklyn.util.exceptions.CompoundRuntimeException: 
> Failed to get VM after 2 attempts. - First cause is 
> java.lang.ClassCastException: java.lang.String cannot be cast to 
> java.lang.Integer (listed in primary trace); plus 1 more (e.g. the last is 
> java.lang.ClassCastException: java.lang.String cannot be cast to 
> java.lang.Integer)
>       at 
> org.apache.brooklyn.location.jclouds.JcloudsLocation.obtain(JcloudsLocation.java:626)
>       at 
> org.apache.brooklyn.entity.software.base.lifecycle.MachineLifecycleEffectorTasks$ObtainLocationTask.call(MachineLifecycleEffectorTasks.java:451)
>       at 
> org.apache.brooklyn.entity.software.base.lifecycle.MachineLifecycleEffectorTasks$ObtainLocationTask.call(MachineLifecycleEffectorTasks.java:440)
>       at 
> org.apache.brooklyn.util.core.task.Tasks.withBlockingDetails(Tasks.java:106)
>       at 
> org.apache.brooklyn.entity.software.base.lifecycle.MachineLifecycleEffectorTasks$ProvisionMachineTask.call(MachineLifecycleEffectorTasks.java:421)
>       at 
> org.apache.brooklyn.entity.software.base.lifecycle.MachineLifecycleEffectorTasks$ProvisionMachineTask.call(MachineLifecycleEffectorTasks.java:396)
>       ... 6 more
> Caused by: java.lang.ClassCastException: java.lang.String cannot be cast to 
> java.lang.Integer
>       at 
> org.apache.brooklyn.location.jclouds.JcloudsLocation.obtainOnce(JcloudsLocation.java:961)
>       at 
> org.apache.brooklyn.location.jclouds.JcloudsLocation.obtain(JcloudsLocation.java:613)
>       ... 11 more
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

Reply via email to