Restoring ldap fails

Revision as of 15:31, 7 June 2016 by Teodor Vizirov (talk | contribs) (→‎Restoring LDAP fails)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Restoring LDAP fails

   KB 22709        Last updated on 2016-06-7  

(0 votes)


Trying to restore ldap with zmslapadd terminates with the following error:

$ /opt/zimbra/libexec/zmslapadd /tmp/ldap.bak
/opt/zimbra/libexec/zmslapadd: line 17: ulimit: core file size: cannot modify limit: Operation not permitted
555c9803 => mdb_tool_next_id: dn2id_add failed: MDB_MAP_FULL: Environment mapsize limit reached (-30792)
555c9803 => mdb_tool_entry_put: txn_aborted! MDB_MAP_FULL: Environment mapsize limit reached (-30792)
slapadd: could not add entry dn="cn=lpn-prd-mstr034.prosodie,cn=servers,cn=zimbra" (line=9786): txn_aborted! MDB_MAP_FULL: Environment mapsize limit reached (-30792)
_ 0.01% eta 09m26s elapsed none spd 13.4 M/s
Closing DB...


To fix the issue we need to set the ldap_db_maxsize attribute to its default setting:

zmlocalconfig -e ldap_db_maxsize=85899345920

After changing the attribute repeat the operation again.

Additional Information

Over time, depending on write activity, which is unique to every client, the MDB database will suffer from fragmentation. During the write process, mdb tries to reuse locations that were previously freed by delete activity. Essentially, a write can come in, that is just a "wrong" size. In this case MDB tries repeatedly to find an open slot in the approximately 4 million empty slots currently available in the database. This causes slapd to block write requests. The fix for this issue is to dump the LDAP database and reload it.

To accomplish that, as the zimbra user:

ldap stop
/opt/zimbra/libexec/zmslapcat /tmp (or other good location)
cd /opt/zimbra/data/ldap
mv mdb mdb.backup
mkdir -p mdb/db
cd ~
/opt/zimbra/libexec/zmslapadd /tmp/ldap.bak
ldap start

Verified Against: Zimbra Collaboration 8.6, 8.5, 8.0 Date Created: 06/07/2016
Article ID: Date Modified: 2016-06-07

Try Zimbra

Try Zimbra Collaboration with a 60-day free trial.
Get it now »

Want to get involved?

You can contribute in the Community, Wiki, Code, or development of Zimlets.
Find out more. »

Looking for a Video?

Visit our YouTube channel to get the latest webinars, technology news, product overviews, and so much more.
Go to the YouTube channel »

Wiki/KB reviewed by SME1 SME2 COPY EDITOR Last edit by Teodor Vizirov
Jump to: navigation, search