Bug 785128

Summary: [eap6] unable to remove managed server
Product: [Other] RHQ Project Reporter: Libor Zoubek <lzoubek>
Component: AgentAssignee: Simeon Pinder <spinder>
Status: CLOSED CURRENTRELEASE QA Contact: Mike Foley <mfoley>
Severity: unspecified Docs Contact:
Priority: high    
Version: 4.3CC: hrupp, theute
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-09-02 03:24:19 EDT Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---
Bug Depends On:    
Bug Blocks: 707223    

Description Libor Zoubek 2012-01-27 06:49:52 EST
Description of problem:
'Remove managed server' operation probably passes bad arguments to EAP6 API

Version-Release number of selected component (if applicable):
Version: 4.3.0-SNAPSHOT
Build Number: 42b9f09

How reproducible: always

Steps to Reproduce:
1. start up and inventory eap6 domain controller
2. go to operations and try to remove managed server (make sure it does not run
Actual results: Operation fails
java.lang.Exception: Operation [Operation{operation='remove', address=Address{path: host=master,server-config=EAP server-four}, additionalProperties={socket-binding-port-offset=0, name=EAP server-four, auto-start=false, group=, socket-binding-group=}}] returned null, rolled-back=false
	at org.rhq.core.pc.operation.OperationInvocation.run(OperationInvocation.java:278)
	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:

Additional info: plugin should pass 'server-four' param instead of 'EAP server-four' and .. not sure why socket-binding-port-offset=0, because I've created server (using RHQ UI) with offset 300 (RHQ UI shows that correctly in Connection Settings)
Comment 1 Heiko W. Rupp 2012-01-27 08:24:13 EST
This is an issue with us adding he "EAP " prefix to the name - need to check if the resource key is without EAP and can be used. Alternatively the EAP prefix can be dropped as the manages servers are now in the tree below the host controller
Comment 2 Heiko W. Rupp 2012-01-27 11:59:00 EST
Can you check again?
I can't reproduce this - the code is using the "path" plugin property for the remove operation and is not passing any additional parameters.

The plugin is (supposed) to write a message like this to the agent log

2012-01-27 17:48:47,325 INFO  [ResourceContainer.invoker.nonDaemon-1] (rhq.modules.plugins.jbossas7.ManagedASComponent)- delete resource: host=master,server-config=server-four ...

can you please paste that into your reply?

Did you specify the remove operation on HC or Host-level?
Comment 3 Libor Zoubek 2012-01-27 12:13:58 EST
I call operation on HC level

here is what comes from agent log

2012-01-27 18:05:43,693 ERROR [ResourceContainer.invoker.nonDaemon-1] (rhq.modules.plugins.jbossas7.ASConnection)- IS was null and code was 500
2012-01-27 18:05:43,693 WARN  [ResourceContainer.invoker.nonDaemon-1] (rhq.modules.plugins.jbossas7.ASConnection)- Operation [Operation{operation='remove', address=Address{path: host=master,server-config=EAP server-three}, additionalProperties={socket-binding-port-offset=0, name=EAP server-three, auto-start=false, group=, socket-binding-group=}}] returned null
Comment 4 Mike Foley 2012-01-30 11:23:36 EST
12/30/2012 BZ triage meeting mfoley, ccrouch, loleary, asantos
Comment 5 Heiko W. Rupp 2012-02-01 04:48:27 EST
Libor, code 500 is an internal server error in AS7.
Comment 6 Libor Zoubek 2012-02-01 11:31:24 EST
yes, but the reason for it seems to be sending incorrect params (server-config=EAP server-three). Yes, AS7 should probably not return 500. 

Tried this using cli

[domain@localhost:8999 /] /host=master/server-config=EAP server-one:remove
'EAP server-one' is not a valid node name.

which does not look as a response of controller, but a check in cli
Comment 7 Heiko W. Rupp 2012-02-14 12:13:32 EST
I see the issue Libor has in his logs, but can't reproduce locally.
Comment 8 Simeon Pinder 2012-02-23 09:44:43 EST
I've reproduced and almost have a fix.
Comment 9 Heiko W. Rupp 2012-03-05 06:55:09 EST
This may be related to https://issues.jboss.org/browse/AS7-4027 especially as the path (which is used to create the address for the operation on AS7) should never contain the EAP or whatever prefixes (if they are there, then the code to create servers needs to be changed).

[domain@localhost:9999 host=master] ./server-config=asdfasd:remove
    "outcome" => "failed",
    "result" => undefined,
    "rolled-back" => true,
    "server-groups" => undefined
[domain@localhost:9999 host=master] ./server-config=asdfasd:stop                                   
    "outcome" => "success",
    "result" => "STOPPING"
[domain@localhost:9999 host=master] ./server-config=asdfasd:remove                                 
    "outcome" => "success",
    "result" => {"outcome" => "success"},
    "server-groups" => undefined
Comment 10 Libor Zoubek 2012-03-08 14:55:16 EST
Version: 4.4.0-SNAPSHOT Build Number: f02a5b9

Remove managed server operation succeeds and also removes the managed server from HC. There is another little issue. Manged server Resource does not disappear from RHQ UI. It only becomes unavailable. I have to manually uninventory it to get rid of it. Maybe we should leave concept of operations in 'Adding/Removing managed servers' and switch to create a child / Delete child
Comment 11 Simeon Pinder 2012-03-08 16:14:57 EST
This is fixed with commit 07dbcc85c57a946ce to master.  

The issue was that invoking the operation from the HostController autogroup caused a code execution path that did not handle EAP/EDG prefixes correctly. 

Basically the fix was that we deleted the ability to 'remove managed servers' as an operation. Instead you now need to remove managed servers by deleting them  using the Domain Controller > Inventory > Child Resources table which is more consistent with other RHQ remove operations.  Removing the 'managed servers' in this way also causes the immediate removal of the server from the RHQ UI as well ref Comment 10. When https://bugzilla.redhat.com/show_bug.cgi?id=801554 is addressed we should not be using operations to add/remove managed servers.

Moving this to ON_QA.
Comment 12 Heiko W. Rupp 2013-09-02 03:24:19 EDT
Bulk closing of issues that were VERIFIED, had no target release and where the status changed more than a year ago.