Bug 760093

Summary: Windows agent does not go UP after JON upgrade 2.4.1 -> 3.0.GA
Product: [Other] RHQ Project Reporter: Libor Zoubek <lzoubek>
Component: AgentAssignee: RHQ Project Maintainer <rhq-maint>
Status: CLOSED NOTABUG QA Contact: Mike Foley <mfoley>
Severity: urgent Docs Contact:
Priority: unspecified    
Version: 4.2CC: hrupp, mazz, theute
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2011-12-05 14:11:13 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Attachments:
Description Flags
agent update screenshot
none
rhq-agent-update.log none

Description Libor Zoubek 2011-12-05 12:15:38 UTC
Created attachment 540833 [details]
agent update screenshot

Description of problem:After server upgrade from 2.4.1 to 3.0.0.GA windows agent refuses to start again

Version-Release number of selected component (if applicable):
Build Number: e23441b:4e746e8

I have installed agent on windows by following these steps (As Administrator):
1. Download jar from <jon server>
2. run %JAVA_HOME\bin\java agent.jar --install
3. cd rhq-agent\bin and start rhq-agent.bat
4. inventoried some resources using JON webUI

I do not have java binary in PATH I have only defined JAVA_HOME, using Oracle JDK 1.6.0.29, not sure if it matters
  
Actual results: After upgrading to 3.0.0 windows agent stays down


Expected results:Agent succesfully upgrates itself and restarts process

Comment 1 Libor Zoubek 2011-12-05 12:26:54 UTC
Created attachment 540840 [details]
rhq-agent-update.log

I've found out, that files of new agent were not extracted, thatswhy rhq-agent.bat could not be found. After taking a look at agent-update.log it seems that upgrading failed because agent was not able to delete current agent dir (there was a cmd running)

So .. not sure it this is a bug or not

Comment 2 Charles Crouch 2011-12-05 13:48:25 UTC
This appears to be related to the agent not been started in the background 
prior to the autoupgrade. Mazz, can you point you at the docs for setting this 
up correctly, but this does not appear to be a blocker right now

Comment 3 John Mazzitelli 2011-12-05 14:21:57 UTC
right, this isn't a bug. you need to prepare your agents at install time to be "upgradable".

Please read this:

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

The short of it is - you need to run the agent as a service (which 99% of the time isn't an issue - in production environments, you will want to run things like the agent as boot time services that start up as background daemons).

Specifically, on Windows if you start the agent like you did, it is expected not to work as you have seen. Read that section of the docs and it will explain what you needed to do.