Recreate listener cache

Problem:

The univention directory listener fails with I/O errors in the /var/log/univention/listener.log - no further replication is done (see also SDB article 1303). The reason is corrupt listener cache - this can happen if the filesystem ran out of free space for example.

Example snip from listener.log:

17.01.15 13:45:18.851 LISTENER ( ERROR ) : database error: unable to create/retrieve page 3462
17.01.15 13:45:18.851 LISTENER ( ERROR ) : database error: PANIC: Input/output error
17.01.15 13:45:18.851 LISTENER ( ERROR ) : database error: c_get: Input/output error

It may be possible, that you only see DEBUG_INIT in the listener.log for all log levels. Please check if a file named “bad_cache” exists in the following folder:

/var/lib/univention-directory-listener/

If that is the case, please delete the bad_cache file and proceed with the solution by recreating the listener cache as mentioned below.

Solution:

You can recreate/invalidate the listener cache on the target server.

1. Stop the listener on the target server:

/etc/init.d/univention-directory-listener stop
sleep 5
pkill -9 -f /usr/sbin/univention-directory-listener

2. Restart the listener with additional parameters:

eval "$(ucr shell)"
/usr/sbin/univention-directory-listener -F \
  -d "$listener_debug_level" -b "$ldap_base" \
  -m /usr/lib/univention-directory-listener/system \
  -c /var/lib/univention-directory-listener \
  -x -ZZ -D "$ldap_hostdn" -y /etc/machine.secret \
  -g > /var/log/univention/listener.log 2>&1 &

The initial resync could take a while - the following commands help you by monitoring the replication status (see also SDB article 1303):

DC Master:

tail -1 /var/lib/univention-ldap/notify/transaction

Target System:

cat /var/lib/univention-directory-listener/notifier_id

3. If the resync is finished stop the listener on the target server and restart it normally via init:

pkill -f /usr/sbin/univention-directory-listener
sleep 5
/etc/init.d/univention-directory-listener start
3 Likes
Mastodon