Bug 1643587

Summary: default of "nsslapd-errorlog-maxlogsperdir: 1" causing huge log files
Product: Red Hat Enterprise Linux 7 Reporter: Josip Vilicic <jvilicic>
Component: 389-ds-baseAssignee: mreynolds
Status: CLOSED ERRATA QA Contact: RHDS QE <ds-qe-bugs>
Severity: high Docs Contact:
Priority: high    
Version: 7.5CC: aadhikar, cpelland, gparente, lkrispen, msauton, nkinder, pasik, rmeggins, spichugi, tbordaz, tmihinto, vashirov
Target Milestone: rc   
Target Release: 7.7   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: 389-ds-base-1.3.9.1-1.el7 Doc Type: Bug Fix
Doc Text:
Cause: Setting a verbose error logging level Consequence: The error log will not be rotated once it hits the maximum file size Fix: There was code logic that prevented the error log from being rotated if there is only one log set for "maximum number of logs". We changed the default to allow 2 error logs. Result: The errors log is rotated as expected.
Story Points: ---
Clone Of: Environment:
Last Closed: 2019-08-06 12:58:51 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:

Description Josip Vilicic 2018-10-26 15:39:31 UTC
Description of problem:
DS default of not rotating error log file can lead to filling up /var filesystem with disastrous results


Version-Release number of selected component (if applicable):
389-ds-base-1.3.7.5-25.el7_5.x86_64
389-ds-base-1.3.6.1-16.el7.x86_64
389-ds-base-1.3.6.1-28.el7


How reproducible:
consistent


Steps to Reproduce:
1. Install IPA
2. Have default of "nsslapd-errorlog-maxlogsperdir: 1"


Actual results:
Large log files if many errors are reported, leading to possible crashes when /var fills up


Expected results:
Either truncation of errorlog file at "nsslapd-errorlog-maxlogsize: 100" or a default of at least 2 files for rotation.


Additional info:
1) Documentation of default:
   "3.1.1.90. nsslapd-errorlog-maxlogsperdir (Maximum Number of Error Log Files)"
   https://access.redhat.com/documentation/en-us/red_hat_directory_server/10/html/configuration_command_and_file_reference/core_server_configuration_reference#cnconfig-nsslapd_errorlog_maxlogsperdir_Maximum_Number_of_Error_Log_Files

   "This attribute sets the total number of error logs that can be contained in the directory where the error log is stored. ... The default is 1 log. If this default is accepted, the server does not rotate the log, and it grows indefinitely."

2) Other environments:
   a) My server:
   [root@ipa74master slapd-JVIPA74-COM]# ldapsearch -x -D "cn=Directory Manager" -W -b "cn=config" | grep errorlog-maxlogsperdir
   Enter LDAP Password: 
   nsslapd-errorlog-maxlogsperdir: 1
   [root@ipa74master slapd-JVIPA74-COM]# rpm -qa ipa-server
   ipa-server-4.5.0-21.el7.x86_64
   [root@ipa74master slapd-JVIPA74-COM]# rpm -qa 389-ds-base
   389-ds-base-1.3.6.1-16.el7.x86_64

   b) Alan Heverley also has "nsslapd-errorlog-maxlogsperdir: 1" on IPA 4.5.4, 389-ds-base-1.3.7.5-19.el7_5.x86

   c) German's replica has a "1" with 389-ds-base-1.3.6.1-28.el7_4.x86_64 on RHEL 7.4

Comment 2 mreynolds 2019-01-14 17:07:36 UTC
If the maximum number of logs is set to "1" then unfortunately we never rotate it.  We should set the errors log default to "2" (which is the workaround), otherwise maxlogsize is just ignored and the log growth is unchecked.

Comment 3 mreynolds 2019-01-14 17:16:15 UTC
Upstream ticket:
https://pagure.io/389-ds-base/issue/50153

Comment 6 Akshay Adhikari 2019-05-09 10:29:26 UTC
Build Tested: 389-ds-base-1.3.9.1-5.el7.x86_64

Steps:

1) Do a ldapsearch on a fresh LDAP instance to check the default value for nsslapd-errorlog-maxlogsperdir attribute.

[root@aadhikar ~]# ldapsearch -xLLL -p 389 -h localhost -D "cn=Directory Manager" -w password -b "cn=config" | grep nsslapd-errorlog-maxlogsperdir
nsslapd-errorlog-maxlogsperdir: 2

The default value is correct, hence Marking it as VERIFIED.

Comment 8 errata-xmlrpc 2019-08-06 12:58:51 UTC
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://access.redhat.com/errata/RHBA-2019:2152