Problem
After a LDAP schema was removed based on this article Remove LDAP schema extensions, there are still some references in your LDAP.
You will get the following message, when you use slapindex
, slapschema
or slaptest
.
$ slapindex
WARNING!
Runnig as root!
There's a fair chance slapd will fail to start.
Check file permissions!
5cade2d2 UNKNOWN attributeDescription "OWNCLOUDENABLED" inserted.
5cade2d2 UNKNOWN attributeDescription "OWNCLOUDQUOTA" inserted.
Solution
You need to reload the LDAP database to purge old attributes, which are no longer defined by schema.
Attention! In large environments this my take a lot of time.
$ mkdir ~/ldap-backup
$ systemctl stop slapd.service
$ slapcat -l ~/ldap-backup/backup.ldif
$ cp ~/ldap-backup/backup.ldif{,.bak}
You have to edit the ~/ldap-backup/backup.ldif
and remove the references to the above attributes (i.e.
OWNCLOUDQUOTA) in the ~/ldap-backup/backup.ldif
$ mv /var/lib/univention-ldap/ldap/*.* ~/ldap-backup/
$ ucr commit /var/lib/univention-ldap/ldap/DB_CONFIG
$ slapadd -l ~/ldap-backup/backup.ldif
$ systemctl start slapd.service
Alternatives
Instead of cleaning up, you can also register the schema file, if it is still on the Server:
- For a well-known schema running the UMC diagnostics check can do this automatically:
univention-run-diagnostic-checks -t 60_old_schema_registration
- For custom and other schema this can be done manually:
#!/bin/bash
. /usr/share/univention-lib/ldap.sh
ucs_registerLDAPExtension --packagename <my-own-schema> --packageversion 1.0 --schema /var/lib/univention-ldap/local-schema/my-own.schema