Bug 659604

Summary: JBossAS5 server gets discovered and deleted after running discovery command from agent prompt
Product: [Other] RHQ Project Reporter: Sudhir D <sdharane>
Component: AgentAssignee: RHQ Project Maintainer <rhq-maint>
Status: CLOSED CURRENTRELEASE QA Contact: Corey Welton <cwelton>
Severity: medium Docs Contact:
Priority: low    
Version: 3.0.0CC: hrupp, phyrefyter, skondkar
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-05-24 01:12:45 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 616081, 625146    

Description Sudhir D 2010-12-03 07:08:59 UTC
Description of problem:
JBoss AS 5 Server discovery fails on the Fedora 12 box.

Version-Release number of selected component (if applicable):
jon-server-2.4.1-SNAPSHOT build# 34.

How reproducible:
Always

Steps to Reproduce:
1. Install JON Server on RHEL 5.5. Ensure that JBoss AS 5 plugins are present.
2. Install the Agent on Fedora 12.
3. Inventory the newly installed Agent on the Server Dashboard.
4. Start JBoss AS 5 where the Agent is running (Fedora 12)
5. From the agent prompt, run discovery.
  
Actual results:
JBoss AS 5 server gets discovered but it also says deleted.

Below is the PID for JBoss AS 5 server,
sdharane  9123  9036  0 11:25 pts/1    00:00:00 /bin/sh ./run.sh -b 0.0.0.0
sdharane  9148  9123  3 11:25 pts/1    00:00:51 java -Dprogram.name=run.sh -Xms128m -Xmx512m -XX:MaxPermSize=256m -Dorg.jboss.resolver.warning=true -Dsun.rmi.dgc.client.gcInterval=3600000 -Dsun.rmi.dgc.server.gcInterval=3600000 -Djava.net.preferIPv4Stack=true -Djava.endorsed.dirs=/home/sdharane/Downloads/JBoss/jboss-5.0.0.GA/lib/endorsed -classpath /home/sdharane/Downloads/JBoss/jboss-5.0.0.GA/bin/run.jar org.jboss.Main -b 0.0.0.0

Output of agent command prompt when discovery command is run,
> discovery
RHQAgent.RHQ Agent: Starting discovery...
RHQAgent.RHQ Agent: key=[RHQ Agent], name=[RHQ Agent], version=[3.0.1-SNAPSHOT], description=[RHQ Management Agent]
RHQAgent.RHQ Agent: Done.

Tomcat.Tomcat Server: Starting discovery...
Tomcat.Tomcat Server: Done.

Apache.Apache HTTP Server: Starting discovery...
Apache.Apache HTTP Server: Done.

JBossAS5.JBossAS Server: Starting discovery...
JBossAS5.JBossAS Server: Process scan detected a server - scan=[ProcessScan: query=[process|basename|match=^java.*,arg|org.jboss.Main|match=.*], name=[jbossas]], process=[process: pid=[9148], name=[/usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0.x86_64/jre/bin/java (deleted)], ppid=[9123]]
JBossAS5.JBossAS Server: Done.

JBossAS.JBossAS Server: Starting discovery...
JBossAS.JBossAS Server: Process scan detected a server - scan=[ProcessScan: query=[process|basename|match=^java.*,arg|org.jboss.Main|match=.*], name=[JBoss4]], process=[process: pid=[9148], name=[/usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0.x86_64/jre/bin/java (deleted)], ppid=[9123]]
JBossAS.JBossAS Server: Done.

Script.Script Server: Starting discovery...
Script.Script Server: Done.

Postgres.Postgres Server: Starting discovery...
Postgres.Postgres Server: Done.

IIS.IIS: Starting discovery...
IIS.IIS: Done.

JMX.JMX Server: Starting discovery...
JMX.JMX Server: Process scan detected a server - scan=[ProcessScan: query=[process|basename|match=^java.*], name=[java]], process=[process: pid=[8991], name=[/usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0.x86_64/jre/bin/java (deleted)], ppid=[8978]]
JMX.JMX Server: Process scan detected a server - scan=[ProcessScan: query=[process|basename|match=^java.*], name=[java]], process=[process: pid=[9148], name=[/usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0.x86_64/jre/bin/java (deleted)], ppid=[9123]]
JMX.JMX Server: Done.


The log snippet of agent.log,
agent.log:2010-12-03 11:39:22,405 INFO  [InventoryManager.discovery-1] (rhq.core.pc.inventory.AutoDiscoveryExecutor)- Process scan auto-detected new server resource: scan=[ProcessScan: query=[process|basename|match=^java.*], name=[java]], discovered-process=[process: pid=[9148], name=[/usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0.x86_64/jre/bin/java (deleted)], ppid=[9123]]


Expected results:
JBoss AS 5 should be discovered and be available for inventory.

Comment 1 Charles Crouch 2010-12-13 22:52:06 UTC
I'm ok with this not getting fixed in 2.4.1 if the workaround is just to restart the agent. Can you test that Sudhir?

Comment 2 Heiko W. Rupp 2010-12-21 13:11:08 UTC
Sudhir,
what is the output of 'discovery --full' ? Is the AS then offered for import?
I have the impression, that pure 'discovery' without arguments is just checking for stuff, but not actually
offering to the server (never looked this up in source though).

'discovery --full' would be the equivalent of restarting here, as a restart would reset the timers for AD-runs and directly after PC initialization trigger an AD run.

Comment 3 Sunil Kondkar 2010-12-22 12:53:34 UTC
Verified on Fedora 12 box on Jon241 build#55 (build number: 10970:3cea406)

1. Installed JON Server.
2. Installed the Agent on Fedora 12.
3. Inventoried the newly installed Agent on the Server Dashboard.
4. Started JBoss AS 5 where the Agent is running (Fedora 12)
5. From the agent prompt, executed 'discovery --full'.

The JBoss AS 5 server is auto discovered successfully.
Marking this as verified.

Comment 4 David Tardon 2011-01-13 06:29:24 UTC
*** Bug 669261 has been marked as a duplicate of this bug. ***

Comment 5 Corey Welton 2011-05-24 01:12:45 UTC
Bookkeeping - closing bug - fixed in recent release.

Comment 6 Corey Welton 2011-05-24 01:12:45 UTC
Bookkeeping - closing bug - fixed in recent release.

Comment 7 Corey Welton 2011-05-24 01:13:02 UTC
Bookkeeping - closing bug - fixed in recent release.