Bug 1522728 - Attempt to execute disablePlugin, enablePlugin or deletePlugin methods (PluginManager) fails due to method is not supplied
Summary: Attempt to execute disablePlugin, enablePlugin or deletePlugin methods (Plugi...
Status: CLOSED ERRATA
Alias: None
Product: JBoss Operations Network
Classification: JBoss
Component: CLI
Version: JON 3.3.9
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: ER01
: JON 3.3.11
Assignee: Michael Burman
QA Contact: Sunil Kondkar
URL:
Whiteboard:
Keywords: Triaged
Depends On: 1522731
Blocks:
TreeView+ depends on / blocked
 
Reported: 2017-12-06 10:30 UTC by bkramer
Modified: 2018-10-16 17:07 UTC (History)
4 users (show)

(edit)
Clone Of:
(edit)
Last Closed: 2018-10-16 17:06:49 UTC


Attachments (Terms of Use)


External Trackers
Tracker ID Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2018:2930 None None None 2018-10-16 17:07 UTC
Red Hat Knowledge Base (Solution) 3262101 None None None 2018-10-09 18:58 UTC

Description bkramer 2017-12-06 10:30:14 UTC
Description of problem:

Attempt to disablePlugin using JBoss ON CLI fails. I tried to do the following:

*************************************************
$ ./rhq-cli.sh -u rhqadmin -p rhqadmin -s test.usersys.redhat.com -t 7080
RHQ Enterprise Remote CLI 4.12.0.JON330GA Update 09
Remote server version is: 3.3.0.GA Update 09 (fcb34f1:80f74f5)
Login successful
rhqadmin@test.usersys.redhat.com:7080$  var pluginCriteria = PluginCriteria();
rhqadmin@test.usersys.redhat.com:7080$ pluginCriteria.addFilterDisplayName("IIS");
rhqadmin@test.usersys.redhat.com:7080$ var plugins = PluginManager.findPluginsByCriteria(pluginCriteria); 
rhqadmin@test.usersys.redhat.com:7080$ var myPlugin = plugins.get(0);
rhqadmin@test.usersys.redhat.com:7080$ var pluginID = myPlugin.getId()
rhqadmin@test.usersys.redhat.com:7080$ var allPluginIDs = []
rhqadmin@test.usersys.redhat.com:7080$ allPluginIDs.push(pluginID);
1.0
rhqadmin@test.usersys.redhat.com:7080$ pretty.print(allPluginIDs);
one row
10005
rhqadmin@test.usersys.redhat.com:7080$ PluginManager.disablePlugins(allPluginIDs);
org.jboss.remoting.CannotConnectException: Can not connect http client invoker after 1 attempt(s)
PluginManager.disablePlugins(allPluginIDs); 
^
*************************************************

and the following was logged in the server.log file:

*************************************************
15:49:37,153 ERROR [org.rhq.enterprise.server.remote.RemoteSafeInvocationHandler] (http-10.36.116.237:7080-1) Failed to invoke remote request: java.lang.IllegalArgumentException: InvocationRequest did not supply method.
	at org.rhq.enterprise.server.remote.RemoteSafeInvocationHandler.invoke(RemoteSafeInvocationHandler.java:93) [rhq-server.jar:4.12.0.JON330GA-redhat-9]
        ...

15:49:37,159 DEBUG [org.rhq.enterprise.server.remote.RemoteSafeInvocationHandler] (http-10.36.116.237:7080-1) Remote request [null] execution time (ms): 6
*************************************************

The same happens when trying to invoke enablePlugin or deletePlugin methods. 


Version-Release number of selected component (if applicable):
JBoss ON 3.3.9

How reproducible:
Always

Steps to Reproduce:
1.
2.
3.

Actual results:
Plugins are not disabled and error is logged in the server.log file.

Expected results:
Selected plugins are disabled and no error is logged in the server.log file. 

Additional info:

Comment 1 Michael Burman 2018-05-28 12:51:35 UTC
Script syntax above is incorrect, with the following patch this should work:

var b = new java.util.ArrayList()
b.add(new java.lang.Integer(10042))
PluginManager.disablePlugins(b)

This is because var allPluginIDs = [] casts to wrong type and the command it not detected correctly.

In the master, fixed the typo in the bean name to invoke:

commit 62640022d0af13f0017c2827d04ec82440485897 (HEAD -> master, upstream/master)
Author: Michael Burman <miburman@redhat.com>
Date:   Mon May 28 15:49:37 2018 +0300

    [BZ 1522728] Fix PluginManager invocation bean typo

Comment 4 Sunil Kondkar 2018-09-21 12:17:07 UTC
Verified on Version :3.3.0.GA Update 11
Build Number :	669c61c:7f77b51

Verified that disablePlugin, enablePlugin or deletePlugin methods work as expected and no errors in server log. The log displays below:

01:25:50,992 INFO  [org.rhq.enterprise.server.resource.metadata.PluginManagerBean] (http-0.0.0.0:7080-7) Disabling plugin [10042]
01:29:47,848 INFO  [org.rhq.enterprise.server.resource.metadata.PluginManagerBean] (http-0.0.0.0:7080-13) Enabling plugin [10042]
01:30:23,017 INFO  [org.rhq.enterprise.server.resource.metadata.PluginManagerBean] (http-0.0.0.0:7080-2) Disabling plugin [10042]
01:33:44,821 INFO  [org.rhq.enterprise.server.core.plugin.AgentPluginScanner] (EJB default - 3) Plugin file [/home/hudson/jon-server-3.3.0.GA/modules/org/rhq/server-startup/main/deployments/rhq.ear/rhq-downloads/rhq-plugins/activemq-plugin-7.3.1.redhat-379.jar] has been deleted from the file system.

Also verified that JON UI (Administration->Configuration->Agent Plugins) reflects the plugins status in 'Enabled?' column as expected.

Comment 6 errata-xmlrpc 2018-10-16 17:06:49 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHSA-2018:2930


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