Bug 1124969 - org.rhq.cassandra.util.ConfigEditor cannot be used on files owned by another user
Summary: org.rhq.cassandra.util.ConfigEditor cannot be used on files owned by another ...
Keywords:
Status: NEW
Alias: None
Product: RHQ Project
Classification: Other
Component: Agent
Version: 4.12
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
: ---
Assignee: Nobody
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-07-30 18:41 UTC by Elias Ross
Modified: 2022-03-31 04:28 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed:
Embargoed:


Attachments (Terms of Use)
May have been covered in another diff? (6.43 KB, patch)
2015-06-24 23:33 UTC, Elias Ross
no flags Details | Diff

Description Elias Ross 2014-07-30 18:41:23 UTC
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...

Comment 1 Elias Ross 2015-06-24 23:33:05 UTC
Created attachment 1042887 [details]
May have been covered in another diff?


Note You need to log in before you can comment on or make changes to this bug.