User Tools

Site Tools


en:ressources:dossiers:cyrus:repair_skiplist

Repair a broken skiplist file

cyrus imap

If you see the following lines in your mail.warn syslog file :

Oct  1 10:19:54 zerhuel cyrus/imap[28120]: DBERROR: skiplist recovery /var/lib/cyrus/user/j/machin.seen: ADD at 2FC8 exists   
Oct  1 10:19:54 zerhuel cyrus/imap[28120]: DBERROR: opening /var/lib/cyrus/user/j/machin.seen: cyrusdb error
Oct  1 10:19:54 zerhuel cyrus/imap[28120]: Could not open seen state for machin(System I/O error)
Oct  1 10:19:54 zerhuel cyrus/imap[28120]: DBERROR: skiplist recovery /var/lib/cyrus/user/j/machin.seen: ADD at 2FC8 exists
Oct  1 10:19:54 zerhuel cyrus/imap[28120]: DBERROR: opening /var/lib/cyrus/user/j/machin.seen: cyrusdb error
Oct  1 10:19:54 zerhuel cyrus/imap[28120]: Could not open seen state for machin(System I/O error)

It means your skiplist file is corrupted. A solution to recover this is to convert the seen file to text format using skiplist.py and then recreate the db format for cyrus.

skiplist.py.zip

There we go :

First, shut down your cyrus server

# /etc/init.d/cyrus2.2 stop
Stopping Cyrus IMAPd: .

Then, go to the folder that contains the seen skiplist files. On my Debian Lenny, this folder is /var/lib/cyrus/user/ (and it is not the same as the mail storage folder).

# cd /var/lib/cyrus/user/

# ls
a  b  c  d  e  f  g  h  i  j  k  l  m  n  o  p  q  r  s  t  u  v  w  x  y  z

# cd m

# ls -l 
total 60
-rw------- 1 cyrus mail 24824 oct  1 10:19 machin.seen
-rw------- 1 cyrus mail   434 oct  1 09:54 machin.sub

Now, we use the skiplist.py script to convert machin.seen into its text version.

# /scripts/skiplist.py /var/lib/cyrus/user/m/machin.seen > /var/lib/cyrus/user/m/machin.seen.txt

And then use cvt_cyrusdb to reconvert the text file into the skiplist format.

cvt_cyrusdb is used to convert a cyrusdb file
between different database backends.

It requires that you use the full path of the files you want to convert.

# mv /var/lib/cyrus/user/m/machin.seen /var/lib/cyrus/user/m/machin.seen.old

# cvt_cyrusdb /var/lib/cyrus/user/m/machin.seen.txt flat /var/lib/cyrus/user/m/machin.seen skiplist

Converting from /var/lib/cyrus/user/m/machin.seen.txt (flat) to /var/lib/cyrus/user/m/machin.seen (skiplist)

Don't forget to change the owner of the new seen file, otherwise cyrus won't be able to access it.

# chown cyrus:mail machin.seen

Restart your cyrus server, your problem should be fixed now.

en/ressources/dossiers/cyrus/repair_skiplist.txt · Last modified: 2024/04/17 10:19 by 127.0.0.1