Bug 1029925

Summary: upgrading a server but installing new agent puts agent in wrong place
Product: [JBoss] JBoss Operations Network Reporter: John Mazzitelli <mazz>
Component: InstallerAssignee: John Mazzitelli <mazz>
Status: CLOSED CURRENTRELEASE QA Contact: Mike Foley <mfoley>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: JON 3.2CC: jshaughn
Target Milestone: ER07   
Target Release: JON 3.2.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-01-02 20:43:12 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:

Description John Mazzitelli 2013-11-13 14:31:56 UTC
I'm writing this up in a BZ because I am not sure what the correct thing to do is. I think this might be wrong.

1. Install an older version but only install the server (say JON 3.1.2 Server)
2. Unzip a new version (say JON 3.2.ER5)
3. Upgrade the old version  via rhqctl upgrade --from-server-dir=<3.1.2 location>
4. Notice where the agent is installed.

If the 3.1.2 was installed here:

   /opt/jon/3.1.2/jon-server-3.1.2

and the new 3.2 was installed here:

   /opt/jon/3.2

the new agent ended up getting installed here:

   /opt/jon/3.1.2/rhq-agent

Now, notice it got installed in the parent directory of the old server (the old server was in 3.1.2/jon-server-3.1.2, the parent is thus 3.1.2 and therefore the agent went under there).

This doesn't seem right. Should the new agent go under /opt/jon (i.e. /opt/jon/rhq-agent) since the new server's install dir is /opt/jon/3.2 and thus its parent dir is /opt/jon?

Note that the storage node was installed in /opt/jon/rhq-data

Comment 1 Jay Shaughnessy 2013-11-13 14:35:35 UTC
Yeah, this seems wrong to me.  I would expect the agent to end up in:

/opt/jon/rhq-agent

Comment 2 John Mazzitelli 2013-11-13 15:26:50 UTC
In Upgrade.java, line 623, there is this:

   installAgent(oldAgentDir, rhqctlCommandLine);

Notice it is installing the agent in the old agent location (where we looked for the old agent to be installed).

But if the agent isn't installed there (that is, the old server being upgraded didn't also have an agent installed), then we want to install a new agent in the new expected location. So I think this line needs to change to:

   installAgent(getAgentBasedir(), rhqctlCommandLine);

Comment 3 John Mazzitelli 2013-11-13 16:44:29 UTC
master commit: 9e88f665a6306096e4eb556dc0521e11093d0742
release/jon3.2.x commit: d227e1504c6f5ea40b395c76df1fc11bee3d2af0

Comment 4 Simeon Pinder 2013-11-19 15:47:58 UTC
Moving to ON_QA as available for testing with new brew build.

Comment 5 Simeon Pinder 2013-11-22 05:13:34 UTC
Mass moving all of these from ER6 to target milestone ER07 since the ER6 build was bad and QE was halted for the same reason.