Bug 619135

Summary: manually adding a resource with bad plugin config hoses inventory for that resource
Product: [Other] RHQ Project Reporter: John Mazzitelli <mazz>
Component: AgentAssignee: Jay Shaughnessy <jshaughn>
Status: CLOSED CURRENTRELEASE QA Contact: Mike Foley <mfoley>
Severity: high Docs Contact:
Priority: low    
Version: 3.0.0CC: jshaughn
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: All   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-09-02 03:16:10 EDT Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---
Attachments:
Description Flags
proposed patch for this issue
none
Same patch with a typo fixed none

Description John Mazzitelli 2010-07-28 12:29:08 EDT
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 127.0.0.99 - run.sh -b 127.0.0.99 -c all).

Try to manually add it - but give a bogus JNP port (I did "http://192.168.0.99:1099). 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 14:35:52 EDT
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 17:00:53 EDT
Created attachment 435122 [details]
proposed patch for this issue
Comment 3 Jay Shaughnessy 2010-07-28 17:10:18 EDT
Created attachment 435126 [details]
Same patch with a typo fixed
Comment 4 Corey Welton 2010-09-28 08:06:31 EDT
jshaughn -- has this patch been applied?  if so, which branches
Comment 5 Jay Shaughnessy 2010-09-28 09:27:29 EDT
It is applied to  Master.

It is not applied to release-3.0.0.
Comment 6 Jay Shaughnessy 2011-08-17 11:11:08 EDT
It looks like this was actually fixed in master, so setting to on_qa.
Comment 7 Mike Foley 2011-10-04 14:03:44 EDT
verified 10/4/2011 by following the reproduction steps.
Comment 8 Heiko W. Rupp 2013-09-02 03:16:10 EDT
Bulk closing of issues that were VERIFIED, had no target release and where the status changed more than a year ago.