When working with OpenLDAP's dynamic configuration (cn=config), the error
olcAccess handler exited with 1
typically indicates a syntax validation failure in access control rules. This specific case involves modifying theolcAccess
attribute for database {2}hdb. The error occurs because: 1. The LDIF format may contain invisible characters or incorrect line breaks 2. The access control rule syntax violates OpenLDAP's parsing requirements 3. The modification attempts to replace all existing rules with a single rule without proper incremental changes Here's the properly formatted LDIF that should work:dn: olcDatabase={2}hdb,cn=config changetype: modify delete: olcAccess - add: olcAccess olcAccess: {0}to * by dn.base="gidNumber=0+uidNumber=0,cn=peercred,cn=external,cn=auth" write by * none
For better reliability, consider using an external file:
# mod_access.ldif dn: olcDatabase={2}hdb,cn=config changetype: modify replace: olcAccess olcAccess: {0}to * by dn.base="gidNumber=0+uidNumber=0,cn=peercred,cn=external,cn=auth" write by dn.base="cn=admin,dc=example,dc=com" write by * none # Execute with: ldapmodify -Y EXTERNAL -H ldapi:/// -f mod_access.ldif
1. Enable slapd debug logging:
slapd -d 16383 -h "ldap:/// ldapi:///"
2. Verify configuration syntax:
slaptest -v -f /etc/ldap/slapd.conf
3. Check for hidden characters in your LDIF:
cat -v yourfile.ldif | less
- Missing or extra whitespace after continuation lines
- Incorrect attribute value ordering
- Attempting to modify multiple attributes simultaneously
- Not using proper escaping for special characters1. Always backup your config before modifications:
ldapsearch -Y EXTERNAL -H ldapi:/// -b cn=config > config_backup.ldif
2. Make incremental changes rather than bulk replacements
3. Test modifications in a staging environment first
4. Consider using configuration management tools like Ansible for reproducible changes
When working with OpenLDAP's dynamic configuration (cn=config), modifying access control rules can sometimes trigger the cryptic error:
ldap_modify: Other (e.g., implementation specific) error (80) additional info: <olcAccess> handler exited with 1
This typically occurs when:
- The olcAccess syntax contains structural errors
- There's a mismatch between the DN format and your LDAP schema
- Special characters aren't properly escaped
- The access rule violates existing ACL hierarchy
Consider this common attempt that fails:
dn: olcDatabase={2}hdb,cn=config
changetype: modify
replace: olcAccess
olcAccess: {0}to *
by dn.base="gidNumber=0+uidNumber=0,cn=peercred,cn=external,cn=auth" write
by * none
Solution 1: Proper DN Formatting
dn: olcDatabase={2}hdb,cn=config
changetype: modify
replace: olcAccess
olcAccess: {0}to *
by dn.base="gidNumber=0+uidNumber=0,cn=peercred,cn=external,cn=auth" manage
by * break
Solution 2: Simplified ACL (for testing)
dn: olcDatabase={2}hdb,cn=config
changetype: modify
replace: olcAccess
olcAccess: {0}to *
by dn.exact="gidNumber=0+uidNumber=0,cn=peercred,cn=external,cn=auth" write
by anonymous auth
by * none
Check your slapd logs for more details:
sudo tail -f /var/log/slapd.log
# Or for systemd:
journalctl -u slapd -f
Common log patterns to look for:
acl_parse: line X: unexpected token "X"
acl_parse: invalid DN format
slap_queue_csn: queueing CSN X (X)
- Always test ACL changes with
ldapmodify -n
(dry-run) first - Consider using LDIF files instead of command-line input
- Document all ACL changes in version control
- Implement gradual rollout with monitoring
For complex ACL setups, consider:
# Multiple discrete access rules:
olcAccess: {0}to dn.subtree="ou=people,dc=example,dc=com"
by group.exact="cn=admins,ou=groups,dc=example,dc=com" write
by users read
olcAccess: {1}to attrs=userPassword
by self =xw
by anonymous auth
by * none