This service will be undergoing maintenance at 00:00 UTC, 2016-09-28. It is expected to last about 1 hours
Bug 788487 - AS7 plugin: allow manually add a standalone server
AS7 plugin: allow manually add a standalone server
Status: CLOSED CURRENTRELEASE
Product: RHQ Project
Classification: Other
Component: Plugins (Show other bugs)
4.2
Unspecified Unspecified
medium Severity unspecified (vote)
: ---
: RHQ 4.9
Assigned To: Thomas Segismont
Mike Foley
:
Depends On:
Blocks: as7-plugin 824513
  Show dependency treegraph
 
Reported: 2012-02-08 04:49 EST by Heiko W. Rupp
Modified: 2014-03-26 04:31 EDT (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 824513 (view as bug list)
Environment:
Last Closed: 2014-03-26 04:31:39 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:


Attachments (Terms of Use)

  None (edit)
Description Heiko W. Rupp 2012-02-08 04:49:24 EST
Allow to manually add a standalone server.

In order to add it, the server must already have a management user set up or security disabled. The "add rhq user" operation can not work in this case.

( We need to make sure the above operation will not do harm on the local file system of the agent )
Comment 1 Heiko W. Rupp 2012-02-08 06:10:44 EST
master 8f06f86c129bf5b15
Comment 2 Libor Zoubek 2012-05-16 07:20:03 EDT
on JON 3.1.Beta1 EAP6 ER6 - I am not able to add standalone server manually

There is one server running on agent host (not in inventory) and 2nd server on remote host.

When I try to add EAP on local agent host it get's imported, but availability is off. Availability message says:

org.rhq.core.pluginapi.inventory.InvalidPluginConfigurationException: The original product type discovered for this AS7 server was JBoss AS 7, but the server is now reporting its product type is [JBoss EAP 6].
	at org.rhq.modules.plugins.jbossas7.BaseServerComponent.getAvailability(BaseServerComponent.java:128)

When I try to import EAP on remote host (typing hostname instead of localhost) I get error in UI:

luginContainerException:Failed to add resource with type [JBossAS7 Standalone Server] and parent resource id [13495] -> org.rhq.core.util.exception.WrappedRemotingException:null -> org.rhq.core.util.exception.WrappedRemotingException:Discovery component invocation failed. -> org.rhq.core.util.exception.WrappedRemotingException:null
Comment 3 Charles Crouch 2012-05-22 16:15:28 EDT
With Heiko to investigate.
Comment 4 Heiko W. Rupp 2012-05-23 09:14:07 EDT
I can "only" reproduce it every 2nd time 

One place is

org.rhq.core.pc.inventory.InventoryManager#updateAvailability
where the resourceContainer is null (perhaps the start() method was not yet called? 



The other place is org.rhq.modules.plugins.jbossas7.BaseServerComponent#validateServerAttributes

(which shows up in the debugger after the above call to updateAvail and is called from
BaseServerComponent.getAvail() which is called from BaseServerComponent.start()

Here 

          baseDir = serverPluginConfig.getBaseDir().getCanonicalFile();
throws a NPE as serverPluginConfig.getBaseDir() is null.



2012-05-23 14:16:55,161 ERROR [ResourceContainer.invoker.daemon-11] (rhq.modules.plugins.jbossas7.BaseServerComponent)- Failed to validate base dir for {JBossAS7}JBossAS7 Standalone Server [snert:9990].
java.lang.NullPointerException
        at org.rhq.modules.plugins.jbossas7.BaseServerComponent.validateServerAttributes(BaseServerComponent.java:133)
        at org.rhq.modules.plugins.jbossas7.BaseServerComponent.getAvailability(BaseServerComponent.java:115)
        at org.rhq.modules.plugins.jbossas7.BaseServerComponent.start(BaseServerComponent.java:92)



Later in this method at

        if (runtimeType != null) {
            JBossProductType type = serverPluginConfig.getProductType();

An exception is thrown when type is null, which seems always the case for the manually imported server. 

Looks like the ProductInfo information is never passed to the plugin config.
Simply adding the productType fixes the "red bar" like this:


        pluginConfig.put(new PropertySimple("manuallyAdded", true));
+        pluginConfig.put(new PropertySimple("productType",productType.name()));

        DiscoveredResourceDetails detail = new DiscoveredResourceDetails(context.getResourceType(), key, name,

It also looks like this fixes the issue with updateAvailabiltiy() above.
Comment 5 Heiko W. Rupp 2012-05-23 12:08:24 EDT
master f6a5001

Also prevent start/restart from being run for manually added servers, as we can not start processes on machines without agents.
Comment 6 Libor Zoubek 2012-05-30 04:58:34 EDT
on JON 3.1.ER6 there is still little issue with adding server manually. Now it does not depend on whether server is on localhost or not. Each time I try to manually add EAP6.ER8 I get following error in message center:


The original product type discovered for this AS7 server was null, but the server is now reporting its product type is [JBoss EAP 6]

I get this error, but server is correctly imported anyway. I don't consider it as blocking bug anymore, but it confuses user.
Comment 7 Heiko W. Rupp 2012-06-04 10:50:18 EDT
That red-bar does not always show up (just tried it and it did not show up).
As it does not prevent import, it is rather harmless and the user can when he clicks on reload button on that inventory page he will soon see the imported server.
Comment 8 Heiko W. Rupp 2013-09-04 04:57:26 EDT
Thomas,
can you if you have time in 4.10 check the status of this one?
Comment 9 Thomas Segismont 2013-09-18 06:01:26 EDT
(In reply to Libor Zoubek from comment #6)
> on JON 3.1.ER6 there is still little issue with adding server manually. Now
> it does not depend on whether server is on localhost or not. Each time I try
> to manually add EAP6.ER8 I get following error in message center:
> 
> 
> The original product type discovered for this AS7 server was null, but the
> server is now reporting its product type is [JBoss EAP 6]
> 
> I get this error, but server is correctly imported anyway. I don't consider
> it as blocking bug anymore, but it confuses user.

This problem was addressed in the fix for BZ913764.

Just did a test again with EAP 6.1 on a remote machine and the managed server product type was properly discovered.

Setting target release to RHQ 4.9 as the fix for BZ913764 is in this release.
Comment 10 Heiko W. Rupp 2014-03-26 04:31:39 EDT
Bulk closing now that 4.10 is out.

If you think an issue is not resolved, please open a new BZ and link to the existing one.

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