Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.

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