Bug 999494 - Import child Resource: jboss as (both eap 4 and 5) are not being imported to inventory list after successful import operation
Summary: Import child Resource: jboss as (both eap 4 and 5) are not being imported to ...
Status: CLOSED CURRENTRELEASE
Alias: None
Product: JBoss Operations Network
Classification: JBoss
Component: Plugin -- JBoss EAP 4, Plugin -- JBoss EAP 5
Version: JON 3.2
Hardware: All
OS: Linux
medium
high
Target Milestone: ER02
: JON 3.3.0
Assignee: Thomas Segismont
QA Contact: Armine Hovsepyan
URL:
Whiteboard:
Keywords:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-08-21 12:15 UTC by Armine Hovsepyan
Modified: 2015-09-03 00:01 UTC (History)
6 users (show)

(edit)
Clone Of:
(edit)
Last Closed: 2014-12-11 14:02:33 UTC


Attachments (Terms of Use)
importASServer.png (218.64 KB, image/png)
2013-08-21 12:15 UTC, Armine Hovsepyan
no flags Details
agent.log (109.24 KB, text/x-log)
2014-08-26 09:48 UTC, Armine Hovsepyan
no flags Details
agent.log.2 (141.74 KB, text/x-log)
2014-08-26 10:14 UTC, Armine Hovsepyan
no flags Details
failed_invnetory_eap5 (162.19 KB, application/octet-stream)
2014-09-04 15:51 UTC, Armine Hovsepyan
no flags Details

Description Armine Hovsepyan 2013-08-21 12:15:29 UTC
Created attachment 788837 [details]
importASServer.png

Description of problem:
  Import child Resource: jboss as (both eap 4 and 5) are not being imported to inventory list after successful import operation

Version-Release number of selected component (if applicable):
jon 3.2.0-Alpha 1878d58:5e6b489

How reproducible:
always

Steps to Reproduce:
1. install and start jon 3.2.0 alpha version
2. install and start eap4 and eap5 application servers
3. run import child from platform -> inventory and import jboss eap4 and/or jboss eap5 servers giving correct parameters

Actual results:
A request to import new resource of Type JbossAS Server has been submitted message is present -  resource is not imported (see screenshot attached)

Expected results:
eap4 (and/or eap5) resource is imported into server inventory list

Additional info:

Comment 2 Thomas Segismont 2014-08-25 12:53:01 UTC
Armine, here's what I think.

When you import (manually add) an EAP4 or EAP5 server, it's necessarily co-located to the agent (none of the two plugins supports remote servers). So both servers were probably in the discovery queue, or even inventoried (depending on what you did for testing before). The problem is that manually-added and auto-discovered EAP4/EAP5 servers have the same resource key format. And you can't have two resources with the same key under the same parent.

I'm not sure which of the server or the agent would refuse to add the imported server into inventory.

I added Jay in copy as he's more knowledgeable in this area.

Jay, can you please confirm?

Comment 3 Thomas Segismont 2014-08-25 12:56:10 UTC
If my assumption is correct, I think the fix should consist in logging an appropriate message on the server and/or the agent.

Comment 4 Jay Shaughnessy 2014-08-25 13:22:11 UTC
That sounds maybe plausible, although I would have maybe thought the first of the two servers would show up.  Armine, do you have the agent log?  That would be a good place to start.

Comment 5 Armine Hovsepyan 2014-08-26 09:48:00 UTC
Created attachment 930796 [details]
agent.log

Comment 6 Armine Hovsepyan 2014-08-26 09:48:45 UTC
agent.log attache(In reply to Jay Shaughnessy from comment #4)
> That sounds maybe plausible, although I would have maybe thought the first
> of the two servers would show up.  Armine, do you have the agent log?  That
> would be a good place to start.

agent.log attached (not the initial log - just reproduced)

Comment 7 Armine Hovsepyan 2014-08-26 10:14:47 UTC
Created attachment 930805 [details]
agent.log.2

Comment 8 Thomas Segismont 2014-08-26 13:32:16 UTC
Armine, these log files come from a 3.2.0 agent. The issue needs to be checked on the 3.3 builds. In order to check my hypothesis (see Comment 2), I need the agent to log at DEBUG level.

Here's what I checked in the code.

EAP4 and EAP5 plugins do not support truly remote servers, they need the managed server to be colocated with an agent. And they make no difference when the resource key is created, it's simply the path to the config directory (see org.rhq.plugins.jbossas.JBossASDiscoveryComponent#createResourceDetails line 278 and org.rhq.plugins.jbossas5.ApplicationServerDiscoveryComponent#createResourceDetails line 372).

Now what does the plugin container do? See org.rhq.core.pc.inventory.InventoryManager#manuallyAddResource line 976 to 998. If there is no existing resource with same key under the parent, the manually discovered resource is added to the inventory. If there is, and the existing resource is not in COMMITED state, its plugin config is updated. Otherwise, we just a log a message at DEBUG level.

As for the GUI, the problems lie in org.rhq.coregui.client.inventory.resource.factory.ResourceFactoryImportWizard#execute. A notification is sent to the message center only to tell the user that the request was submitted (or if an exception was thrown by the GWT server service). Besides, the "submitted" notification is sent after the response is received from the remote service. That is not good, I think, and it is what I'm working on.

Comment 11 Thomas Segismont 2014-08-26 14:06:24 UTC
Pull request sent: https://github.com/rhq-project/rhq/pull/113

Jay, would you mind to review it? Thanks

Comment 12 Jay Shaughnessy 2014-08-26 14:45:25 UTC
Looks good, see PR comments for one suggestion

Comment 13 Thomas Segismont 2014-08-26 20:44:48 UTC
Merged in master

commit 748df2aff13be656a7d1677d43eebb535f782e27
Author: Thomas Segismont <tsegismo@redhat.com>
Date:   Tue Aug 26 16:03:58 2014 +0200

Not only tell the user a request has been submitted, but if the request failed or succeed and why.

So now the user knows if nothing happens because the resource in already in the inventory, in the discovery queue, or ignored.

Comment 14 Thomas Segismont 2014-08-26 20:48:16 UTC
Merged in release/jon3.3.x (already reviewed by Jay)

commit 8d13693cd15e4f8ba85f2881a2eee885fc17c1a3
Author: Thomas Segismont <tsegismo@redhat.com>
Date:   Tue Aug 26 16:03:58 2014 +0200

(cherry picked from commit 748df2aff13be656a7d1677d43eebb535f782e27)

Comment 15 Simeon Pinder 2014-09-03 20:31:37 UTC
Moving to ON_QA as available for test with the following brew build:
https://brewweb.devel.redhat.com//buildinfo?buildID=381194

Comment 16 Armine Hovsepyan 2014-09-04 15:51:35 UTC
Created attachment 934521 [details]
failed_invnetory_eap5

Comment 17 Armine Hovsepyan 2014-09-04 15:53:37 UTC
verified for eap5 in JON 3.3 ER02
screen-shot attached

fyi: if incorrect resource is imported (e.g. eap server not accessible under provided naming provider URL - error is visible in gui messages) -- not filing a BZ for that.


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