Hi all,

this is my first post on the development list of cassandra - but I think this belongs here.

I'm running cassandra for a while now, and on testing I ran in many of 2.1.2s issues. So I upgraded my test cluster from 2.1.2 to 2.1.3. I updated with the debian packages, diffed my cassandra.yaml and applied our changes to the new cassandra.yaml. Those changes are:

- cluster_name
- seeds
- listen_interface instead of listen_address
- rpc_interface instead of rpc_address

Nothing really spectacular - interface is nice as all nodes have the same cassandra.yaml. But trying to start 2.1.3 gives me an NPE:

ERROR [main] 2015-02-20 07:50:09,661 DatabaseDescriptor.java:144 - Fatal error during configuration loading
java.lang.NullPointerException: null
at org.apache.cassandra.config.DatabaseDescriptor.applyConfig(DatabaseDescriptor.java:411) ~[apache-cassandra-2.1.3.jar:2.1.3] at org.apache.cassandra.config.DatabaseDescriptor.<clinit>(DatabaseDescriptor.java:133) ~[apache-cassandra-2.1.3.jar:2.1.3] at org.apache.cassandra.service.CassandraDaemon.setup(CassandraDaemon.java:110) [apache-cassandra-2.1.3.jar:2.1.3] at org.apache.cassandra.service.CassandraDaemon.activate(CassandraDaemon.java:465) [apache-cassandra-2.1.3.jar:2.1.3] at org.apache.cassandra.service.CassandraDaemon.main(CassandraDaemon.java:554) [apache-cassandra-2.1.3.jar:2.1.3]

I also tried the .tar.gz distribution with the same result. I looked at the code of DatabaseDescriptor, and if someone uses rpc_interface this piece of code is executed:

/* Local IP, hostname or interface to bind RPC server to */
if(conf.rpc_address !=null&& conf.rpc_interface !=null)
{
    throw newConfigurationException("Set rpc_address OR rpc_interface, not 
both");
}
else if(conf.rpc_address !=null)
{
    try
    {
        rpcAddress = InetAddress.getByName(conf.rpc_address);
    }
    catch(UnknownHostException e)
    {
        throw newConfigurationException("Unknown host in rpc_address "+ 
conf.rpc_address);
    }
}
else if(conf.rpc_interface !=null)
{
    listenAddress = 
getNetworkInterfaceAddress(conf.rpc_interface,"rpc_interface");
}
else
{
    rpcAddress = FBUtilities.getLocalAddress();
}


I think that listenAddress in the second else block is an error. In my case rpc_interface is eth0, so listenAddress gets set, and rpcAddress remains unset. The result is NPE in line 411:

if(rpcAddress.isAnyLocalAddress())

After changing rpc_interface to rpc_address everything works as expected.

Best regards,
Jan


Reply via email to