Symptoms

All tasks Syncing Internal IP Resolver Database with external data source fail with message like below:

Synchronization failed. LDAP IP '10.10.10.10'. Internal IP Resolver's service returned error: No such object. host d1033926-1492.provider.tld, operation insert.

That effectively blocks any operations with IP addresses like creating new webspaces.

If verbose logging is configured in OpenLDAP, in slapd logs the following error message is displayed at the end of any LDAP database search or modify operation:

slapd[22304]: => bdb_search
slapd[22304]: bdb_dn2entry("dc=pem,dc=swsoft,dc=com")
slapd[22304]: => bdb_dn2id("dc=pem,dc=swsoft,dc=com")
slapd[22304]: <= bdb_dn2id: get failed: DB_NOTFOUND: No matching key/data pair found (-30989)

And even simple object listing does not work:

# ldapsearch -x -LLL -H ldap://10.12.27.17  -b 'dc=pem,dc=swsoft,dc=com' "objectclass=*" -s sub
No such object (32)

Meanwhile slapcat is able to display all registered entries.

Cause

Broken or inconsistent LDAP database due to provider staff manual actions.

Resolution

Manually backup and restore LDAP database, thus it will be rebuilt.

  1. Stop LDAP service:

    # service ldap stop
    
  2. Backup DB to ldiff:

    # slapcat -f /etc/openldap/slapd.conf -b "dc=pem,dc=swsoft,dc=com" -l pem_backup.ldif
    
  3. Make a backup of DB files and cleanup DB directory:

    # mkdir /var/lib/ldap.bak
    # mv /var/lib/ldap/* /var/lib/ldap.bak/
    
  4. Restore DB from backup ldiff:

    # slapadd -l /root/pem_backup.ldif
    
  5. Restore original file ownership:

    # chown ldap:ldap /var/lib/ldap/*
    
  6. Copy DB settings back if they exist:

    # cp -a /var/lib/ldap.bak/DB_CONFIG /var/lib/ldap/DB_CONFIG
    
  7. Start LDAP server:

    # service ldap start
    

Internal content

Link on internal Article