[ 
https://issues.apache.org/jira/browse/CASSANDRA-9208?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Sandeep More updated CASSANDRA-9208:
------------------------------------
    Description: 
In the cassandra.yaml file when "rpc_interface" option is set it causes a NPE 
(stack trace at the end).
Upon further investigation it turns out that there is a serious problem is in 
the way this logic is handled in the code DatabaseDescriptor.java (#374).

Following is the code snippet 
 else if (conf.rpc_interface != null)
        {
            listenAddress = getNetworkInterfaceAddress(conf.rpc_interface, 
"rpc_interface");
        }
        else
        {
            rpcAddress = FBUtilities.getLocalAddress();
        }

If you notice, 

1) The code above sets the "listenAddress" instead of "rpcAddress".  
2) The function getNetworkInterfaceAddress() blindly assumes that this is 
called to set the "listenAddress" (see line 171). The "configName" variable 
passed to the function is royally ignored and only used for printing out 
exception (which again is misleading)

I am also attaching a suggested patch (NOTE: the patch tries to address this 
issue, the function getNetworkInterfaceAddress() needs revision ).


INFO  15:36:56 Windows environment detected.  DiskAccessMode set to standard, 
indexAccessMode standard
INFO  15:36:56 Global memtable on-heap threshold is enabled at 503MB
INFO  15:36:56 Global memtable off-heap threshold is enabled at 503MB
ERROR 15:37:50 Fatal error during configuration loading
java.lang.NullPointerException: null
        at 
org.apache.cassandra.config.DatabaseDescriptor.applyConfig(DatabaseDescriptor.java:411)
 ~[apache-cassandra-2.1.4.jar:2.1.4]
        at 
org.apache.cassandra.config.DatabaseDescriptor.<clinit>(DatabaseDescriptor.java:133)
 ~[apache-cassandra-2.1.4.jar:2.1.4]
        at 
org.apache.cassandra.service.CassandraDaemon.setup(CassandraDaemon.java:164) 
[apache-cassandra-2.1.4.jar:2.1.4]
        at 
org.apache.cassandra.service.CassandraDaemon.activate(CassandraDaemon.java:533) 
[apache-cassandra-2.1.4.jar:2.1.4]
        at 
org.apache.cassandra.service.CassandraDaemon.main(CassandraDaemon.java:622) 
[apache-cassandra-2.1.4.jar:2.1.4]
null
Fatal error during configuration loading; unable to start. See log for 
stacktrace.

  was:
In the cassandra.yaml file when "rpc_interface" option is set it causes a NPE.
Upon further investigation it turns out that there is a serious problem is in 
the way this logic is handled in the code DatabaseDescriptor.java (#374).

Following is the code snippet 
 else if (conf.rpc_interface != null)
        {
            listenAddress = getNetworkInterfaceAddress(conf.rpc_interface, 
"rpc_interface");
        }
        else
        {
            rpcAddress = FBUtilities.getLocalAddress();
        }

If you notice, 

1) The code above sets the "listenAddress" instead of "rpcAddress".  
2) The function getNetworkInterfaceAddress() blindly assumes that this is 
called to set the "listenAddress" (see line 171). The "configName" variable 
passed to the function is royally ignored and only used for printing out 
exception (which again is misleading)

I am also attaching a suggested patch (NOTE: the patch tries to address this 
issue, the function getNetworkInterfaceAddress() needs revision ).


> Setting rpc_interface in cassandra.yaml causes NPE during startup
> -----------------------------------------------------------------
>
>                 Key: CASSANDRA-9208
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-9208
>             Project: Cassandra
>          Issue Type: Bug
>          Components: Config
>         Environment: Windows and RHEL
>            Reporter: Sandeep More
>              Labels: easyfix, patch
>         Attachments: SuggestedDataBaseDescriptor.diff
>
>
> In the cassandra.yaml file when "rpc_interface" option is set it causes a NPE 
> (stack trace at the end).
> Upon further investigation it turns out that there is a serious problem is in 
> the way this logic is handled in the code DatabaseDescriptor.java (#374).
> Following is the code snippet 
>  else if (conf.rpc_interface != null)
>         {
>             listenAddress = getNetworkInterfaceAddress(conf.rpc_interface, 
> "rpc_interface");
>         }
>         else
>         {
>             rpcAddress = FBUtilities.getLocalAddress();
>         }
> If you notice, 
> 1) The code above sets the "listenAddress" instead of "rpcAddress".  
> 2) The function getNetworkInterfaceAddress() blindly assumes that this is 
> called to set the "listenAddress" (see line 171). The "configName" variable 
> passed to the function is royally ignored and only used for printing out 
> exception (which again is misleading)
> I am also attaching a suggested patch (NOTE: the patch tries to address this 
> issue, the function getNetworkInterfaceAddress() needs revision ).
> INFO  15:36:56 Windows environment detected.  DiskAccessMode set to standard, 
> indexAccessMode standard
> INFO  15:36:56 Global memtable on-heap threshold is enabled at 503MB
> INFO  15:36:56 Global memtable off-heap threshold is enabled at 503MB
> ERROR 15:37:50 Fatal error during configuration loading
> java.lang.NullPointerException: null
>         at 
> org.apache.cassandra.config.DatabaseDescriptor.applyConfig(DatabaseDescriptor.java:411)
>  ~[apache-cassandra-2.1.4.jar:2.1.4]
>         at 
> org.apache.cassandra.config.DatabaseDescriptor.<clinit>(DatabaseDescriptor.java:133)
>  ~[apache-cassandra-2.1.4.jar:2.1.4]
>         at 
> org.apache.cassandra.service.CassandraDaemon.setup(CassandraDaemon.java:164) 
> [apache-cassandra-2.1.4.jar:2.1.4]
>         at 
> org.apache.cassandra.service.CassandraDaemon.activate(CassandraDaemon.java:533)
>  [apache-cassandra-2.1.4.jar:2.1.4]
>         at 
> org.apache.cassandra.service.CassandraDaemon.main(CassandraDaemon.java:622) 
> [apache-cassandra-2.1.4.jar:2.1.4]
> null
> Fatal error during configuration loading; unable to start. See log for 
> stacktrace.



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

Reply via email to