Description of problem: RHQ agent if not run as root user fails to discover Cassandra processes because of this error: 2014-07-30 18:26:25,640 WARN [InventoryManager.discovery-1] (InventoryManager)- Failure during discovery for [RHQ Storage Node] Resources - failed after 11 ms. java.lang.Exception: Discovery component invocation failed. at org.rhq.core.pc.util.DiscoveryComponentProxyFactory$ComponentInvocationThread.call(DiscoveryComponentProxyFactory.java:309) at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303) at java.util.concurrent.FutureTask.run(FutureTask.java:138) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) at java.lang.Thread.run(Thread.java:662) Caused by: org.rhq.cassandra.util.ConfigEditorException: Failed to create /cassandra/d1/conf/.cassandra.yaml.bak at org.rhq.cassandra.util.ConfigEditor.createBackup(ConfigEditor.java:84) at org.rhq.cassandra.util.ConfigEditor.load(ConfigEditor.java:42) at org.rhq.plugins.cassandra.CassandraNodeDiscoveryComponent.getDetails(CassandraNodeDiscoveryComponent.java:152) at org.rhq.plugins.cassandra.CassandraNodeDiscoveryComponent.scanForResources(CassandraNodeDiscoveryComponent.java:84) at org.rhq.plugins.storage.StorageNodeDiscoveryComponent.discoverResources(StorageNodeDiscoveryComponent.java:53) at sun.reflect.GeneratedMethodAccessor9173.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.rhq.core.pc.util.DiscoveryComponentProxyFactory$ComponentInvocationThread.call(DiscoveryComponentProxyFactory.java:305) ... 5 more Caused by: java.io.FileNotFoundException: /cassandra/d1/conf/.cassandra.yaml.bak (Permission denied) at java.io.FileOutputStream.open(Native Method) at java.io.FileOutputStream.<init>(FileOutputStream.java:194) at java.io.FileOutputStream.<init>(FileOutputStream.java:145) at org.rhq.cassandra.util.ConfigEditor.copyFile(ConfigEditor.java:183) at org.rhq.cassandra.util.ConfigEditor.createBackup(ConfigEditor.java:82) ... 13 more Note that this instance of Cassandra is NOT managed by RHQ (not an RHQ storage node). The fix is to only do the backup if the settings are saved. Patch coming...
Created attachment 1042887 [details] May have been covered in another diff?