Bug 1302134 - Too generic selftest error messages
Too generic selftest error messages
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: pki-core (Show other bugs)
7.3
Unspecified Unspecified
unspecified Severity unspecified
: rc
: 7.3
Assigned To: Endi Sukma Dewata
Asha Akkiangady
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2016-01-26 17:02 EST by Matthew Harmsen
Modified: 2016-11-04 01:22 EDT (History)
3 users (show)

See Also:
Fixed In Version: pki-core-10.3.1-1.el7
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2016-11-04 01:22:31 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Matthew Harmsen 2016-01-26 17:02:33 EST
If an error happens in SelfTestSubsystem initialization, the code will generate a generic error message without describing what's actually considered "invalid".

{{{
[22/Mar/2015:06:45:10][main]: CMS:Caught EBaseException
The self test plugin named selftests.container.logger.class contains a value com.netscape.cms.logging.RollingLogFile which is invalid.
    at com.netscape.cmscore.selftests.SelfTestSubsystem.init(SelfTestSubsystem.java:1422)
    at com.netscape.cmscore.apps.CMSEngine.initSubsystem(CMSEngine.java:866)
    ...
}}}

Ideally the code should describe the error, throw the original exception, or chain the exception.
Comment 2 Mike McCune 2016-03-28 18:32:18 EDT
This bug was accidentally moved from POST to MODIFIED via an error in automation, please see mmccune@redhat.com with any questions
Comment 4 Geetika Kapoor 2016-09-13 05:14:06 EDT
Hello,

Could you please write some test steps so as to get desired result.
In which all scenario's this behavior can be observed.

Thanks
Geetika
Comment 5 Endi Sukma Dewata 2016-09-13 16:18:08 EDT
Geetika,

Here's a way to verify the fix:

1. Install CA.
2. Change something in selftest configuration in CS.cfg that will break the selftest, for example an invalid class name:

  selftests.container.logger.class=com.netscape.cms.logging.RollingLogFileX

3. Restart Tomcat. The CA will fail to start due to selftest failure.
4. Check the debug log, it should now show the exception:

Caused by: java.lang.ClassNotFoundException: com.netscape.cms.logging.RollingLogFileX
        at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1332)
        at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1166)
        at java.lang.Class.forName0(Native Method)
        at java.lang.Class.forName(Class.java:264)
        at com.netscape.cmscore.selftests.SelfTestSubsystem.init(SelfTestSubsystem.java:1312)
        ...
Comment 6 Geetika Kapoor 2016-09-14 01:49:16 EDT
Thanks Endi for providing verification steps.

Build: pki-tps-10.3.3-9.el7pki.x86_64


Test Case 1: Provide an invalid class name and see if self test fails

<debug log>
Caused by: java.lang.ClassNotFoundException: com.netscape.cms.logging.RollingLogFileXXXXX
        at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1858)
        at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1701)
        at java.lang.Class.forName0(Native Method)
        at java.lang.Class.forName(Class.java:264)
        at com.netscape.cmscore.selftests.SelfTestSubsystem.init(SelfTestSubsystem.java:1312)
        ... 38 more

</debug logs>


Test Case 2: Check self test status in "transactions" logs:

0.localhost-startStop-1 - [14/Sep/2016:18:50:23 IST] [20] [1] SelfTestSubsystem: Initializing self test plugins:
0.localhost-startStop-1 - [14/Sep/2016:18:50:23 IST] [20] [1] SelfTestSubsystem:  the self test property name selftests.container.logger.class with a value of com.netscape.cms.logging.RollingLogFileXXXXX threw an Exception
Comment 8 errata-xmlrpc 2016-11-04 01:22:31 EDT
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://rhn.redhat.com/errata/RHBA-2016-2396.html

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