[
https://issues.apache.org/jira/browse/AMBARI-8233?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14204056#comment-14204056
]
Mahadev konar commented on AMBARI-8233:
---------------------------------------
+1 for the patch.
> Blueprint fails when %HOSTGROUP::name% followed by another %
> ------------------------------------------------------------
>
> Key: AMBARI-8233
> URL: https://issues.apache.org/jira/browse/AMBARI-8233
> Project: Ambari
> Issue Type: Bug
> Components: ambari-server
> Affects Versions: 1.7.0
> Reporter: Alejandro Fernandez
> Assignee: Alejandro Fernandez
> Fix For: 1.7.0
>
> Attachments: AMBARI-8233.patch, blueprint_error.log,
> hdp_22_blueprint.json, single_node_cluster.json
>
>
> I created an HDP 2.2 cluster with all of the services except Knox, Kafka, and
> Slider, then exported the blueprint, and removed Ganglia from it.
> Then, I attempted to create a single node cluster using the blueprints and
> ran into a regex error.
> The problem is that one of the properties contains %HOSTGROUP::name% followed
> by another % and the regex match tries to do greedy matching instead of
> minimal.
> For example, storm-site.xml had worker.childopts with
> {code}
> -Xmx768m _JAAS_PLACEHOLDER
> -javaagent:/usr/hdp/current/storm-client/contrib/storm-jmxetric/lib/jmxetric-1.0.4.jar=host=%HOSTGROUP::host_group_1%,port=8650,wireformat31x=true,mode=multicast,config=/usr/hdp/current/storm-client/contrib/storm-jmxetric/conf/jmxetric-conf.xml,process=Worker_%ID%_JVM
> {code}
> While the regex expression in BlueprintConfigurationProcessor.java is,
> {code}
> private static Pattern HOSTGROUP_REGEX =
> Pattern.compile("%HOSTGROUP::(\\S+)%");
> {code}
> Instead, it should be,
> {code}
> private static Pattern HOSTGROUP_REGEX =
> Pattern.compile("%HOSTGROUP::(\\S+?)%");
> {code}
> Steps to repro,
> {code}
> curl -H "X-Requested-By:ambari" -X POST -u admin:admin
> http://c6410.ambari.apache.org:8080/api/v1/blueprints/hdp22 -d
> @hdp_22_blueprint.json
> curl -H "X-Requested-By:ambari" -X POST -u admin:admin
> http://c6410.ambari.apache.org:8080/api/v1/clusters/dev -d
> @single_node_cluster.json
> {code}
> Returns an error,
> {code}
> 00:27:27,999 ERROR [qtp560042431-25] BaseManagementHandler:66 - Caught a
> runtime exception while attempting to create a resource
> java.lang.NullPointerException
> at
> org.apache.ambari.server.controller.internal.BlueprintConfigurationProcessor$SingleHostTopologyUpdater.updateForClusterCreate(BlueprintConfigurationProcessor.java:580)
> at
> org.apache.ambari.server.controller.internal.BlueprintConfigurationProcessor.doUpdateForClusterCreate(BlueprintConfigurationProcessor.java:131)
> at
> org.apache.ambari.server.controller.internal.ClusterResourceProvider.processConfigurations(ClusterResourceProvider.java:961)
> at
> org.apache.ambari.server.controller.internal.ClusterResourceProvider.processBlueprintCreate(ClusterResourceProvider.java:432)
> at
> org.apache.ambari.server.controller.internal.ClusterResourceProvider.createResources(ClusterResourceProvider.java:124)
> at
> org.apache.ambari.server.controller.internal.ClusterControllerImpl.createResources(ClusterControllerImpl.java:274)
> at
> org.apache.ambari.server.api.services.persistence.PersistenceManagerImpl.create(PersistenceManagerImpl.java:75)
> at
> org.apache.ambari.server.api.handlers.CreateHandler.persist(CreateHandler.java:36)
> at
> org.apache.ambari.server.api.handlers.BaseManagementHandler.handleRequest(BaseManagementHandler.java:72)
> at
> org.apache.ambari.server.api.services.BaseRequest.process(BaseRequest.java:135)
> at
> org.apache.ambari.server.api.services.BaseService.handleRequest(BaseService.java:103)
> at
> org.apache.ambari.server.api.services.BaseService.handleRequest(BaseService.java:72)
> at
> org.apache.ambari.server.api.services.ClusterService.createCluster(ClusterService.java:118)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
> at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
> at java.lang.reflect.Method.invoke(Method.java:606)
> at
> com.sun.jersey.spi.container.JavaMethodInvokerFactory$1.invoke(JavaMethodInvokerFactory.java:60)
> at
> com.sun.jersey.server.impl.model.method.dispatch.AbstractResourceMethodDispatchProvider$ResponseOutInvoker._dispatch(
> {code}
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)