Bug 999494 - Import child Resource: jboss as (both eap 4 and 5) are not being imported to inventory list after successful import operation
Import child Resource: jboss as (both eap 4 and 5) are not being imported to ...
Status: CLOSED CURRENTRELEASE
Product: JBoss Operations Network
Classification: JBoss
Component: Plugin -- JBoss EAP 4, Plugin -- JBoss EAP 5 (Show other bugs)
JON 3.2
All Linux
medium Severity high
: ER02
: JON 3.3.0
Assigned To: Thomas Segismont
Armine Hovsepyan
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2013-08-21 08:15 EDT by Armine Hovsepyan
Modified: 2015-09-02 20:01 EDT (History)
6 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2014-12-11 09:02:33 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


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

  None (edit)
Description Armine Hovsepyan 2013-08-21 08:15:29 EDT
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 08:53:01 EDT
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 08:56:10 EDT
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 09:22:11 EDT
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 05:48:00 EDT
Created attachment 930796 [details]
agent.log
Comment 6 Armine Hovsepyan 2014-08-26 05:48:45 EDT
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 06:14:47 EDT
Created attachment 930805 [details]
agent.log.2
Comment 8 Thomas Segismont 2014-08-26 09:32:16 EDT
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 10:06:24 EDT
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 10:45:25 EDT
Looks good, see PR comments for one suggestion
Comment 13 Thomas Segismont 2014-08-26 16:44:48 EDT
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 16:48:16 EDT
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 16:31:37 EDT
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 11:51:35 EDT
Created attachment 934521 [details]
failed_invnetory_eap5
Comment 17 Armine Hovsepyan 2014-09-04 11:53:37 EDT
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.