db2index: entry too large (X bytes) for the buffer size (Y bytes)
Environment
- 389-ds-base
Issue
During db2index, db2ldif, ldif2db and other tasks the following error may be encountered in the output or the slapd error log.
db2index: entry too large (X bytes) for the buffer size (Y bytes)
Resolution
If you have 389-ds-base 1.3.5.X or higher:
This issue should not affect you. The dbcachesize will automatically expand to accommodate larger entries into the buffer. If you are encountering this with 1.3.5.X, a critical warning will be emitted. It is likely the entry you are importing is greater than the size of ram on your system.
If you have 389-ds-base 1.3.4.X or lower:
To resolve this issue you must adjust the value of the nsslapd-dbcachesize. The buffer size is set to 80% of the value of dbcachesize. If you had:
db2index: entry too large (1073741824 bytes) for the buffer size (429496729 bytes)
This means your have a dbcachesize of 512mb, 80% being 409MB. To accommodate the entry of 1073741824 bytes, you must set dbcachesize to a value where 80% of it is greater than the entry size.
(entrysize / 4) * 5 = dbcachesize to set
In our example, this would be 1342177280.
dn: cn=config,cn=ldbm database,cn=plugins,cn=config
changetype: modify
replace: nsslapd-dbcachesize
nsslapd-dbcachesize: 1342177280
Root Cause
If you have 389-ds-base 1.3.5.X or higher:
You are trying to import or index entries that will exceed your systems available memory.
If you have 389-ds-base 1.3.4.X or lower:
The buffer size is statically allocated as a derivation of dbcachesize (80%).
Diagnostic Steps
This message will be displayed in the error log and on stdout of the relevant command.
This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.
Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.
