Bug 619135 - manually adding a resource with bad plugin config hoses inventory for that resource
Summary: manually adding a resource with bad plugin config hoses inventory for that re...
Alias: None
Product: RHQ Project
Classification: Other
Component: Agent   
(Show other bugs)
Version: 3.0.0
Hardware: All
OS: All
high vote
Target Milestone: ---
: ---
Assignee: Jay Shaughnessy
QA Contact: Mike Foley
Depends On:
TreeView+ depends on / blocked
Reported: 2010-07-28 16:29 UTC by John Mazzitelli
Modified: 2013-09-02 07:16 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2013-09-02 07:16:10 UTC
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)
proposed patch for this issue (3.77 KB, patch)
2010-07-28 21:00 UTC, Jay Shaughnessy
no flags Details | Diff
Same patch with a typo fixed (3.77 KB, patch)
2010-07-28 21:10 UTC, Jay Shaughnessy
no flags Details | Diff

Description John Mazzitelli 2010-07-28 16:29:08 UTC
Import just the platform. I then started EAP 5.1 in all config (this did not auto-discovery for me for some reason - I bound it via - run.sh -b -c all).

Try to manually add it - but give a bogus JNP port (I did " you get an error saying that JNP URL is bad. Try to manually add it with the good JNP URL and it still fails with that same error/same bad JNP URL.

From here on out, you can't manually add that server again. It isn't in the DB, but its in the agent's inventory with an inventory status of COMMITTED but with a resource ID of 0 and a sync status of NEW.

The only way to fix this is to start the agent with --purgedata to get rid of the persisted inventory.

Comment 1 Jay Shaughnessy 2010-07-28 18:35:52 UTC
I've recreated this.  The issue seems to occur when the manually added resource component can't be started.  The new resource itself passes the manual discovery, meaning the plugin config seems valid (if not correct).  The new resource is committed to agent inventory at this point.

Then we make an attempt to start the resource component.  If this throws an exception due to incorrect plugin config, inability to create a connection (underlying resource is down, for example), or whatever, we exit the manual add code prior to syncing the new resource with the server.

This leaves the ghost entry in the agent inventory without any server side knowledge of the resource.

I think the fix would be to allow a failed component start and just proceed. The manually added resource should show up on the server, in a DOWN state.  The user can then fix the connection properties or uninventory the poorly defined resource.

Looking at generatig a patch for this now...

Comment 2 Jay Shaughnessy 2010-07-28 21:00:53 UTC
Created attachment 435122 [details]
proposed patch for this issue

Comment 3 Jay Shaughnessy 2010-07-28 21:10:18 UTC
Created attachment 435126 [details]
Same patch with a typo fixed

Comment 4 Corey Welton 2010-09-28 12:06:31 UTC
jshaughn -- has this patch been applied?  if so, which branches

Comment 5 Jay Shaughnessy 2010-09-28 13:27:29 UTC
It is applied to  Master.

It is not applied to release-3.0.0.

Comment 6 Jay Shaughnessy 2011-08-17 15:11:08 UTC
It looks like this was actually fixed in master, so setting to on_qa.

Comment 7 Mike Foley 2011-10-04 18:03:44 UTC
verified 10/4/2011 by following the reproduction steps.

Comment 8 Heiko W. Rupp 2013-09-02 07:16:10 UTC
Bulk closing of issues that were VERIFIED, had no target release and where the status changed more than a year ago.

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