Bug 1112733 - Adding EAP 6 server with additional outbound socket binding ref to the inventory will incorrectly add the same binding to the mail configuration of the JBoss ON Server resource (RHQ Server)
Summary: Adding EAP 6 server with additional outbound socket binding ref to the invent...
Status: CLOSED CURRENTRELEASE
Alias: None
Product: JBoss Operations Network
Classification: JBoss
Component: Plugin -- JBoss EAP 6, Inventory
Version: JON 3.2.1
Hardware: Unspecified
OS: Unspecified
unspecified
urgent
Target Milestone: ER05
: JON 3.3.0
Assignee: Michael Burman
QA Contact: Armine Hovsepyan
URL:
Whiteboard:
Keywords: Triaged
Depends On:
Blocks: 1112736
TreeView+ depends on / blocked
 
Reported: 2014-06-24 15:15 UTC by bkramer
Modified: 2018-12-05 18:56 UTC (History)
7 users (show)

(edit)
It was discovered that adding an additional EAP server to the inventory that had an additional outbound socket binding reference added the same binding option to the mail configuration for every EAP server. The Outbound Socket Binding Reference showed radio buttons for all available values in any EAP instance added to the inventory. If the incorrect option from another EAP was selected, the configuration saved successfully and EAP server restarted, it would throw a "missing dependents" Exception and mail could no longer be sent from the server. Query used to select available socket binding options was limited to the instance that is being configured.
Clone Of:
(edit)
Last Closed: 2014-12-11 14:02:53 UTC


Attachments (Terms of Use)
smtp_outbound_socket_binding_ref (227.12 KB, image/png)
2014-10-27 13:52 UTC, Armine Hovsepyan
no flags Details

Description bkramer 2014-06-24 15:15:03 UTC
Description of problem:
Adding EAP 6 server with additional outbound socket binding ref to the inventory will incorrectly add the same binding to the mail configuration of the JBoss ON Server resource (RHQ Server). 

Version-Release number of selected component (if applicable):
JBoss ON 3.2 and 3.2.1

How reproducible:
Always

Steps to Reproduce:
1. On the first box (server1) unzip JBoss ON 3.2.1 zip file;
2. Change $JON-SERVER/bin/rhq-server.properties file, set the following properties and save the file:
...
# Email settings used to connect to an SMTP server to send alert emails.
rhq.server.email.smtp-host=my.smtp.server.com
rhq.server.email.smtp-port=25
rhq.server.email.from-address=test@server.com
... 
3. Install JBoss ON 3.2.1 and it's components;
4. Install plugins for EAP;
5. Start storage nodes, JBoss ON Server and JBoss ON Agent and import RHQ Server into inventory;
6. Navigate to RHQ Server resource -> mail -> Mail Sessions -> java:jboss/mail/Default -> smtp and confirm that only one Outbound Socket Binding Ref is listed there (mail-smtp).
7. On another box (server2) install and configure JBoss ON Agent 3.2.1 to connect to the first box (server1);
8. On the server2 install EAP 6.x server in standalone mode, add management user and start the server;
9. Using JBoss CLI, execute the following to add new outbound socket binding:

/socket-binding-group=standard-sockets/remote-destination-outbound-socket-binding=redhat:add(host=my.smtp.server.com,port=25)
{"outcome" => "success"}

so should have something like:

/socket-binding-group=standard-sockets:read-resource(recursive=true)
{
    "outcome" => "success",
    "result" => {
        "default-interface" => "public",
        "name" => "standard-sockets",
        "port-offset" => expression "${jboss.socket.binding.port-offset:0}",
        "local-destination-outbound-socket-binding" => undefined,
        "remote-destination-outbound-socket-binding" => {
            "mail-smtp" => {
                "fixed-source-port" => false,
                "host" => "localhost",
                "port" => 25,
                "source-interface" => undefined,
                "source-port" => undefined
            },
            "redhat" => {
                "fixed-source-port" => false,
                "host" => "my.smtp.server.com",
                "port" => 25,
                "source-interface" => undefined,
                "source-port" => undefined
            }
        },
...

10. Import this EAP instance and platform to the inventory of the JBoss ON Server (installed on server1);
10. In JBoss ON UI navigate to the RHQ Server resource -> mail -> Mail Sessions -> java:jboss/mail/Default -> smtp -> Configuration and check Outbound Socket Binding Ref.


Actual results:
Outbound Socket Binding Ref will show two radio buttons and two values (first one originally configured and the second one that is configured in the EAP instance installed on the server2)

Expected results:
Outbound Socket Binding Ref shows only one value - the one that was originally configured.


Additional info:
If, for some reason, second (incorrect) option is selected, configuration saved and JBoss ON server restarted, during server restart it will throw the following Exception: 

***********************************************************************
15:11:37,704 INFO  [org.jboss.as.controller] (Controller Boot Thread) JBAS014774: Service status report
JBAS014775:    New missing/unsatisfied dependencies:
      service jboss.outbound-socket-binding.redhat (missing) dependents: [service jboss.mail-session.java:jboss/mail/Default] 

15:11:37,920 INFO  [org.jboss.as] (Controller Boot Thread) JBAS015961: Http management interface listening on http://127.0.0.1:6990/management
15:11:37,920 INFO  [org.jboss.as] (Controller Boot Thread) JBAS015954: Admin console is not enabled
15:11:37,921 ERROR [org.jboss.as] (Controller Boot Thread) JBAS015875: JBoss EAP 6.1.1.GA (AS 7.2.1.Final-redhat-10) started (with errors) in 39016ms - Started 4934 of 5045 services (1 services failed or missing dependencies, 104 services are passive or on-demand)
***********************************************************************
and JBoss ON Server will not be able to send emails any more. 

However, if we revert back to the original setting, the JBoss ON Server will be correctly started and emails will be properly sent.

Comment 1 Larry O'Leary 2014-06-25 15:57:34 UTC
From the sound of it, the socket bindings are being read from all JBoss EAP 6 servers and displayed on a single one. This seems bad.

Comment 3 Michael Burman 2014-08-19 19:46:50 UTC
Can you still replicate this with 3.3.0? If so, can you leave the instance in a state where I could take a look? I still think this is a stale-UI issue (browser related maybe), instead of real issue.

Comment 7 Simeon Pinder 2014-09-29 08:12:27 UTC
Moving into ER05 as didn't make the ER04 cut.

Comment 8 Michael Burman 2014-10-01 14:57:02 UTC
Fixed in master:

commit d1ffbbd81ef531e8fcc64e1f5e61e7e6e8a17236
Author: Michael Burman <miburman@redhat.com>
Date:   Wed Oct 1 17:55:59 2014 +0300

    [BZ 1112733] Define expressionScope baseResource to the option-source

Comment 9 Jirka Kremser 2014-10-03 12:06:19 UTC
branch:  release/jon3.3.x
link:    https://github.com/rhq-project/rhq/commit/60c94926d
time:    2014-10-03 14:05:40 +0200
commit:  60c94926dca8ea3bb1b81c779526ea57a37fa72b
author:  Michael Burman - miburman@redhat.com
message: [BZ 1112733] Define expressionScope baseResource to the option-source

         (cherry picked from commit
         d1ffbbd81ef531e8fcc64e1f5e61e7e6e8a17236) Signed-off-by: Jirka
         Kremser <jkremser@redhat.com>

Comment 10 Simeon Pinder 2014-10-21 20:24:03 UTC
Moving to ON_QA as available to test with the latest brew build:
https://brewweb.devel.redhat.com//buildinfo?buildID=394734

Comment 11 Armine Hovsepyan 2014-10-27 13:52:52 UTC
Created attachment 951012 [details]
smtp_outbound_socket_binding_ref

Comment 12 Armine Hovsepyan 2014-10-27 13:56:26 UTC
verified in JON 3.3 ER05
screen-shot attached


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