podman ps | grep ldap
podman logs ldap 2>&1 | tail -10
podman logs ldap 2>&1 | grep -E "suffix|rootdn|rootpw|slapd starting|Permission denied"
Expected output for a working setup:
slapd.conf: line 63 (suffix "dc=pathoris,dc=de")
slapd.conf: line 64 (rootdn "cn=admin,dc=pathoris,dc=de")
slapd.conf: line 68 (rootpw ***)
slapd starting
Red flags:
- dc=my-domain,dc=com → custom slapd.conf not mounted
- Permission denied → volume or port permission issue
- slapd stopped → fatal error, check full logs
podman exec -it ldap ldapsearch -x -H ldap://localhost:389 -s base -b "" namingContexts
podman exec -it ldap ldapsearch -x -H ldap://localhost:389 \
-D "cn=admin,dc=pathoris,dc=de" -w admin \
-b "dc=pathoris,dc=de" "(objectClass=*)"
podman exec -it ldap ldapsearch -x -H ldap://localhost:389 \
-D "cn=admin,dc=pathoris,dc=de" -w wrongpassword \
-b "dc=pathoris,dc=de"
podman exec -it ldap ldapsearch -x -H ldap://localhost:389 -s base -b "" "+"
podman exec -it ldap cat /etc/openldap/slapd.conf | grep -E "suffix|rootdn|rootpw|directory"
podman exec -it ldap ls -la /var/lib/openldap/openldap-data/
podman exec -it phpldapadmin sh -c "nc -zv 172.4.0.11 389 2>&1"
podman exec -it forgejo sh -c "nc -zv 172.4.0.11 389 2>&1"
When the database is in a bad state (wrong password, wrong domain, corrupt data):
podman-compose stop ldap
rm -rf /var/lib/cicd/ldap/data/*
podman-compose up -d ldap
Then re-bootstrap the base DN:
podman cp bootstrap.ldif ldap:/tmp/bootstrap.ldif
podman exec -it ldap ldapadd -x -H ldap://localhost:389 \
-D "cn=admin,dc=pathoris,dc=de" -w admin \
-f /tmp/bootstrap.ldif
By default, slapd logs minimally. To see bind attempts and search operations, add to slapd.conf:
loglevel stats
Or for maximum verbosity:
loglevel any
Then restart the container and check logs:
podman-compose restart ldap
podman logs -f ldap
| Error | Cause | Fix |
|---|---|---|
namingContexts: dc=my-domain,dc=com |
Custom slapd.conf not mounted | Check volume mount path |
Invalid credentials |
Wrong password or stale data | Wipe data dir, restart |
No such object |
Base DN entry not created | Run bootstrap.ldif |
Permission denied on bind |
Non-root user, port 389 | Remove user: directive |
invalid path: Permission denied |
Data dir not writable | Fix host dir permissions |
Invalid DN syntax |
Malformed bind DN | Check DN format in config |