Bug 1120229

Summary: Creation of child resource fails if the resource with given name previously existed and then was deleted
Product: [JBoss] JBoss Operations Network Reporter: Jan Bednarik <jbednari>
Component: RESTAssignee: Heiko W. Rupp <hrupp>
Status: CLOSED NOTABUG QA Contact:
Severity: medium Docs Contact:
Priority: unspecified    
Version: JON 3.2.2CC: jbednari, mkoci, tsegismo
Target Milestone: ---   
Target Release: JON 3.3.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-08-30 10:03:33 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Jan Bednarik 2014-07-16 13:31:30 UTC
Description of problem:
The RHQ server fails to create a child resource if the same resource with the same name previously existed and then was removed. The issue occurs both using REST and web UI. 

In case of REST query the server fails to create the resource and responds with http code 500).

In case of WEB UI the message "A request to create a Resource with the name of [if-test1] has been submitted successfully," but the resource is never created and never appears in the inventory.

Version-Release number of selected component (if applicable):
RHQ 4.13.0-SNAPSHOT (89a2c43)

How reproducible:
always

Steps to Reproduce:
1. Create the "Network Interface" child resource of EAP standalone server (either via UI or REST) and name it "test-interface".
2. After the resource is created uninventory it (either via UI or REST)
3. Using REST repeat step 1 (make sure you give the same name "test-interface" to the resource)
4. Check the server's response. Using UI check that the resource was not created.
5. Using WEB UI repeat step 1 (make sure you give the same name "test-interface" to the resource).
6. Using UI check that the resource was not created.

Actual results:
The resource is not created. UI displays message confirming that the resource was created.

Expected results:
Resource is created and if not the UI should reflect on that.

Additional info:

Comment 1 Thomas Segismont 2014-08-28 12:16:03 UTC
(In reply to Jan Bednarik from comment #0)
> 2. After the resource is created uninventory it (either via UI or REST)

Did you click uninventory or delete?

Uninventory does not *delete* the resource from the managed server. It justs removes it from JON's inventory. Then it is expected that when you try to create a resource with the same name, EAP refuses it.

Please clarify the reproduction steps, both for UI and REST. For the latter, please attach to the BZ the script of the test case.

Comment 2 Thomas Segismont 2014-08-30 10:03:33 UTC
Closing assuming the resource was uninventoried, not deleted. Reopen if you can reproduce actually deleting the resource.

Comment 3 Jan Bednarik 2014-09-09 11:32:18 UTC
(In reply to Thomas Segismont from comment #1)
> (In reply to Jan Bednarik from comment #0)
> > 2. After the resource is created uninventory it (either via UI or REST)
> 
> Did you click uninventory or delete?
> 
> Uninventory does not *delete* the resource from the managed server. It justs
> removes it from JON's inventory. Then it is expected that when you try to
> create a resource with the same name, EAP refuses it.

Thomas you are right, I had a look at this issue again and I used DELETE /resource/{id} in case of REST and uninventory in case of UI. As you say, this does not delete the resource from the managed server. Thus I agree with notabug resolution.