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
Summary: When agent platform has not yet been added to inventory, agent continuously l...
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: JBoss Operations Network
Classification: JBoss
Component: Agent, Inventory
Version: JON 3.1.0
Hardware: All
OS: All
unspecified
medium
Target Milestone: ER04
: JON 3.2.0
Assignee: Thomas Segismont
QA Contact: Mike Foley
URL:
Whiteboard:
: 845954 (view as bug list)
Depends On: 856846
Blocks:
TreeView+ depends on / blocked
 
Reported: 2012-09-12 23:02 UTC by Larry O'Leary
Modified: 2014-01-02 20:36 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
: 856846 (view as bug list)
Environment:
Last Closed: 2014-01-02 20:36:21 UTC
Type: Bug
Embargoed:


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

Description Larry O'Leary 2012-09-12 23:02:32 UTC
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-22 00:01:19 UTC
*** Bug 845954 has been marked as a duplicate of this bug. ***

Comment 2 Armine Hovsepyan 2013-10-02 10:50:06 UTC
*** Bug 1014501 has been marked as a duplicate of this bug. ***

Comment 3 Thomas Segismont 2013-10-11 12:48:36 UTC
Fixed in release/jon3.2.x

commit 8029ecf274e8265cf5475504c76eb56f385724af
Author: Thomas Segismont <tsegismo>
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 04:10:12 UTC
Moving to ON_QA for testing in the next build.

Comment 5 Armine Hovsepyan 2013-11-12 11:24:37 UTC
Created attachment 822869 [details]
agent.log

Comment 6 Armine Hovsepyan 2013-11-12 11:30:44 UTC
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.