Bug 781586 - Agent update results in environment specific configuration being lost
Summary: Agent update results in environment specific configuration being lost
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: RHQ Project
Classification: Other
Component: Installer
Version: 4.2
Hardware: Unspecified
OS: Unspecified
medium
high
Target Milestone: ---
: ---
Assignee: John Mazzitelli
QA Contact: Mike Foley
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2012-01-13 19:38 UTC by Larry O'Leary
Modified: 2018-11-26 18:06 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
JON 2.4.1 upgraded to JON 3.0.0
Last Closed: 2012-02-14 14:42:08 UTC
Embargoed:


Attachments (Terms of Use)

Description Larry O'Leary 2012-01-13 19:38:46 UTC
Description of problem:
When an agent is upgraded either manually or using the agent auto-update process, agent specific configuration for the host environment is discarded. Some examples:

JON 2.4.1 Agent installed and the Java Preference node is defined in the rhq-agent-env.sh script. When JON 3.0.0 agent update is applied it no longer functions due to it not knowing its Java Preference node name because the JON 3.0.0 install overwrites the user's environment specific configuration.

JON 2.4.1 Agent installed and the maximum JVM heap size has been increased to 512MB due to hundreds of resources being managed by setting -Xmx in RHQ_AGENT_JAVA_OPTS located in rhq-agent-env.sh. When JON 3.0.0 agent update is applied it will crash every few hours or days due to insufficient JVM memory because the JON 3.0.0 install overwrites the user's environment specific configuration.

JON 2.4.1 Agent installed using a silent install/configuration defined in agent-configuration.xml. When JON 3.0.0 update is applied, the agent continues to use the configuration from 2.4.1 but if a re-config is performed on the JON 3.0.0 agent it will revert to the GA install of JON 3.0.0 instead of using the customer install because the contents of agent-configuration.xml has been replaced with the JON 3.0.0 default copy.

JON 2.4.1 Agent has its log4j configuration modified to reduce the verboseness of an installed plug-in. When JON 3.0.0 is installed, the log4j configuration is discarded and the default configuration is used.

Version-Release number of selected component (if applicable):
JON 2.4.1, JON 3.0.0

How reproducible:
Always

Steps to Reproduce:
1. Install JON 2.4.1 system (server/agent)
2. Update JON agent's rhq-agent-env.sh RHQ_AGENT_JAVA_OPTS environment variable to include -Xmx1024m and ensure it is uncommented
3. Start JON agent and register it with JON server
4. Upgrade JON 2.4.1 installation to JON 3.0.0

After server minutes, the JON agent should have been auto-updated to JON 3.0.0
  
Actual results:
JON agent's max heap (-Xmx) is set to 128m

Expected results:
JON agent's max heap (-Xmx) remains at 1024m

Comment 1 John Mazzitelli 2012-02-13 15:42:38 UTC
i'll test this - auto-upgrade SHOULD be copying over the original _env.sh script for this very purpose - to maintain customized environment settings. We specifically tell people that they can cusotmize the _env.sh, just not the main launcher scripts:

http://rhq-project.org/display/JOPR2/RHQ+Agent+Installation#RHQAgentInstallation-DoNotAlterTheLauncherScripts

Comment 2 John Mazzitelli 2012-02-13 17:59:46 UTC
FYI: I ran a quick test on my master branch, I edited rhq-agent-env.sh, forced a agent auto-upgrade, and the rhq-agent-env.sh changes were still there.

Comment 3 Larry O'Leary 2012-02-13 18:31:39 UTC
(In reply to comment #2)
> FYI: I ran a quick test on my master branch, I edited rhq-agent-env.sh, forced
> a agent auto-upgrade, and the rhq-agent-env.sh changes were still there.

I this is the case, you can reject this as not able to reproduce. From the looks of it, the person who originally reported the error was not clear on where they edited the JVM options and I did not attempt to reproduce as I should have. My guess is that they were editing the start script directly.

Sorry about the false alarm.

Comment 4 John Mazzitelli 2012-02-14 14:42:08 UTC
while the -env scripts are maintained, the one item in the description has never been intended to be supported:

> JON 2.4.1 Agent has its log4j configuration modified to reduce the verboseness
> of an installed plug-in. When JON 3.0.0 is installed, the log4j configuration
> is discarded and the default configuration is used.

We do not maintain log4j changes across upgrades. If a customer has a custom log4j file, the solution is that they should prepare a custom agent distribution and install it in the server so when agents auto-upgrade themselves, they can pick up the custom log4j.xml.

see

http://rhq-project.org/display/JOPR2/Preconfiguring+the+Agent#PreconfiguringtheAgent-BuildingYourOwnPreconfiguredAgentBundle

for how to prepare a preconfigured agent bundle.

But as it is, the agent update is working as expected. You only add environment customizations in the -env scripts.


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