brooklyn-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Aled Sage (JIRA)" <j...@apache.org>
Subject [jira] [Created] (BROOKLYN-501) Rebind to persisted state can fail to create enricher (using default vals from brooklyn.parameters)
Date Wed, 10 May 2017 09:30:04 GMT
Aled Sage created BROOKLYN-501:
----------------------------------

             Summary: Rebind to persisted state can fail to create enricher (using default
vals from brooklyn.parameters)
                 Key: BROOKLYN-501
                 URL: https://issues.apache.org/jira/browse/BROOKLYN-501
             Project: Brooklyn
          Issue Type: Bug
    Affects Versions: 0.9.0
            Reporter: Aled Sage


When testing rebind using Brooklyn 0.11.0-rc, for persisted state generated with 0.9.0, it
can fail to rebind depending which entities you have deployed (and the failure handling -
it causes the entity to not be created - by default we'll report the error and continue).
The underlying problem is the same as that in https://issues.apache.org/jira/browse/BROOKLYN-345
(i.e. fixed for persisted state generated with 0.10.0 or later).

The exception happens when a Clocker enricher is configured with:
{noformat}
enricher.keySensor: $brooklyn:sensor($brooklyn:config(&quot;brooklyn_dns.hosts.basename.sensor&quot;))
{noformat}

The call to {{$brooklyn:config(...)}} returns absent/null, causing {{$brooklyn:sensor(...)}}
to fail. Because this happens inside {{enricher.setEntity()}}, it causes the enricher's initialisation
to fail.

Comparing the entity's persisted state with that from a more recent Brooklyn, the newer state
contains:
{noformat}
  <configKeys>
    <brooklyn__dns.hosts.basename.sensor>
      <configKey>
        <name>brooklyn_dns.hosts.basename.sensor</name>
        <type>java.lang.String</type>
        <description>The sensor giving the host basename on entities for which this
provides name serving;
the domain name is appended to the basename coming from that entity
</description>
        <defaultValue class="string">entity.id</defaultValue>
        <reconfigurable>false</reconfigurable>
        <constraint class="com.google.common.base.Predicates$ObjectPredicate">ALWAYS_TRUE</constraint>
      </configKey>
    </brooklyn__dns.hosts.basename.sensor>
{noformat}

This is because we fixed bug BROOKLYN-345, where dynamically added config keys (e.g. those
from brooklyn.parameters) weren't persisted. Before that fix, we lost on rebind the default
value etc.

{noformat}
2017-05-10 07:14:33,852 WARN  120 o.a.b.c.m.r.RebindExceptionHandlerImpl [nager-QLTRiPQR-0]
problem adding enricher zpr8jsorz5 (MapAggregator{name=org.apache.brooklyn.enricher.stock.MapAggregator,
uniqueTag=host-a
ddress-aggregator, running=true, entity=DynamicGroupImpl{id=f7zw07qpzy}, id=zpr8jsorz5}) to
entity f7zw07qpzy (DynamicGroupImpl{id=f7zw07qpzy}); continuing
java.lang.IllegalArgumentException: Error resolving config enricher.keySensor, $brooklyn:sensorName(config("brooklyn_dns.hosts.basename.sensor")),
in org.apache.brooklyn.util.core.task.BasicExecutionContext@2ed7cf83([Wrapped[contextEntity:DynamicGroupImpl{id=f7zw07qpzy}],
LocalManagementContext[uJWK6GYB-QLTRiPQR]]): Cannot resolve '$brooklyn:config("brooklyn_dns.hosts.basename.sensor")'
as a sensor (got type null
        at org.apache.brooklyn.util.core.task.ValueResolver.getMaybeInternal(ValueResolver.java:553)[120:org.apache.brooklyn.core:0.11.0.20170504_1742]
        at org.apache.brooklyn.util.core.task.ValueResolver.getMaybe(ValueResolver.java:323)[120:org.apache.brooklyn.core:0.11.0.20170504_1742]
        at org.apache.brooklyn.util.core.task.ValueResolver.get(ValueResolver.java:316)[120:org.apache.brooklyn.core:0.11.0.20170504_1742]
        at org.apache.brooklyn.util.core.task.Tasks.resolveValue(Tasks.java:147)[120:org.apache.brooklyn.core:0.11.0.20170504_1742]
        at org.apache.brooklyn.core.config.BasicConfigKey.resolveValue(BasicConfigKey.java:405)[120:org.apache.brooklyn.core:0.11.0.20170504_1742]
        at org.apache.brooklyn.core.config.BasicConfigKey.extractValue(BasicConfigKey.java:390)[120:org.apache.brooklyn.core:0.11.0.20170504_1742]
        at org.apache.brooklyn.core.config.internal.AbstractConfigMapImpl.resolveRawValueFromContainer(AbstractConfigMapImpl.java:319)[120:org.apache.brooklyn.core:0.11.0.20170504_1742]
        at org.apache.brooklyn.core.config.internal.AbstractConfigMapImpl$3.apply(AbstractConfigMapImpl.java:379)[120:org.apache.brooklyn.core:0.11.0.20170504_1742]
        at org.apache.brooklyn.core.config.internal.AbstractConfigMapImpl$3.apply(AbstractConfigMapImpl.java:375)[120:org.apache.brooklyn.core:0.11.0.20170504_1742]
        at org.apache.brooklyn.core.config.internal.AbstractConfigMapImpl.getConfigImpl(AbstractConfigMapImpl.java:391)[120:org.apache.brooklyn.core:0.11.0.20170504_1742]
        at org.apache.brooklyn.core.config.internal.AbstractConfigMapImpl.getConfig(AbstractConfigMapImpl.java:109)[120:org.apache.brooklyn.core:0.11.0.20170504_1742]
        at org.apache.brooklyn.core.objs.AbstractConfigurationSupportInternal.get(AbstractConfigurationSupportInternal.java:165)[120:org.apache.brooklyn.core:0.11.0.20170504_1742]
        at org.apache.brooklyn.enricher.stock.MapAggregator.getSourceSensors(MapAggregator.java:64)[120:org.apache.brooklyn.core:0.11.0.20170504_1742]
        at org.apache.brooklyn.enricher.stock.AbstractMultipleSensorAggregator.setEntityLoadingConfig(AbstractMultipleSensorAggregator.java:55)[120:org.apache.brooklyn.core:0.11.0.20170504_1742]
        at org.apache.brooklyn.enricher.stock.AbstractAggregator.setEntity(AbstractAggregator.java:99)[120:org.apache.brooklyn.core:0.11.0.20170504_1742]
        at org.apache.brooklyn.core.entity.AbstractEntity$BasicEnricherSupport.add(AbstractEntity.java:1695)[120:org.apache.brooklyn.core:0.11.0.20170504_1742]
        at org.apache.brooklyn.core.mgmt.rebind.BasicEntityRebindSupport.addEnrichers(BasicEntityRebindSupport.java:157)[120:org.apache.brooklyn.core:0.11.0.20170504_1742]
        at org.apache.brooklyn.core.mgmt.rebind.BasicEntityRebindSupport.addEnrichers(BasicEntityRebindSupport.java:56)[120:org.apache.brooklyn.core:0.11.0.20170504_1742]
        at org.apache.brooklyn.core.mgmt.rebind.RebindIteration.associateAdjunctsWithEntities(RebindIteration.java:649)[120:org.apache.brooklyn.core:0.11.0.20170504_1742]
        at org.apache.brooklyn.core.mgmt.rebind.RebindIteration.doRun(RebindIteration.java:243)[120:org.apache.brooklyn.core:0.11.0.20170504_1742]
        at org.apache.brooklyn.core.mgmt.rebind.InitialFullRebindIteration.doRun(InitialFullRebindIteration.java:69)[120:org.apache.brooklyn.core:0.11.0.20170504_1742]
        at org.apache.brooklyn.core.mgmt.rebind.RebindIteration.run(RebindIteration.java:265)[120:org.apache.brooklyn.core:0.11.0.20170504_1742]
        at org.apache.brooklyn.core.mgmt.rebind.RebindManagerImpl.rebindImpl(RebindManagerImpl.java:560)[120:org.apache.brooklyn.core:0.11.0.20170504_1742]
        at org.apache.brooklyn.core.mgmt.rebind.RebindManagerImpl$3.call(RebindManagerImpl.java:510)[120:org.apache.brooklyn.core:0.11.0.20170504_1742]
        at org.apache.brooklyn.core.mgmt.rebind.RebindManagerImpl$3.call(RebindManagerImpl.java:508)[120:org.apache.brooklyn.core:0.11.0.20170504_1742]
        at org.apache.brooklyn.util.core.task.BasicExecutionManager$SubmissionCallable.call(BasicExecutionManager.java:529)[120:org.apache.brooklyn.core:0.11.0.20170504_1742]
        at java.util.concurrent.FutureTask.run(FutureTask.java:266)[:1.8.0_121]
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)[:1.8.0_121]
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)[:1.8.0_121]
        at java.lang.Thread.run(Thread.java:745)[:1.8.0_121]
Caused by: org.apache.brooklyn.util.exceptions.PropagatedRuntimeException: Cannot resolve
'$brooklyn:config("brooklyn_dns.hosts.basename.sensor")' as a sensor (got type null
        at org.apache.brooklyn.util.exceptions.Exceptions.propagate(Exceptions.java:130)[141:org.apache.brooklyn.utils-common:0.11.0.20170504_1742]
        at org.apache.brooklyn.util.time.Durations.get(Durations.java:63)[141:org.apache.brooklyn.utils-common:0.11.0.20170504_1742]
        at org.apache.brooklyn.util.time.Durations.get(Durations.java:68)[141:org.apache.brooklyn.utils-common:0.11.0.20170504_1742]
        at org.apache.brooklyn.util.core.task.ValueResolver.getMaybeInternal(ValueResolver.java:488)[120:org.apache.brooklyn.core:0.11.0.20170504_1742]
        ... 29 more
Caused by: java.util.concurrent.ExecutionException: org.apache.brooklyn.util.exceptions.PropagatedRuntimeException:
Cannot resolve '$brooklyn:config("brooklyn_dns.hosts.basename.sensor")' as a sensor (got type
null
        at java.util.concurrent.FutureTask.report(FutureTask.java:122)[:1.8.0_121]
        at java.util.concurrent.FutureTask.get(FutureTask.java:192)[:1.8.0_121]
        at com.google.common.util.concurrent.ForwardingFuture.get(ForwardingFuture.java:63)[68:com.google.guava:18.0.0]
        at org.apache.brooklyn.util.core.task.BasicTask.get(BasicTask.java:375)[120:org.apache.brooklyn.core:0.11.0.20170504_1742]
        at org.apache.brooklyn.util.time.Durations.get(Durations.java:43)[141:org.apache.brooklyn.utils-common:0.11.0.20170504_1742]
        ... 31 more
Caused by: org.apache.brooklyn.util.exceptions.PropagatedRuntimeException: Cannot resolve
'$brooklyn:config("brooklyn_dns.hosts.basename.sensor")' as a sensor (got type null
        at org.apache.brooklyn.util.exceptions.Exceptions.propagate(Exceptions.java:130)[141:org.apache.brooklyn.utils-common:0.11.0.20170504_1742]
        at org.apache.brooklyn.camp.brooklyn.spi.dsl.BrooklynDslDeferredSupplier.get(BrooklynDslDeferredSupplier.java:120)[118:org.apache.brooklyn.camp:0.11.0.20170504_1742]
        at org.apache.brooklyn.util.core.task.ValueResolver$2.call(ValueResolver.java:474)[120:org.apache.brooklyn.core:0.11.0.20170504_1742]
        at org.apache.brooklyn.util.core.task.DynamicSequentialTask$DstJob.call(DynamicSequentialTask.java:363)[120:org.apache.brooklyn.core:0.11.0.20170504_1742]
        ... 5 more
Caused by: java.util.concurrent.ExecutionException: java.lang.IllegalStateException: Cannot
resolve '$brooklyn:config("brooklyn_dns.hosts.basename.sensor")' as a sensor (got type null
        at java.util.concurrent.FutureTask.report(FutureTask.java:122)[:1.8.0_121]
        at java.util.concurrent.FutureTask.get(FutureTask.java:192)[:1.8.0_121]
        at com.google.common.util.concurrent.ForwardingFuture.get(ForwardingFuture.java:63)[68:com.google.guava:18.0.0]
        at org.apache.brooklyn.util.core.task.BasicTask.get(BasicTask.java:375)[120:org.apache.brooklyn.core:0.11.0.20170504_1742]
        at org.apache.brooklyn.camp.brooklyn.spi.dsl.BrooklynDslDeferredSupplier.get(BrooklynDslDeferredSupplier.java:114)[118:org.apache.brooklyn.camp:0.11.0.20170504_1742]
        ... 7 more
Caused by: java.lang.IllegalStateException: Cannot resolve '$brooklyn:config("brooklyn_dns.hosts.basename.sensor")'
as a sensor (got type null
        at org.apache.brooklyn.camp.brooklyn.spi.dsl.methods.DslComponent$DslSensorSupplier$1.resolve(DslComponent.java:715)[118:org.apache.brooklyn.camp:0.11.0.20170504_1742]
        at org.apache.brooklyn.camp.brooklyn.spi.dsl.methods.DslComponent$DslSensorSupplier$1.resolve(DslComponent.java:713)[118:org.apache.brooklyn.camp:0.11.0.20170504_1742]
        at org.apache.brooklyn.camp.brooklyn.spi.dsl.methods.DslComponent$DslSensorSupplier$1.call(DslComponent.java:696)[118:org.apache.brooklyn.camp:0.11.0.20170504_1742]
        at org.apache.brooklyn.camp.brooklyn.spi.dsl.methods.DslComponent$DslSensorSupplier$1.call(DslComponent.java:693)[118:org.apache.brooklyn.camp:0.11.0.20170504_1742]
        ... 5 more
{noformat}




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

Mime
View raw message