brooklyn-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF GitHub Bot (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (BROOKLYN-193) Rebind failure: Cannot coerce or set value
Date Fri, 13 Nov 2015 22:01:10 GMT

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

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

GitHub user bostko opened a pull request:

    https://github.com/apache/incubator-brooklyn/pull/1033

    BROOKLYN-193: Add configuration for skipping invalid config 

    Add configuration option for skipping invalid config values

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/bostko/incubator-brooklyn add_config_rebind_failure

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/incubator-brooklyn/pull/1033.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #1033
    
----
commit 680ee07b38da835a3cb3a2c2efc5e0ff3076169b
Author: Valentin Aitken <valentin.aitken@cloudsoftcorp.com>
Date:   2015-11-13T21:58:27Z

    BROOKLYN-193 Add configuration for skipping invalid config values during rebind

----


> Rebind failure: Cannot coerce or set value
> ------------------------------------------
>
>                 Key: BROOKLYN-193
>                 URL: https://issues.apache.org/jira/browse/BROOKLYN-193
>             Project: Brooklyn
>          Issue Type: Bug
>    Affects Versions: 0.8.0, 0.9.0, 1.0.0
>            Reporter: Valentin Aitken
>              Labels: starter
>
> *Use case*
> If you submit a blueprint with a value of invalid type it is accepted.
> This causes writing invalid data to persistence and which leads to a failure on rebind.
> *Steps to reproduce:*
> # Submit a blueprint with a Map value where string value is expected.
> Enter a {color:red}wrong BP{color}
> {code}
> location: aws-centos6
> services:
> - type: org.apache.brooklyn.entity.webapp.tomcat.TomcatServer
>   java.sysprops:
>     test: false
>     provisioning.properties:
>       minRam: 4
>       minHdd: 100
> {code}
> Instead of {color:green}a correct one{color}
> {code}
> location: aws-centos6
> services:
> - type: org.apache.brooklyn.entity.webapp.tomcat.TomcatServer
>   java.sysprops:
>     test: false
>   provisioning.properties:
>     minRam: 4
>     minHdd: 100
> {code}
> # Let's say that by mistake you nest provisioning.properties into java.sysprops (java.sysprops
is Map<String, String>)
> # The blueprint is accepted and deployed successfully.
> # Restart Apache Brooklyn
> # A startup error occurs
> {code:none}
> java.lang.IllegalArgumentException: Cannot coerce or set' 
> 2015-11-13 11:16:50,305 WARN  Rebind: continuing after problem rebinding entity oisgTyDZ
(TomcatServerImpl{id=oisgTyDZ})
> java.lang.IllegalArgumentException: Cannot coerce or set {minRam=4, minHdd=100} to java.sysprops.provisioning.properties[ConfigKey:java.lang.String]
> 	at org.apache.brooklyn.core.config.internal.AbstractConfigMapImpl.coerceConfigVal(AbstractConfigMapImpl.java:83)
~[classes/:na]
> Caused by: org.apache.brooklyn.util.core.flags.ClassCoercionException: Cannot coerce
type class com.google.common.collect.Maps$TransformedEntriesMap to java.lang.String ({minRam=4,
minHdd=100}): no adapter known
> 	at org.apache.brooklyn.util.core.flags.TypeCoercions.coerce(TypeCoercions.java:272)
~[classes/:na]
> {code}
> *Short-term workaround*
> The persisted state for the relevant entities can be modified to remove the incorrect
configuration value.
> *The steps to do this are:*
>     # stop Apache Brooklyn.
>     # backup your existing persisted state.
>     # replace the relevant files with those attached.
>     # start Apache Brooklyn.
> *Long-term solution*
> We are looking at improvements to Apache Brooklyn: to allow rebind, even when there are
configuration errors like this (e.g. where the invalid configuration value is dropped).



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message