Ldap – slapd : attribute type undefined

ldapopenldapslapd

I'm trying to put a config of slapd on the new server.
I did it the same way, but it was probably two years ago and in slightly different environnement (I'm on the Debian actually and it was on CentOS before).

I have a config file in ldif format and I try to do :

slapadd -n 0 -F /etc/ldap/slapd.d -l /root/server_slapd_config.ldif

And I get

5c75466b <= str2entry: str2ad(olcDbCacheSize): attribute type
undefined

slapadd: could not parse entry (line=2087)

The strange thing that I could not figure out why I get this error, as olcDbCacheSize is defined in my server_slapd_config.ldif

Here the lines in my server_slapd_config.ldif :

1)

olcObjectClasses: ( OLcfgDbOc:1.1 NAME 'olcBdbConfig' DESC 'BDB backend conf
 iguration' SUP olcDatabaseConfig STRUCTURAL MUST olcDbDirectory MAY ( olcDb
 CacheSize $ olcDbCheckpoint $ olcDbConfig $ olcDbCryptFile $ olcDbCryptKey 
 $ olcDbNoSync $ olcDbDirtyRead $ olcDbIDLcacheSize $ olcDbIndex $ olcDbLine
 arIndex $ olcDbLockDetect $ olcDbMode $ olcDbSearchStack $ olcDbShmKey $ ol
 cDbCacheFree $ olcDbDNcacheSize $ olcDbPageSize ) )

2)

olcAttributeTypes: ( OLcfgDbAt:1.1 NAME 'olcDbCacheSize' DESC 'Entry cache s
 ize in entries' SYNTAX OMsInteger SINGLE-VALUE )

3)

dn: olcDatabase={1}bdb,cn=config
objectClass: olcDatabaseConfig
objectClass: olcBdbConfig
olcDatabase: {1}bdb
[skip]
olcDbCacheSize: 1000

So, DbCacheSize declared in olcBdbConfig attributes.

There is olcAttributeTypes for DbCacheSize

And dn: olcDatabase={1}bdb,cn=config is "objectClass: olcBdbConfig"

Why I get "attribute type undefined"?

Some additional info.

System : Debian 9 (Stretch)

# dpkg -l | grep -i ldap
ii  ldap-utils                    2.4.44+dfsg-5+deb9u2           amd64        OpenLDAP utilities
ii  ldapscripts                   2.0.7-2                        all          Add and remove users and groups (stored in a LDAP directory)
ii  libldap-2.4-2:amd64           2.4.44+dfsg-5+deb9u2           amd64        OpenLDAP libraries
ii  libldap-common                2.4.44+dfsg-5+deb9u2           all          OpenLDAP common files for libraries
ii  slapd                         2.4.44+dfsg-5+deb9u2           amd64        OpenLDAP server (slapd)

Thanks for your help.

Update:

A small update.
Just to check. If I remove olcDbCacheSize string, I get the error for the next line : olcDbCheckpoint

5c7553fc <= str2entry: str2ad(olcDbCheckpoint): attribute type
undefined

Update 1:

Here the lines started with olcDb*.
All the lines are in dn: olcDatabase={1}bdb,cn=config section.
I skipped some lines in the middle (they are not started with olcDb).

dn: olcDatabase={1}bdb,cn=config
objectClass: olcDatabaseConfig
objectClass: olcBdbConfig
olcDatabase: {1}bdb
[skip]
olcDbDirectory: /var/lib/slapd 
olcDbCacheSize: 1000
olcDbCheckpoint: 512 15
olcDbConfig: {0}# This configuration file sets BerkeleyDB options when using
olcDbConfig: {1}# backend, for the database held in the directory where this
olcDbConfig: {2}#
olcDbConfig: {3}# Set directory to use for transaction logs:
olcDbConfig: {4}#set_lg_dir /var/lib/ldap/logs
olcDbConfig: {5}# Set in-memory transaction log cache (2MB)
olcDbConfig: {6}set_lg_bsize 2097152
olcDbConfig: {7}# Set max transaction log file size, must be >=4* lg_bsize 
olcDbConfig: {8}#set_lg_max              10485760
olcDbConfig: {9}set_lg_max              20971520
olcDbConfig: {10}# Set in-memory database cache
olcDbConfig: {11}#set_cachesize   0       1048576        0
olcDbConfig: {12}
olcDbConfig: {13}
olcDbConfig: {14}# For batch imports, disabling transaction logging totally 
olcDbConfig: {15}# improve performance:
olcDbConfig: {16}# set_flags DB_TXN_NOT_DURABLE
olcDbConfig: {17}
olcDbConfig: {18}
olcDbNoSync: FALSE
olcDbDirtyRead: FALSE
olcDbIDLcacheSize: 0
olcDbIndex: objectClass eq
olcDbIndex: entryUUID eq
olcDbIndex: entryCSN eq
olcDbIndex: cn eq,subinitial
olcDbIndex: uid eq,subinitial
olcDbIndex: uidNumber eq
olcDbIndex: gidNumber eq
olcDbIndex: sn eq,subinitial
olcDbIndex: givenName eq,subinitial
olcDbIndex: member eq
olcDbIndex: mail eq,subinitial
olcDbIndex: FinLogin eq,approx,sub
olcDbIndex: uniqueMember eq
olcDbIndex: memberUid eq
olcDbLinearIndex: FALSE
olcDbMode: 0600
olcDbSearchStack: 16
olcDbShmKey: 0
olcDbCacheFree: 1
olcDbDNcacheSize: 0

Best Answer

Some schema descriptions are hard-coded in backend modules or overlays.

That's e.g. the case for attribute type olcDbCacheSize being defined in servers/slapd/back-bdb/config.c and your local schema definition has no effect.

I suspect that the back-bdb backend is not loaded and therefore those schema definitions are not available in your slapd instance.

Related Topic