Bug 601460 - on Windows, RHQ_AGENT env vars get updated in parent cmd.exe window by Agent upgrade install
Summary: on Windows, RHQ_AGENT env vars get updated in parent cmd.exe window by Agent ...
Alias: None
Product: RHQ Project
Classification: Other
Component: Agent   
(Show other bugs)
Version: 1.3.1
Hardware: All
OS: Windows
low vote
Target Milestone: ---
: ---
Assignee: RHQ Project Maintainer
QA Contact: Mike Foley
Depends On:
TreeView+ depends on / blocked
Reported: 2010-06-08 02:49 UTC by Ian Springer
Modified: 2014-05-29 19:37 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2014-05-29 19:37:04 UTC
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)
agent update log (contains multiple install/update runs) (987.51 KB, text/x-log)
2010-06-08 02:51 UTC, Ian Springer
no flags Details
not sure if this has any relevance, but attaching just in case (it was in the /opt dir, which was what I passed as the arg to --install) (112 bytes, text/x-log)
2010-06-08 02:52 UTC, Ian Springer
no flags Details

Description Ian Springer 2010-06-08 02:49:19 UTC
I ran:

java -jar rhq-enterprise-agent-3.0.0.Beta1.jar --install=C:\opt 

to install the 3.0.0.Beta1 Agent. There was already an Agent installed on the box in C:\opt\rhq-agent, but I'm not sure whether it was running or not.

I just remembered that the Agent start bat file will use RHQ_AGENT_HOME, rather than its parent dir, as the Agent dir, if that env var is set. I checked the env vars in my current command window and sure enough the following vars were set:

 RHQ_AGENT_JAVA_OPTS=-Xms64m -Xmx128m -Djava.net.preferIPv4Stack=true

C:\opt\rhq-agent-OLD is where the 1.2.0.GA Agent is installed, which explains the "RHQ 1.2.0.GA [3862] (Mon Apr 27 16:55:22 EDT 2009)" printed when the Agent starts up (even though I'm starting it from C:\opt\rhq-agent which is a 3.0.0.Beta1 install). I didn't set these variables myself, so I'm guessing either the upgrade/install process or the start bat file set them and not from within a SETLOCAL/ENDLOCAL block, so they got updated in the enclosing command window. I would check carefully that anywhere you set RHQ_AGENT_* env vars is enclosed in SETLOCAL/ENDLOCAL.

My Agent updater/installer logs are attached.

Comment 1 Ian Springer 2010-06-08 02:51:08 UTC
Created attachment 421996 [details]
agent update log (contains multiple install/update runs)

Comment 2 Ian Springer 2010-06-08 02:52:18 UTC
Created attachment 421997 [details]
not sure if this has any relevance, but attaching just in case (it was in the /opt dir, which was what I passed as the arg to --install)

Comment 3 John Mazzitelli 2010-06-08 16:23:15 UTC
Ian, can you confirm the commands you ran. The only way for the "-OLD" directories to be created was if you did a "--upgrade". So, I think somewhere along the line, you did an --upgrade. Do you know for sure if you did?

Comment 4 John Mazzitelli 2010-06-08 16:30:23 UTC
I also think this might have something to do with the errors in the log about not being able to delete files. I suspect another command window (or some other process) had a current working directory of the C:\opt\rhq-agent (or subdirectory) and thus had it locked (i.e. windows won't be able to delete it). This looks to cause the install/update to encounter an error and try to roll back the install.

Comment 5 John Mazzitelli 2010-06-08 16:39:58 UTC
I just saw one thing that may explain this.

If you --install the 1.2 agent in C:\opt, then you --install (NOT update) the 3.0 agent in the same C:\opt, this is bad and you will get overlapping agents (e.g. I see both rhq-core-enterprise-agent.jars from both 1.2 and 3.0 - which is bad and makes it look like the agent you are running is still the 1.2 version becaues that jar is picked up first).

You must not --install twice in the same directory - if you already have an agent installed in C:\opt, you can "overlay" an agent in the same location, but you must use the --update.

(I still haven't been able to replicate the environment variables getting set in my console.)

I'm on Windows XP.

Comment 6 John Mazzitelli 2010-08-24 17:20:47 UTC
unassigning and lowering severity. I've not been able to reproduce this. Should get someone else to attempt to reproduce to see if its really a problem or not.

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