This service will be undergoing maintenance at 00:00 UTC, 2016-08-01. It is expected to last about 1 hours
Bug 883825 - Resource manual import doesn't work
Resource manual import doesn't work
Status: VERIFIED
Product: JBoss Enterprise Web Server 2
Classification: JBoss
Component: JON Plugin (Show other bugs)
unspecified
x86_64 Linux
unspecified Severity high
: ---
: ---
Assigned To: Simeon Pinder
Mike Foley
: Reopened
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2012-12-05 06:59 EST by Libor Fuka
Modified: 2015-08-31 23:00 EDT (History)
9 users (show)

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


Attachments (Terms of Use)
where to go to repriduce the problem. (253.95 KB, image/jpeg)
2013-04-17 07:42 EDT, Jean-frederic Clere
no flags Details

  None (edit)
Description Libor Fuka 2012-12-05 06:59:21 EST
Description of problem:
Tomcat6 resource manual import doesn't work, but username and password were set correctly.

java.lang.RuntimeException:[1354708330177] org.rhq.core.clientapi.agent.PluginContainerException:Failed to add resource with type [Tomcat Server] and parent resource id [10001] -> org.rhq.core.util.exception.WrappedRemotingException:The resource [Resource[id=10301, uuid=e6848f3a-c527-45de-ae65-2ae3c3e545fb, type={Tomcat}Tomcat Server, key=/opt/EWS/2.0/GA/jboss-ews-2.0/tomcat6, name=Tomcat (8080), parent=lfukanotebook, version=6.0.35-24_patch_01.ep6.el6.Red Hat EWS]] has been added but could not be started. Verify the supplied configuration values:  -> org.rhq.core.util.exception.WrappedRemotingException:Failed to start component for resource Resource[id=10301, uuid=e6848f3a-c527-45de-ae65-2ae3c3e545fb, type={Tomcat}Tomcat Server, key=/opt/EWS/2.0/GA/jboss-ews-2.0/tomcat6, name=Tomcat (8080), parent=lfukanotebook, version=6.0.35-24_patch_01.ep6.el6.Red Hat EWS]. -> org.rhq.core.util.exception.WrappedRemotingException:Invalid JMX credentials specified for connecting to this server. -> org.rhq.core.util.exception.WrappedRemotingException:Could not connect [service:jmx:rmi:///jndi/rmi://localhost:8100/jmxrmi] java.lang.SecurityException: Authentication failed! Username or password is null -> org.rhq.core.util.exception.WrappedRemotingException:Authentication failed! Username or password is null
--- STACK TRACE FOLLOWS ---
[1354708330177] org.rhq.core.clientapi.agent.PluginContainerException:Failed to add resource with type [Tomcat Server] and parent resource id [10001] -> org.rhq.core.util.exception.WrappedRemotingException:The resource [Resource[id=10301, uuid=e6848f3a-c527-45de-ae65-2ae3c3e545fb, type={Tomcat}Tomcat Server, key=/opt/EWS/2.0/GA/jboss-ews-2.0/tomcat6, name=Tomcat (8080), parent=lfukanotebook, version=6.0.35-24_patch_01.ep6.el6.Red Hat EWS]] has been added but could not be started. Verify the supplied configuration values:  -> org.rhq.core.util.exception.WrappedRemotingException:Failed to start component for resource Resource[id=10301, uuid=e6848f3a-c527-45de-ae65-2ae3c3e545fb, type={Tomcat}Tomcat Server, key=/opt/EWS/2.0/GA/jboss-ews-2.0/tomcat6, name=Tomcat (8080), parent=lfukanotebook, version=6.0.35-24_patch_01.ep6.el6.Red Hat EWS]. -> org.rhq.core.util.exception.WrappedRemotingException:Invalid JMX credentials specified for connecting to this server. -> org.rhq.core.util.exception.WrappedRemotingException:Could not connect [service:jmx:rmi:///jndi/rmi://localhost:8100/jmxrmi] java.lang.SecurityException: Authentication failed! Username or password is null -> org.rhq.core.util.exception.WrappedRemotingException:Authentication failed! Username or password is null
   at Unknown.java_lang_RuntimeException_RuntimeException__V(Unknown Source)
   at Unknown.com_google_gwt_user_client_rpc_core_java_lang_RuntimeException_1FieldSerializer_instantiate__Lcom_google_gwt_user_client_rpc_SerializationStreamReader_2Ljava_lang_RuntimeException_2(Unknown Source)
   at Unknown.com_google_gwt_user_client_rpc_impl_SerializerBase$MethodMap_$instantiate__Lcom_google_gwt_user_client_rpc_impl_SerializerBase$MethodMap_2Lcom_google_gwt_user_client_rpc_SerializationStreamReader_2Ljava_lang_String_2Ljava_lang_Object_2(Unknown Source)
   at Unknown.com_google_gwt_user_client_rpc_impl_SerializerBase_$instantiate__Lcom_google_gwt_user_client_rpc_impl_SerializerBase_2Lcom_google_gwt_user_client_rpc_SerializationStreamReader_2Ljava_lang_String_2Ljava_lang_Object_2(Unknown Source)
   at Unknown.com_google_gwt_user_client_rpc_impl_AbstractSerializationStreamReader_$readObject__Lcom_google_gwt_user_client_rpc_impl_AbstractSerializationStreamReader_2Ljava_lang_Object_2(Unknown Source)
   at Unknown.com_google_gwt_user_client_rpc_impl_RequestCallbackAdapter_$onResponseReceived__Lcom_google_gwt_user_client_rpc_impl_RequestCallbackAdapter_2Lcom_google_gwt_http_client_Request_2Lcom_google_gwt_http_client_Response_2V(Unknown Source)
   at Unknown.org_rhq_enterprise_gui_coregui_client_util_rpc_TrackingRequestCallback_onResponseReceived__Lcom_google_gwt_http_client_Request_2Lcom_google_gwt_http_client_Response_2V(Unknown Source)
   at Unknown.com_google_gwt_http_client_Request_$fireOnResponseReceived__Lcom_google_gwt_http_client_Request_2Lcom_google_gwt_http_client_RequestCallback_2V(Unknown Source)
   at Unknown.com_google_gwt_http_client_RequestBuilder$1_onReadyStateChange__Lcom_google_gwt_xhr_client_XMLHttpRequest_2V(Unknown Source)
   at Unknown.anonymous(Unknown Source)
   at Unknown.com_google_gwt_core_client_impl_Impl_apply__Ljava_lang_Object_2Ljava_lang_Object_2Ljava_lang_Object_2Ljava_lang_Object_2(Unknown Source)
   at Unknown.com_google_gwt_core_client_impl_Impl_entry0__Ljava_lang_Object_2Ljava_lang_Object_2Ljava_lang_Object_2Ljava_lang_Object_2(Unknown Source)
   at Unknown.anonymous(Unknown Source)
   at Unknown.anonymous(Unknown Source)

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


How reproducible:


Steps to Reproduce:
1.
2.
3.
  
Actual results:


Expected results:


Additional info:
Comment 1 Rémy Maucherat 2012-12-17 12:47:13 EST
Manual add instructions for plugins that support it:
- log into RHQ and select an imported/available platform from the left nav tree
- click on Inventory -> Child Resources tab
- you will see an 'Import' drop down list from which you can choose "Tomcat Server". 
- Fill out the details to manually add the new "Tomcat Server" to the platform.
Comment 5 Jean-frederic Clere 2013-04-17 07:42:30 EDT
Created attachment 736803 [details]
where to go to repriduce the problem.

Inventory + All resources + click on the box + inventory (in the box frame).
Comment 6 Jean-frederic Clere 2013-04-17 08:51:12 EDT
it looks fixed in master... Need to find the fix :-(
Comment 7 Jean-frederic Clere 2013-04-23 05:22:02 EDT
After looking to the issue it doesn't seem to be a problem of the plugin.
Comment 8 Jean-frederic Clere 2013-04-24 07:31:02 EDT
So after looking into this some more with one of the other developers here, we are proposing that we handle BZ 883825 in the following ways:
1) Update the test instructions to ONLY test Manual Import in the following way:
  - "You should not test this BZ by attempting to manually add a Tomcat/EWS resource that shows up in the 'Discovery Queue'." 
    WHY: Manual Import is meant to be used to add the following types of servers to RHQ inventory 
          i)offline resources with no current running processes OR
          ii)servers that CANNOT be successfully auto discovered. 
         Once Tomcat/EWS servers have been successfully discovered(i.e showing up in 'Discovery Queue'), then RHQ now knows about these resources, and subsequent 'Manual Import' requests for running servers will instead be treated as attempt to update an existing resource.  This is not the intent of this BZ, but instead to exercise the Manual Import which cannot be done if those same Tomcat/EWS instances are being automatically marked as discovered/available for import.

2) Before retesting BZ 883825, if you have any Tomcat instances in your 'Discovery Queue' you should:
   i)From Inventory-> Resources -> Discovery Queue, import all Tomcat/EWS instances that show up.
   ii)Then shutdown all Tomcat/EWS instances, such that there are no processes available for them.
   iii)Navigate to root platform -> Inventory -> Child Resources to select all resources of type "Tomcat Server" and uninventorying them. 
   iv)Now attempt to 'Manual Import' one of the Tomcat/EWS instances as described before.  If successful you should see the Tomcat/EWS instance show up as a child of the root platform.  You should also be able to start this instance by navigating to the {Manually Imported instance} -> Operations tab.  *This is necessary to clear out auto-discovered instances before testing Manual Import so that they are not incorrectly detected by RHQ as an attempt to update discovered but NOT inventoried instances of Tomcat/EWS.*   

3) While the erroneous state and error message is reliably reproducible with JON 3.1.x and in master with supported browser configurations, it also represents an uncommon edge case not likely to be encountered by many customers.  With greater digging it was discovered that this specific code path, i.e one where the customer is trying to Manually Import instances that are ALREADY available for import from the Discovery Queue, is not and should not be supported by RHQ for the following reasons:
   i) goes counter to one of the stated goals(see 1.ii above) of Manual Import
   ii) although there is code within the plugin container to attempt to support a Manual Import for a resource already indexed by RHQ, it a)does not work and b) should not be allowed because it would add support for non-standard way of altering the configuration of detected resources which is already fully supported by the UI and CLI with well understood semantics.
   iii) it is also semantically unclear what should be the behavior for a Manual Import that maps to an existing RHQ instance in the IGNORED state.  Again allowing an update of a previously indexed Resource via Manual Import is not the right/support path to update Resource configuration or Resource inventory state.

4) Given that Manual Import can be used to inadvertently attempt to update an already indexed Resource(configuration and inventory status), the following changes will be made to the RHQ:
   i) modify the InventoryManager(Plugin Container) to remove logic that attempts to support updates to already indexed RHQ resources. Log informative errors when this occurs.
   ii) modify the release notes to include a caution for users attempting to Manually Import resources that already show up in the 'Discovery Queue' with the workaround described in 2) above.
   iii) modify the RHQ/JON remote api documentation to more clearly describe what happens with unintentional updates.
   iv) have this BZ and 'Discovery Queue' clean out(2 above) mechanism described/recorded as knowledge base entries in case customers do run into this issue.
   v) improve server side handling of such request via Manual Import that translate into Resource update requests such that it is prevented and appropriately logged.       

5) This BZ should be modified so that it does not block either JON or EWS releases since it represents a remote edge case that is to be discouraged anyway.
Comment 13 Libor Fuka 2013-04-25 03:35:48 EDT
I encountered another problem during manual import of Tomcat.
Steps to reproduce:
1. Don't start Tomcat (Tomcat is not in discovery queue)
2. Manually add Tomcat - import is successfully done
3. wait few secs
4. then start Tomcat from opeartion tab
5. Tomcat starts successfully but you will see this error in agent.log
2013-04-25 00:23:02,556 ERROR [ResourceContainer.invoker.nonDaemon-1] (jboss.on.plugins.tomcat.TomcatServerOperationsDelegate)- Script returned error or non-zero exit code while starting the Tomcat instance - exitCode=[UNKNOWN], output=[Using CATALINA_BASE:   "c:\qa\lfuka\workspace\jboss-ews-2.0\share\tomcat7"
Using CATALINA_HOME:   "c:\qa\lfuka\workspace\jboss-ews-2.0\share\tomcat7"
Using CATALINA_TMPDIR: "c:\qa\lfuka\workspace\jboss-ews-2.0\share\tomcat7\temp"
Using JRE_HOME:        "C:\Program Files\jdk_noeTS_locally\jre"
Using CLASSPATH:       "c:\qa\lfuka\workspace\jboss-ews-2.0\share\tomcat7\bin\bootstrap.jar;c:\qa\lfuka\workspace\jboss-ews-2.0\share\tomcat7\bin\tomcat-juli.jar"
].
6. You will see failed of start operation in Operation tab - History, but Tomcat starts on managed host OK
Comment 14 Libor Fuka 2013-06-12 08:33:23 EDT
This is RFE for EWS JON Plugin Doc. We don't have any JON EWS plugin guide yet. We should create this new guide in future EWS releases, if not already exists in JON documentation.
Comment 15 Libor Fuka 2013-11-27 05:26:47 EST
Tested with JON 3.2.0.ER7 + EWS 2.0.1 and VERIFIED on RHLE5, RHEL6 (32bits, x86_64), MS Windows 2008 and 2008R2, Solaris 10, 11 (32bit, 64bit, SPARC)

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