Return-Path: X-Original-To: apmail-brooklyn-dev-archive@minotaur.apache.org Delivered-To: apmail-brooklyn-dev-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 4FEA618C71 for ; Fri, 13 Nov 2015 22:01:21 +0000 (UTC) Received: (qmail 6523 invoked by uid 500); 13 Nov 2015 22:01:20 -0000 Delivered-To: apmail-brooklyn-dev-archive@brooklyn.apache.org Received: (qmail 6483 invoked by uid 500); 13 Nov 2015 22:01:20 -0000 Mailing-List: contact dev-help@brooklyn.incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@brooklyn.incubator.apache.org Delivered-To: mailing list dev@brooklyn.incubator.apache.org Received: (qmail 6472 invoked by uid 99); 13 Nov 2015 22:01:20 -0000 Received: from Unknown (HELO spamd1-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 13 Nov 2015 22:01:20 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd1-us-west.apache.org (ASF Mail Server at spamd1-us-west.apache.org) with ESMTP id 5C58CC504C for ; Fri, 13 Nov 2015 22:01:20 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd1-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 1.463 X-Spam-Level: * X-Spam-Status: No, score=1.463 tagged_above=-999 required=6.31 tests=[KAM_ASCII_DIVIDERS=0.8, KAM_LAZY_DOMAIN_SECURITY=1, RP_MATCHES_RCVD=-0.338, URIBL_BLOCKED=0.001] autolearn=disabled Received: from mx1-us-east.apache.org ([10.40.0.8]) by localhost (spamd1-us-west.apache.org [10.40.0.7]) (amavisd-new, port 10024) with ESMTP id LjLclnuvA210 for ; Fri, 13 Nov 2015 22:01:12 +0000 (UTC) Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx1-us-east.apache.org (ASF Mail Server at mx1-us-east.apache.org) with SMTP id 9D510439CD for ; Fri, 13 Nov 2015 22:01:11 +0000 (UTC) Received: (qmail 6343 invoked by uid 99); 13 Nov 2015 22:01:11 -0000 Received: from arcas.apache.org (HELO arcas) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 13 Nov 2015 22:01:11 +0000 Received: from arcas.apache.org (localhost [127.0.0.1]) by arcas (Postfix) with ESMTP id EF4432C0452 for ; Fri, 13 Nov 2015 22:01:10 +0000 (UTC) Date: Fri, 13 Nov 2015 22:01:10 +0000 (UTC) From: "ASF GitHub Bot (JIRA)" To: dev@brooklyn.incubator.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (BROOKLYN-193) Rebind failure: Cannot coerce or set value MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ 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 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) > # 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)