Bug 1119240 - Adding http-interface in the host controller's host-slave.xml is not recognised by JBoss ON Agent causing Host Controller's availability to stay DOWN
Summary: Adding http-interface in the host controller's host-slave.xml is not recognis...
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: JBoss Operations Network
Classification: JBoss
Component: Plugin -- JBoss EAP 6
Version: JON 3.2
Hardware: Unspecified
OS: Unspecified
unspecified
high
Target Milestone: ER01
: JON 3.3.0
Assignee: Libor Zoubek
QA Contact: Armine Hovsepyan
URL:
Whiteboard:
Depends On:
Blocks: 1119242
TreeView+ depends on / blocked
 
Reported: 2014-07-14 11:08 UTC by bkramer
Modified: 2018-12-06 17:18 UTC (History)
6 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
If the management interface in the host-slave.xml file was changed, the JBoss ON Agent threw an "Invalid port: 0" error while trying to discover the JON server. Restarting the JON server and agent did not clear the error. JBoss ON discovered the Host Controller but it was marked as DOWN and a WARN log event was added to the agent.log file. The Plug-in UI did not adequately show an indication of the issue. The fix now displays a warning icon next to the availability icon on the resource. When clicked, a window displays with the following explanation: "Unable to detect management port. Please enable management HTTP interface on <server> and then set the correct port number in Connection Settings of this resource". The same warning is logged in the agent.log file as a WARN message when the host controller is started.
Clone Of:
Environment:
Last Closed: 2014-12-11 13:59:53 UTC
Type: Bug


Attachments (Terms of Use)


Links
System ID Priority Status Summary Last Updated
Red Hat Knowledge Base (Solution) 1129223 None None None Never

Description bkramer 2014-07-14 11:08:16 UTC
Description of problem:
Adding http-interface in the host controller's host-slave.xml is not recognised by JBoss ON Agent causing Host Controller's availability to stay DOWN. The agent.log file shows the following WARN message:
*********************************************************
2014-07-11 10:23:40,185 WARN  [InventoryManager.availability-1] (rhq.core.pc.inventory.AvailabilityExecutor)- Availability collection failed with exception on Resource[id=10103, uuid=5eec6ae0-5313-4dd7-8537-03eec96b9800, type={JBossAS7}JBossAS7 Host Controller, key=hostConfig: /opt/myEAPserver/domain/configuration/host-slave.xml, name=EAP Host Controller (localhost:0), parent=myServer.com, version=EAP 6.2.0.GA], availability will be reported as DOWN
org.rhq.core.clientapi.agent.PluginContainerException: Failed to start component for resource Resource[id=10103, uuid=5eec6ae0-5313-4dd7-8537-03eec96b9800, type={JBossAS7}JBossAS7 Host Controller, key=hostConfig: /opt/myEAPserver/domain/configuration/host-slave.xml, name=EAP Host Controller (localhost:0), parent=myServer.com, version=EAP 6.2.0.GA].
        at org.rhq.core.pc.inventory.InventoryManager.activateResource(InventoryManager.java:1941)
        at org.rhq.core.pc.inventory.AvailabilityExecutor.checkInventory(AvailabilityExecutor.java:361)
        at org.rhq.core.pc.inventory.AvailabilityExecutor.checkInventory(AvailabilityExecutor.java:429)
        at org.rhq.core.pc.inventory.AvailabilityExecutor.startScan(AvailabilityExecutor.java:195)
        at org.rhq.core.pc.inventory.AvailabilityExecutor.call(AvailabilityExecutor.java:152)
        at org.rhq.core.pc.inventory.AvailabilityExecutor.run(AvailabilityExecutor.java:111)
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
        at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:304)
        at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:178)
        at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
        at java.lang.Thread.run(Thread.java:744)
Caused by: java.lang.IllegalArgumentException: Invalid port: 0
        at org.rhq.modules.plugins.jbossas7.ASConnection.<init>(ASConnection.java:165)
        at org.rhq.modules.plugins.jbossas7.ASConnection.newInstanceForServerPluginConfiguration(ASConnection.java:230)
        at org.rhq.modules.plugins.jbossas7.BaseServerComponent.start(BaseServerComponent.java:98)
        at sun.reflect.GeneratedMethodAccessor35.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:606)
        at org.rhq.core.pc.inventory.ResourceContainer$ComponentInvocation.call(ResourceContainer.java:654)
        at java.util.concurrent.FutureTask.run(FutureTask.java:262)
*********************************************************

Version-Release number of selected component (if applicable):
JBoss ON 3.2.x

How reproducible:
Always

Steps to Reproduce:
1. EAP (6.2 in this case) started in domain mode where Domain Controller (DC) is running on one machine and Host Controller (HC) on another machine;

2. HC started using host-slave.xml file or host.xml but without http-inteface defined so it looked like:
********************************************
...
<management-interfaces>
    <native-interface security-realm="ManagementRealm">
        <socket interface="management" port="${jboss.management.native.port:9999}"/>
    </native-interface>
</management-interfaces>
...
********************************************

3. Both DC and HC are discovered and imported in the JBoss ON inventory;

4. DC is available while HC is DOWN;

5. Edit host-slave.xml or host.xml file to add http-interface in the following way so host-slave.xml/host.xml should contain:
*********************************************
...
<management-interfaces>
    <native-interface security-realm="ManagementRealm">
        <socket interface="management" port="${jboss.management.native.port:9999}"/>
    </native-interface>
    <http-interface security-realm="ManagementRealm">
        <socket interface="management" port="${jboss.management.http.port:9990}"/>
    </http-interface> 
</management-interfaces>
...
*********************************************

6. Saved host-slave.xml/host.xml file and restarted the host controller (HC);

7. Restarted the JBoss ON Agent;


Actual results:
Change made in host-slave.xml/host.xml is not recognised so HC is still Down in JBoss ON inventory and WARN message is logged in the agent.log file.


Expected results:
Availability of HC is changed to UP and no exception is logged in the agent.log file. 

Additional info:

Comment 1 bkramer 2014-07-14 11:16:24 UTC
Additional info - to work around this:

* remove (uninventory) unavailable host controller from the JBoss ON inventory;
* let JBoss ON Agent on the machine 2 to discover HC again;
* inventory discovered Host Controller again;
* make sure that the username/password is set correctly in the host controller Connection Settings page;
* execute "Execute Availability Scan" operation for RHQ Agent resource on the machine 2.

Comment 2 Libor Zoubek 2014-08-07 15:46:55 UTC
Actually .. plugin cannot change plugin configuration once resource was already discovered. So once it is discovered with incorrectly detected port user has to set up management interface and also update Connection Settings and set correct port number.

I've changed plugin, so when it fails to detect port it fails to start component -> this results to yellow triangle right next to availability icon on resource. User can then read the message and do appropriate action.

in master

commit 2d3a7af207833a95e619422e3b788cb30e7ffb69
Author: Libor Zoubek <lzoubek@redhat.com>
Date:   Thu Aug 7 17:33:36 2014 +0200

    Bug 1119240 - Adding http-interface in the host controller's host-slave.xml
    is not recognised by JBoss ON Agent causing Host Controller's availability
    to stay DOWN

    throw InvalidPluginConfiguration exception when http mgmt interface port is
    detected as 0 (not-detected). User is advised to set his host controller up
    and then update connection settings.


in 3.3. branch

commit e0836720cfb52e05a59d2979d3800b5b52a0a94b
Author: Libor Zoubek <lzoubek@redhat.com>
Date:   Thu Aug 7 17:33:36 2014 +0200

    Bug 1119240 - Adding http-interface in the host controller's host-slave.xml
    is not recognised by JBoss ON Agent causing Host Controller's availability
    to stay DOWN

    throw InvalidPluginConfiguration exception when http mgmt interface port is
    detected as 0 (not-detected). User is advised to set his host controller up
    and then update connection settings.

    (cherry picked from commit 2d3a7af207833a95e619422e3b788cb30e7ffb69)
    Signed-off-by: Libor Zoubek <lzoubek@redhat.com>

Comment 3 Simeon Pinder 2014-08-19 23:50:43 UTC
Moving to ON_QA as available to test in the following brew build:

https://brewweb.devel.redhat.com//buildinfo?buildID=379025

Comment 4 Jan Bednarik 2014-09-11 13:14:22 UTC
Moving to VERIFIED.

If the http-interface is not specified in host-slave.xml, the host controller appears to be down. As described in Comment 2, there appears a triangle icon next to availability icon which, when clicked, opens the window with further explanation: "Unable to detect management port. Please enable management HTTP interface on and then set correct port number in Connection Settings of this resource". The same warning is logged in agent.log file as a WARN message while starting the host controller.


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