Bug 1125914

Summary: EAP6 with secured management - confusing error msg when incorrect Truststore Type is set
Product: [JBoss] JBoss Operations Network Reporter: Thomas Segismont <tsegismo>
Component: Plugin -- JBoss EAP 6, UsabilityAssignee: Thomas Segismont <tsegismo>
Status: CLOSED CURRENTRELEASE QA Contact: Mike Foley <mfoley>
Severity: medium Docs Contact:
Priority: unspecified    
Version: JON 3.3.0CC: fbrychta, jkremser, mfoley, rhq-maint, tsegismo
Target Milestone: ER01   
Target Release: JON 3.3.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: 1124845 Environment:
Last Closed: 2014-12-11 14:01:11 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: 1124845    
Bug Blocks:    

Description Thomas Segismont 2014-08-01 10:29:40 UTC
The fix for Bug 1124845 needs to be applied to release/jon3.3.x as well

+++ This bug was initially created as a clone of Bug #1124845 +++

Description of problem:
$Summary

Version-Release number of selected component (if applicable):
Version :	
3.2.0.GA Update 02
Build Number :	
dfe3e4b:cf4474c

jon-plugin-pack-eap-3.2.0.GA-update-01

How reproducible:
Always

Steps to Reproduce:
1. Secure EAP management interface according to EAP Security guide (use jks for truststore/keystore)
2. import this eap6 resource and set correctly all properties in Inventory->Connection Settings
3. set Truststore Type to pkcs12

Actual results:
Resource is correctly marked as down but error msg visible in Message Center is confusing. User has no idea that this error is caused by incorrect Truststore Type

Expected results:
User friendly error msg

Additional info:
Err msg:
org.rhq.core.clientapi.agent.PluginContainerException: Failed to start component for resource Resource[id=10144, uuid=30024866-1b10-43e1-b8ba-0866dcc40ba6, type={JBossAS7}JBossAS7 Standalone Server, key=hostConfig: /home/hudson/jboss-eap6-standalone/standalone/configuration/standalone-full-secured-changed.xml, name=EAP (0.0.0.0:9543), parent=fbr-eap6-sec2.bc.jonqe.lab.eng.bos.redhat.com, version=EAP 6.2.4.GA].
	at org.rhq.core.pc.inventory.InventoryManager.activateResource(InventoryManager.java:1943)
	at org.rhq.core.pc.inventory.AvailabilityExecutor.checkInventory(AvailabilityExecutor.java:361)
	at org.rhq.core.pc.inventory.AvailabilityExecutor.startScan(AvailabilityExecutor.java:195)
	at org.rhq.core.pc.inventory.CustomScanRootAvailabilityExecutor.startScan(CustomScanRootAvailabilityExecutor.java:71)
	at org.rhq.core.pc.inventory.AvailabilityExecutor.call(AvailabilityExecutor.java:152)
	at org.rhq.core.pc.inventory.AvailabilityExecutor.call(AvailabilityExecutor.java:62)
	at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
	at java.util.concurrent.FutureTask.run(FutureTask.java:166)
	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:178)
	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:292)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
	at java.lang.Thread.run(Thread.java:722)
Caused by: java.lang.RuntimeException: java.io.IOException: DerInputStream.getLength(): lengthTag=109, too big.
	at org.rhq.modules.plugins.jbossas7.SchemeRegistryBuilder.buildSchemeRegistry(SchemeRegistryBuilder.java:87)
	at org.rhq.modules.plugins.jbossas7.ASConnection.(ASConnection.java:179)
	at org.rhq.modules.plugins.jbossas7.BaseServerComponent.start(BaseServerComponent.java:108)
	at sun.reflect.GeneratedMethodAccessor61.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:601)
	at org.rhq.core.pc.inventory.ResourceContainer$ComponentInvocation.call(ResourceContainer.java:654)
	at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
	at java.util.concurrent.FutureTask.run(FutureTask.java:166)
	... 3 more
Caused by: java.io.IOException: DerInputStream.getLength(): lengthTag=109, too big.
	at sun.security.util.DerInputStream.getLength(DerInputStream.java:561)
	at sun.security.util.DerValue.init(DerValue.java:365)
	at sun.security.util.DerValue.(DerValue.java:320)
	at sun.security.pkcs12.PKCS12KeyStore.engineLoad(PKCS12KeyStore.java:1220)
	at java.security.KeyStore.load(KeyStore.java:1214)
	at org.rhq.modules.plugins.jbossas7.SchemeRegistryBuilder.loadKeystore(SchemeRegistryBuilder.java:103)
	at org.rhq.modules.plugins.jbossas7.SchemeRegistryBuilder.buildSchemeRegistry(SchemeRegistryBuilder.java:63)
	... 11 more

Comment 1 Thomas Segismont 2014-08-01 10:33:30 UTC
Fixed in master

commit 62986312e18a2f02e7336fe33acdbd535b85016a
Author: Thomas Segismont <tsegismo>
Date:   Fri Aug 1 12:28:24 2014 +0200

Now trying to load the truststore/keystore when validating the connection settings and retun correct message in case of failure

Comment 2 Jirka Kremser 2014-08-08 11:52:01 UTC
branch:  release/jon3.3.x
link:    https://github.com/rhq-project/rhq/commit/2fee4bf48
time:    2014-08-08 13:41:58 +0200
commit:  2fee4bf48a801bc30fe67ac53deb105bb4251791
author:  Thomas Segismont - tsegismo
message: Bug 1124845 - EAP6 with secured management - confusing error msg when
         incorrect Truststore Type is set

         Now trying to load the truststore/keystore when validating the 
         connection settings and retun correct message in case of
         failure

         (cherry picked from commit
         62986312e18a2f02e7336fe33acdbd535b85016a) Signed-off-by: Jirka
         Kremser <jkremser>

Comment 3 Simeon Pinder 2014-08-19 23:50:46 UTC
Moving to ON_QA as available to test in the following brew build:

https://brewweb.devel.redhat.com//buildinfo?buildID=379025