Bug 892047

Summary: AS7 plug-in is unable to discover EAP 6 server installed from RPM
Product: [JBoss] JBoss Operations Network Reporter: Larry O'Leary <loleary>
Component: Plugin -- JBoss EAP 6Assignee: RHQ Project Maintainer <rhq-maint>
Status: CLOSED DEFERRED QA Contact: Mike Foley <mfoley>
Severity: high Docs Contact:
Priority: medium    
Version: JON 3.1.1CC: myarboro
Target Milestone: ---Keywords: Triaged
Target Release: JON 3.3.0   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 917861 (view as bug list) Environment:
JBoss ON 3.1.1 agent with AS7 plug-in installed EAP 6 domain controller installed and running from jbossas-domain-7.1.3-4.Final_redhat_4.ep6.el6.noarch RPM
Last Closed: 2014-07-14 23:03:47 UTC 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:
Bug Depends On: 1119496    
Bug Blocks: 917861, 1088652    

Description Larry O'Leary 2013-01-04 23:47:11 UTC
Description of problem:
After starting installing and starting EAP 6 from RPM, agent with AS7 plug-in is unable to discover it and throws the following error:

ERROR [ResourceDiscoveryComponent.invoker.daemon-1] (rhq.modules.plugins.jbossas7.HostControllerDiscovery)- Discovery of a JBossAS7 Host Controller Resource failed for process: pid=[2836], name=[/etc/alternatives/jre/bin/java], ppid=[2810] - cause: java.lang.Exception: Server configuration file not found at the expected location (/usr/share/jbossas/domain/configuration/host-slave.xml).


Version-Release number of selected component (if applicable):
4.4.0.JON311GA

How reproducible:
Always

Steps to Reproduce:
1.  On RHEL 6 system, install EAP 6 from RPM:

        # JBoss EAP RPMs
        _rhnUser=admin
        _rhnPassword=redhat
        _jbappplatform=$(rhn-channel -L -u {_rhnUser} -p ${_rhnPassword} | grep jbappplatform)
        rhn-channel --add -c ${_jbappplatform} -u {_rhnUser} -p ${_rhnPassword}
        # RPM version is very important.
        # Problem occurs starting with EAP RPM 7.1.3-4
        yum -y install yum install jbossas-domain-7.1.3-4.Final_redhat_4.ep6.el6.noarch

2.  Start EAP 6 domain service

        sudo service jbossas-domain start
        
3.  Start JBoss ON agent using a different user/group then what is being used by EAP

    You can not use root or any account that is a member of the jboss group. Such as what happens when running JON agent from RPM install and starting it as a service.
  
Actual results:
EAP6 host controller does not get discovered and the following error is logged in agent.log:

    ERROR [ResourceDiscoveryComponent.invoker.daemon-1] (rhq.modules.plugins.jbossas7.HostControllerDiscovery)- Discovery of a JBossAS7 Host Controller Resource failed for process: pid=[2836], name=[/etc/alternatives/jre/bin/java], ppid=[2810] - cause: java.lang.Exception: Server configuration file not found at the expected location (/usr/share/jbossas/domain/configuration/host.xml).

Expected results:
EAP6 host controller should be discovered and appear in the discovery queue.

Additional info:
This issue is a direct result of directory permissions used by EAP's RPM. By default, starting in 7.1.3-4, /var/lib/jbossas/domain (and other directories) are not world-readable. This means, unless the RHQ agent is started by root or a user who is a member of the jboss group, the AS7 plug-in will not be able to read the configuration files from the file system.

Prior to 7.1.3-4, directories were world-readable meaning that we would not see this unless testing with the latest RPM version released in late November 2012.

Comment 1 Larry O'Leary 2013-01-08 17:32:43 UTC
This might be as simple as JBoss ON documenting that if using the EAP 6 RPM, the user who starts the agent must be added to the OS group 'jboss'. Additionally, we might want to do this automatically with the JBoss ON agent RPM.

Comment 3 Larry O'Leary 2014-02-14 01:54:48 UTC
Re-targeted to CP02 to reduce CP01 overall payload.

Comment 4 Larry O'Leary 2014-07-14 23:03:47 UTC
Product documentation has been updated by BZ-917861 to instruct the user that the JBoss ON agent user must be a member of the group or ACL list for the managed server.

BZ-1119496 has been created to request the agent RPM be updated to automatically take care of adding the jboss group and adding the jbosson-agent user to said group to prevent the user from having to do this in the event they are strictly using RPMs for JBoss ON agent and JBoss managed products.

Closing this BZ as DEFERRED.