curator-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Alex Rankin (JIRA)" <>
Subject [jira] [Created] (CURATOR-345) NPE in EnsembleTracker when starting Curator
Date Wed, 24 Aug 2016 07:45:21 GMT
Alex Rankin created CURATOR-345:

             Summary: NPE in EnsembleTracker when starting Curator
                 Key: CURATOR-345
             Project: Apache Curator
          Issue Type: Bug
          Components: Framework
    Affects Versions: 3.2.0, 3.1.0
         Environment: ZooKeeper 3.5.1-alpha
            Reporter: Alex Rankin
            Priority: Minor

We're currently getting a NPE when running Curator 3.1.0 and 3.2.0 in our environment. I don't
believe this was occurring before we upgraded to ZooKeeper 3.5.1-alpha and Curator 3.1.0.

 	at org.apache.curator.framework.imps.EnsembleTracker.configToConnectionString(
	at org.apache.curator.framework.imps.EnsembleTracker.processConfigData(
	at org.apache.curator.framework.imps.EnsembleTracker.access$300(
	at org.apache.curator.framework.imps.EnsembleTracker$2.processResult(
	at org.apache.curator.framework.imps.CuratorFrameworkImpl.sendToBackgroundCallback(
	at org.apache.curator.framework.imps.CuratorFrameworkImpl.processBackgroundOperation(
	at org.apache.curator.framework.imps.WatcherRemovalFacade.processBackgroundOperation(
	at org.apache.curator.framework.imps.GetConfigBuilderImpl$2.processResult(
	at org.apache.zookeeper.ClientCnxn$EventThread.processEvent( [zookeeper-3.5.1-alpha.jar:?]
	at org.apache.zookeeper.ClientCnxn$ [zookeeper-3.5.1-alpha.jar:?]

The problem is that the QuorumServer.clientAddr here is null. This seems to be filled by parsing
the ZooKeeper server properties, which look something like:


In the QuorumServer constructor, we parse each server line into its respective tasks. The
clientAddr, however, is filled by splitting the line around a semicolon and taking the second

String[] serverClientParts = addressStr.split(";");
if(serverClientParts.length == 2) {
    String[] e = splitWithLeadingHostname(serverClientParts[1]);
    if(e.length > 2) {
        throw new ConfigException(addressStr + " does not have the form server_config or server_config;client_config
where server_config is host:port:port or host:port:port:type and client_config is port or

    String hostname = e.length == 2?e[0]:"";

This suggests that the server string should be followed by a client host/port (or just port),


I can't find anything in the ZooKeeper documentation about this though, and it isn't mandatory
in the properties (so shouldn't throw a NPE).

This occurs every time we start the server, but doesn't affect functionality, hence the Minor
flag. It would be nice to know what exactly is expected here though, so we can get rid of
the exception.

This message was sent by Atlassian JIRA

View raw message