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:
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?
If my assumption is correct, I think the fix should consist in logging an appropriate message on the server and/or the agent.
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.
Created attachment 930796 [details] agent.log
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)
Created attachment 930805 [details] agent.log.2
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.
Pull request sent: https://github.com/rhq-project/rhq/pull/113 Jay, would you mind to review it? Thanks
Looks good, see PR comments for one suggestion
Merged in master commit 748df2aff13be656a7d1677d43eebb535f782e27 Author: Thomas Segismont <tsegismo> 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.
Merged in release/jon3.3.x (already reviewed by Jay) commit 8d13693cd15e4f8ba85f2881a2eee885fc17c1a3 Author: Thomas Segismont <tsegismo> Date: Tue Aug 26 16:03:58 2014 +0200 (cherry picked from commit 748df2aff13be656a7d1677d43eebb535f782e27)
Moving to ON_QA as available for test with the following brew build: https://brewweb.devel.redhat.com//buildinfo?buildID=381194
Created attachment 934521 [details] failed_invnetory_eap5
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.