Bug 1074610

Summary: JON 3.2.0 install fails if the install user account has no home directory
Product: [JBoss] JBoss Operations Network Reporter: Lami Akagwu <lakagwu>
Component: InstallerAssignee: Libor Zoubek <lzoubek>
Status: CLOSED CURRENTRELEASE QA Contact: Sunil Kondkar <skondkar>
Severity: high Docs Contact:
Priority: unspecified    
Version: JON 3.2CC: lzoubek, skondkar, theute
Target Milestone: DR01   
Target Release: JON 3.3.0   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-12-11 14:04:35 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:

Description Lami Akagwu 2014-03-10 16:05:28 UTC
Description of problem:

Start installation using rhqctl install --start
Console error during agent installation
----

INFO  [org.rhq.server.control.command.Install] Configuring the RHQ agent with default configuration file: /opt/jboss/jon/rhq-agent/conf/agent-configuration.xml
ERROR [org.rhq.server.control.command.Install] An error occurred while configuring the agent: Couldn't get file lock.
ERROR [org.rhq.server.control.RHQControl] Couldn't get file lock.
----
Full agent console log snippet

===== RHQ AGENT INSTALL =====
Installing Agent To: /opt/jboss/jon
Version: 4.9.0.JON320GA
Build Number: 734bd56
Jar File: /opt/jboss/jon/jon-server-3.2.0.GA/modules/org/rhq/server-startup/main/deployments/rhq.ear/rhq-downloads/rhq-agent/rhq-enterprise-agent-4.9.0.JON320GA.jar
[install] [echo] Extract the agent distro zip from the agent update binary
[install] [unjar] Expanding: /opt/jboss/jon/jon-server-3.2.0.GA/modules/org/rhq/server-startup/main/deployments/rhq.ear/rhq-downloads/rhq-agent/rhq-enterprise-agent-4.9.0.JON320GA.jar into /opt/jboss/jon/jon-server-3.2.0.GA
[install] [echo] Unzip the agent distro into the new installation directory
[install] [unzip] Expanding: /opt/jboss/jon/jon-server-3.2.0.GA/rhq-enterprise-agent-4.9.0.JON320GA.zip into /opt/jboss/jon
[install] [echo] chmod +x on executables under /opt/jboss/jon/rhq-agent
[install] [echo] Remove the agent distro zip
[install] [delete] Deleting: /opt/jboss/jon/jon-server-3.2.0.GA/rhq-enterprise-agent-4.9.0.JON320GA.zip
[install] [echo] DONE! Agent version 4.9.0.JON320GA (build number=734bd56) has been installed to /opt/jboss/jon
10:47:23,003 INFO  [org.rhq.server.control.command.Install] The agent installer finished running with exit value 0
10:47:23,004 INFO  [org.rhq.server.control.command.Install] Configuring the RHQ agent with default configuration file: /opt/jboss/jon/rhq-agent/conf/agent-configuration.xml
10:47:24,579 ERROR [org.rhq.server.control.command.Install] An error occurred while configuring the agent: Couldn't get file lock.
10:47:24,581 ERROR [org.rhq.server.control.RHQControl] Couldn't get file lock.
10:47:24,582 WARN  [org.rhq.server.control.command.Install] UNDO: Removing agent install directory
10:47:24,599 WARN  [org.rhq.server.control.command.Install] UNDO: Removing server-installed marker file and management user
10:47:24,600 WARN  [org.rhq.server.control.command.Install] UNDO: Stopping component: --server
Trying to stop the RHQ Server...
RHQ Server (pid=11557) is stopping..

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


How reproducible:


***Steps to Reproduce:***
As root

1) Create directory in /opt
mkdir /opt/jboss

2) Add group called jboss
groupadd jboss

3) Add user jbossadmin without home directory and assign user to group jboss
useradd -r -s /bin/false -g jboss jonadmin 

4) Grant group jboss rwx /opt/jboss and su jonadmin

5) Unzip JON 3.2.0 to /opt directory
   rhqctl install --start

Actual results:
Agent install fails

Expected results:
If agent install fails the log entry should contain sufficient information to allow the user to fix the problem.

Additional info:
Workaround is to set RHQ_CONTROL_ADDITIONAL_JAVA_OPTS="-Djava.util.prefs.userRoot=/some-path/ but this is not obvious from the console error message

Comment 2 Libor Zoubek 2014-06-30 16:01:40 UTC
in master

commit 9220b2338d26406e547b7e7c68d3747a20d5d5e8
Author: Libor Zoubek <lzoubek>
Date:   Mon Jun 30 17:58:15 2014 +0200

    [BZ 1074610] JON 3.2.0 install fails if the install user account has no home
    directory
    
    Log error message with possible hint when we fail to write agent
    preferences.

Comment 3 Simeon Pinder 2014-07-31 15:52:11 UTC
Moving to ON_QA as available to test with brew build of DR01: https://brewweb.devel.redhat.com//buildinfo?buildID=373993

Comment 4 Sunil Kondkar 2014-08-06 13:51:15 UTC
Verified on JON 3.3 DR01 build.

Agent install fails with below message:

19:16:02,812 ERROR [org.rhq.server.control.command.Install] Failed to store agent preferences, for Linux systems we require writable user.home [/home/jonadmin]. You can also set different location for agent preferences by setting "-Djava.util.prefs.userRoot=/some/path/" java system property. You may need to put this property to RHQ_CONTROL_ADDIDIONAL_JAVA_OPTS and RHQ_AGENT_ADDIDIONAL_JAVA_OPTS env variables.