Bug 847674

Summary: [as7] reload operation fails for standalone server - InvalidPluginConfigurationException
Product: [Other] RHQ Project Reporter: Libor Zoubek <lzoubek>
Component: PluginsAssignee: Stefan Negrea <snegrea>
Status: CLOSED CURRENTRELEASE QA Contact: Mike Foley <mfoley>
Severity: urgent Docs Contact:
Priority: high    
Version: 4.4CC: hrupp, theute
Target Milestone: ---   
Target Release: RHQ 4.5.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 847869 (view as bug list) Environment:
Last Closed: 2013-09-01 10:00:50 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 707223, 847869    

Description Libor Zoubek 2012-08-13 09:20:59 UTC
Description of problem: When EAP server starts sending restart-required headers I am not able to reload it using UI.


Version-Release number of selected component (if applicable):
JON 3.1.1.ER1 + EAP6 GA

How reproducible:always


Steps to Reproduce:
1. Have EAP6 protected by user/pass running in standalone mode, imported with children => credentials are correct
2. make server require restart (for example by disabling ExampleDS datasource)
3. start 'reload' operation on server
  
Actual results: Reload operation fails with this.

org.rhq.core.pluginapi.inventory.InvalidPluginConfigurationException: Credentials for plugin to connect to AS7 management interface are invalid - update Connection Settings with valid credentials.
	at org.rhq.modules.plugins.jbossas7.ASConnection.handleAuthorizationFailureResponse(ASConnection.java:341)
	at org.rhq.modules.plugins.jbossas7.ASConnection.executeRaw(ASConnection.java:266)
	at org.rhq.modules.plugins.jbossas7.ASConnection.execute(ASConnection.java:433)
	at org.rhq.modules.plugins.jbossas7.ASConnection.execute(ASConnection.java:374)
	at org.rhq.modules.plugins.jbossas7.StandaloneASComponent.invokeOperation(StandaloneASComponent.java:100)
	at sun.reflect.GeneratedMethodAccessor166.invoke(Unknown Source)


Expected results:


Additional info: Disabling a datasource is not the only way how to reproduce this BZ. It is enough to repeatedly run 'reload' operation on server, it fails for me on the 2nd attempt with above error message.

Comment 1 Stefan Negrea 2012-08-13 21:04:05 UTC
The bug did not affect the restart operation itself. The plugin was not properly detecting when the server was up and operational after a successful restart. 

The code that was probing the server by sending an operation and looking for success or failure on the operation execution. If the server is not fully started, the operation execution could fail in surprising ways, thus throwing exceptions that bubbled up the stack. Updated the probing code to catch exceptions and just consider them failed attempts to connect to the server.

Comment 3 Libor Zoubek 2012-08-21 09:37:52 UTC
Hi Stefan, I was still able to reproduce this BZ on JON 3.1.1.ER2

Comment 4 Libor Zoubek 2012-08-21 09:39:42 UTC
please ignore my previous comment.

Comment 5 Stefan Negrea 2012-08-29 08:46:18 UTC
Updated all the wait methods for reload, shutdown, and restart to have the same design. All the methods now take into account possible exceptions for the test operation sent to the application server.

master branch commit:

http://git.fedorahosted.org/cgit/rhq/rhq.git/commit/?id=e6e91058f3ac76c6458847bd66a8ee5c9c24493e

Comment 6 Heiko W. Rupp 2013-09-01 10:00:50 UTC
Bulk closing of items that are on_qa and in old RHQ releases, which are out for a long time and where the issue has not been re-opened since.