Bug 536170 (RHQ-549)

Summary: PluginContainerException after uninventoring a JBoss AS resource
Product: [Other] RHQ Project Reporter: fmatar
Component: AgentAssignee: RHQ Project Maintainer <rhq-maint>
Status: CLOSED CURRENTRELEASE QA Contact: Sunil Kondkar <skondkar>
Severity: medium Docs Contact:
Priority: medium    
Version: 1.0CC: cwelton
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: All   
URL: http://jira.rhq-project.org/browse/RHQ-549
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-09-02 03:24:17 EDT Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Description fmatar 2008-06-09 12:16:00 EDT
After uninventoring a JBoss AS resource, the agent throws an exception every 30 seconds. The exception is as follows:

2008-06-09 17:53:58,509 INFO  [Content.discovery-1] (rhq.core.pc.content.ContentDiscoveryRunner)- Rescheduling discovery: ScheduledContentDiscoveryInfo[ResourceId=502050, PackageType=cumulativePatch, Interval=43200000, NextDiscovery=1213026720435, Now=1213026838509]
2008-06-09 17:54:06,176 INFO  [InventoryManager.availability-1] (rhq.core.pc.inventory.InventoryManager)- Sending availability report to server
2008-06-09 17:54:26,318 INFO  [MeasurementManager.collector-1] (rhq.core.pc.measurement.MeasurementCollectorRunner)- Collection of measurements for [org.rhq.plugins.platform.LinuxPlatformComponent@1fd1c60] took [2004ms]
2008-06-09 17:54:28,492 INFO  [MeasurementManager.sender-1] (rhq.core.pc.measurement.MeasurementCollectorRunner)- Measurement collection for [10] metrics took 2005ms - sending report to Server...
2008-06-09 17:54:28,508 WARN  [Content.discovery-1] (rhq.core.pc.content.ContentDiscoveryRunner)- Content discovery is falling behind. Missed discovery by: 148073ms
2008-06-09 17:54:28,508 INFO  [Content.discovery-1] (rhq.core.pc.content.ContentDiscoveryRunner)- Performing discovery: ScheduledContentDiscoveryInfo[ResourceId=502050, PackageType=library, Interval=43200000, NextDiscovery=1213026720435, Now=1213026868508]
2008-06-09 17:54:28,508 WARN  [Content.discovery-1] (rhq.core.pc.content.ContentDiscoveryRunner)- Exception received from component while attempting content retrieve
org.rhq.core.clientapi.agent.PluginContainerException: Resource component container could not be retrieved for resource: 502050
	at org.rhq.core.pc.util.ComponentUtil.getComponent(ComponentUtil.java:97)
	at org.rhq.core.pc.content.ContentManager.performContentDiscovery(ContentManager.java:396)
	at org.rhq.core.pc.content.ContentDiscoveryRunner.call(ContentDiscoveryRunner.java:118)
	at org.rhq.core.pc.content.ContentDiscoveryRunner.run(ContentDiscoveryRunner.java:85)
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:417)
	at java.util.concurrent.FutureTask$Sync.innerRunAndReset(FutureTask.java:280)
	at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:135)
	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$101(ScheduledThreadPoolExecutor.java:65)
	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.runPeriodic(ScheduledThreadPoolExecutor.java:142)
	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:166)
	at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:650)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:675)
	at java.lang.Thread.run(Thread.java:595)

The exception disappears after running discovery -f on the agent. 

Steps to reproduce: 
1. Run a JBoss AS instance 
2. Import a secured JBoss AS instance the resource (JBoss AS 4.2.2.GA)
3. Uninventory the imported resource in step 2. 
Comment 1 Jason Dobies 2008-06-09 12:23:53 EDT
I'm guessing the InventoryManager isn't correctly firing off resource removed events for uninventory. That's preventing the content discovery schedules from being cancelled. When the schedule for the uninventoried resource comes up again, it bombs getting the resource component to actually make the discovery call. I believe that will cause it to be rescheduled, but otherwise causes no issues short of this error message repeating in inventory.

If discovery -f causes it to disappear, I'm guessing the hook to resource removed still exists in the resource discovery comparison. We just need to add it to the uninventory call.
Comment 2 Joseph Marques 2008-07-19 19:51:56 EDT
jdob, good analysis.  i think it is relatively important to fix sooner rather than later, since we uninventory resources all the time during development.  
Comment 3 Joseph Marques 2008-09-15 09:40:40 EDT
setting to blocker so it gets on the 1.1.0 triage radar.  i wonder if and how easily this is still reproduced.
Comment 4 Greg Hinkle 2008-10-01 16:11:51 EDT
I just tested this against the latest build and did not see this problem. We'll plan to investigate the uninventory listener for the next release.
Comment 5 Red Hat Bugzilla 2009-11-10 16:11:38 EST
This bug was previously known as http://jira.rhq-project.org/browse/RHQ-549
This bug relates to RHQ-711
Comment 6 Corey Welton 2010-08-12 16:03:15 EDT
Moving to ON_QA -- please test this and see if the behavior is still exhibited.  reopen if so, otherwise close.
Comment 7 Sunil Kondkar 2010-08-13 09:54:54 EDT
Tested on JON 2.4 GA

No exception is observed in agent log after uninventoring a JBoss AS resource.
Comment 8 Heiko W. Rupp 2013-09-02 03:24:17 EDT
Bulk closing of issues that were VERIFIED, had no target release and where the status changed more than a year ago.