Bug 1098705

Summary: NPE in CassandraNodeDiscoveryComponent when cassandra has root as working directory
Product: [Other] RHQ Project Reporter: Markus Grieder <markus>
Component: PluginsAssignee: Nobody <nobody>
Status: NEW --- QA Contact:
Severity: medium Docs Contact:
Priority: unspecified    
Version: 4.11, 4.12CC: hrupp
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
Stacktrace NullPointerException none

Description Markus Grieder 2014-05-17 13:47:15 UTC
Created attachment 896600 [details]
Stacktrace NullPointerException

Description of problem:
NullPointerException in CassandraNodeDiscoveryComponent when Cassandra (separate installation, not the rhq storage node) was started with working directory '/' -> See attached Stacktrace

Version-Release number of selected component (if applicable): 4.11 / master

How reproducible:
To force the problem change the working directory to '/' in 'cassandra.in.sh': add 'cd /' at the end.


Steps to Reproduce:
1. Start Cassandra with working directory '/' (for example do "service cassandra start" after installing with http://www.datastax.com/documentation/cassandra/2.0/cassandra/install/installRHEL_t.html ) or manually set the working directory to '/' in 'cassandra.in.sh'
2. Wait for next discovery of the rhq agent on the same plattform.
3. -> NPE is visible in RHQ-Agent log and Cassandra is not available in inventory for import.

Actual results:
Cassandra is only available in the inventory when the working directory is not the root directory.

Expected results:
When Cassandra is started as service it could be normal that '/' is the working directory. 'CassandraNodeDiscoveryComponent' is assuming that the working directory is the bin-directory of cassandra -> Possible solution: If the current directory has no parent directory use the current directory as basedir.