Bug 1112736 - 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 RHQ Server resource
Summary: Adding EAP 6 server with additional outbound socket binding ref to the invent...
Keywords:
Status: ON_QA
Alias: None
Product: RHQ Project
Classification: Other
Component: Plugins
Version: 4.9
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
: RHQ 4.13
Assignee: Nobody
QA Contact:
URL:
Whiteboard:
Depends On: 1112733
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-06-24 15:22 UTC by bkramer
Modified: 2022-03-31 04:28 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed:
Embargoed:


Attachments (Terms of Use)

Description bkramer 2014-06-24 15:22:36 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 RHQ Server resource.

Version-Release number of selected component (if applicable):
RHQ 4.9

How reproducible:
Always

Steps to Reproduce:
1. On the first box (server1) unzip RHQ 4.9 zip file;
2. Change $RHQ-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
... 
3. Install RHQ 4.9 server and it's components;
4. Install plugins for EAP;
5. Start storage nodes, RHQ Server and RHQ Agent and import RHQ Server resource 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 RHQ Agent 4.9 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 RHQ Server (installed on server1);
10. In RHQ 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 RHQ 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] 
***********************************************************************
and RHQ Server will not be able to send emails any more. 

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

Comment 1 Michael Burman 2014-07-10 19:14:45 UTC
I've been unable to replicate this with the current master, using EAP 6.1.1 on server2 and EAP 6.3.Alpha on server1. It will show correctly that server2 has two bindings and server1 has one binding. A caching issue on the browser perhaps?

Comment 2 Michael Burman 2014-10-01 14:57:26 UTC
Fixed in master:

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

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


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