Bug 856845 - When agent platform has not yet been added to inventory, agent continuously logs WARN Cannot get a resource container for an invalid resource ID=0
When agent platform has not yet been added to inventory, agent continuously l...
Status: CLOSED CURRENTRELEASE
Product: JBoss Operations Network
Classification: JBoss
Component: Agent, Inventory (Show other bugs)
JON 3.1.0
All All
unspecified Severity medium
: ER04
: JON 3.2.0
Assigned To: Thomas Segismont
Mike Foley
:
: 845954 (view as bug list)
Depends On: 856846
Blocks:
  Show dependency treegraph
 
Reported: 2012-09-12 19:02 EDT by Larry O'Leary
Modified: 2014-01-02 15:36 EST (History)
3 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 856846 (view as bug list)
Environment:
Last Closed: 2014-01-02 15:36:21 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
agent.log (59.42 KB, text/x-log)
2013-11-12 06:24 EST, Armine Hovsepyan
no flags Details

  None (edit)
Description Larry O'Leary 2012-09-12 19:02:32 EDT
Description of problem:
The agent log contains the following warning repeatedly:

WARN  [Content.discovery-1] (rhq.core.pc.inventory.InventoryManager)- Cannot get a resource container for an invalid resource ID=0


Version-Release number of selected component (if applicable):
3.1.0

How reproducible:
Always

Steps to Reproduce:
1. Install JON 3.1.0
2. Register agent with server (DO NOT import platform into inventory)
  
Actual results:
Each time discovery is attempted, the warning is logged.

2012-09-12 16:51:01,075 DEBUG [Content.discovery-1] (rhq.core.pc.content.ContentDiscoveryRunner)- Performing discovery: ScheduledContentDiscoveryInfo:resource-id=[0], package-type=[rpm], interval=[43200000], next-discovery=[Wed Sep 12 16:50:01 CDT 2012
2012-09-12 16:51:01,077 WARN  [Content.discovery-1] (rhq.core.pc.inventory.InventoryManager)- Cannot get a resource container for an invalid resource ID=0
2012-09-12 16:51:01,077 DEBUG [Content.discovery-1] (rhq.core.pc.inventory.InventoryManager)- Stack trace follows:
java.lang.Throwable: This is where resource ID=[0] was passed in
	at org.rhq.core.pc.inventory.InventoryManager.getResourceContainer(InventoryManager.java:490)
	at org.rhq.core.pc.util.ComponentUtil.getComponent(ComponentUtil.java:100)
	at org.rhq.core.pc.content.ContentManager.performContentDiscovery(ContentManager.java:420)
	at org.rhq.core.pc.content.ContentDiscoveryRunner.call(ContentDiscoveryRunner.java:123)
	at org.rhq.core.pc.content.ContentDiscoveryRunner.run(ContentDiscoveryRunner.java:90)
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
	at java.util.concurrent.FutureTask$Sync.innerRunAndReset(FutureTask.java:351)
	at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:178)
	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:165)
	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:267)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
	at java.lang.Thread.run(Thread.java:636)
2012-09-12 16:51:01,078 WARN  [Content.discovery-1] (rhq.core.pc.content.ContentDiscoveryRunner)- Exception received from component while attempting content retrieval
org.rhq.core.clientapi.agent.PluginContainerException: Resource component container could not be retrieved for resource: 0
	at org.rhq.core.pc.util.ComponentUtil.getComponent(ComponentUtil.java:102)
	at org.rhq.core.pc.content.ContentManager.performContentDiscovery(ContentManager.java:420)
	at org.rhq.core.pc.content.ContentDiscoveryRunner.call(ContentDiscoveryRunner.java:123)
	at org.rhq.core.pc.content.ContentDiscoveryRunner.run(ContentDiscoveryRunner.java:90)
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
	at java.util.concurrent.FutureTask$Sync.innerRunAndReset(FutureTask.java:351)
	at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:178)
	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:165)
	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:267)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
	at java.lang.Thread.run(Thread.java:636)
2012-09-12 16:51:01,079 WARN  [Content.discovery-1] (rhq.core.pc.inventory.InventoryManager)- Cannot get a resource container for an invalid resource ID=0
2012-09-12 16:51:01,079 DEBUG [Content.discovery-1] (rhq.core.pc.inventory.InventoryManager)- Stack trace follows:
java.lang.Throwable: This is where resource ID=[0] was passed in
	at org.rhq.core.pc.inventory.InventoryManager.getResourceContainer(InventoryManager.java:490)
	at org.rhq.core.pc.content.ContentManager.rescheduleDiscovery(ContentManager.java:360)
	at org.rhq.core.pc.content.ContentDiscoveryRunner.call(ContentDiscoveryRunner.java:130)
	at org.rhq.core.pc.content.ContentDiscoveryRunner.run(ContentDiscoveryRunner.java:90)
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
	at java.util.concurrent.FutureTask$Sync.innerRunAndReset(FutureTask.java:351)
	at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:178)
	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:165)
	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:267)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
	at java.lang.Thread.run(Thread.java:636)


Expected results:
No warning and no stack trace in DEBUG.

Additional info:
Although this does not seem to impact inventory or inventory synchronization, it is a warning and gives the appearance that something is broken. Of course, this is not the case. Instead, all this simply means is that the agent platform has not yet been imported into inventory and still has a resource ID of 0. Perhaps we should be checking the inventory status for resources containers with ID of 0 and in such cases suppress the warning?
Comment 1 Larry O'Leary 2012-11-21 19:01:19 EST
*** Bug 845954 has been marked as a duplicate of this bug. ***
Comment 2 Armine Hovsepyan 2013-10-02 06:50:06 EDT
*** Bug 1014501 has been marked as a duplicate of this bug. ***
Comment 3 Thomas Segismont 2013-10-11 08:48:36 EDT
Fixed in release/jon3.2.x

commit 8029ecf274e8265cf5475504c76eb56f385724af
Author: Thomas Segismont <tsegismo@redhat.com>
Date:   Fri Oct 11 11:45:11 2013 +0200

Cherry picked from master 180a980
    
Schedule content discovery if resource is synchronized and COMMITED
Comment 4 Simeon Pinder 2013-10-24 00:10:12 EDT
Moving to ON_QA for testing in the next build.
Comment 5 Armine Hovsepyan 2013-11-12 06:24:37 EST
Created attachment 822869 [details]
agent.log
Comment 6 Armine Hovsepyan 2013-11-12 06:30:44 EST
verified in er5 - please get agent.log attached

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