Symas OpenLDAP Knowledge Base

How to Fix MDB Map Full Error

Overview

The MDB backend requires a setting called maxsize/olcDbMaxSize, which sets the maximum on-disk size (in bytes) of its data.mdb file. When the amount of data inside the data.mdb file reaches the maximum size, the MDB database will no longer accept any writes.

If slapd refuses to add/modify entries, check the slapd logs for the following error message:

MDB_MAP_FULL: Environment mapsize limit reached (-30792)

If this message is present, you must increase the value of the maxsize/olcDbMaxSize setting to allow for more data to be added.

Increasing olcDbMaxSize (cn=config)

  1. Create the following .ldif file:
       # File: UpdateDbMaxSize.ldif
       #
       dn: olcDatabase={N}mdb,cn=config
       changetype: modify
       replace: olcDbMaxSize
       olcDbMaxSize: <new size in bytes>

The {N} represents the database number in the slapd configuration directory.

  1. Use the ldapmodify command to set the new value in the configuration:
       ldapmodify -xH ldap:/// -D dc=example,dc=com -W -f UpdateDbMaxSize.ldif

The setting takes effect immediately and does not require a restart of slapd or a reload of the backend database.

Increasing maxsize (slapd.conf)

  1. Open the slapd.conf configuration file
  2. Update the value of the maxsize setting with the new value in bytes
  3. Test the configuration change with the slaptest utility:
       slaptest -vf /opt/symas/etc/openldap/slapd.conf
  1. If slaptest succeeeds, restart the slapd daemon/service; the change will not take effect until this is done.

See Also