Migrating Ubuntu -> CentOS IMAP Troubles

Tobias Brunner tobias at tobru.ch
Thu Sep 29 15:04:17 CEST 2016


>> Any other hints what I can do to debug this sort of issue?
> 
> 1.  I would be curious to see what exists in the annotations.db (or another 
> database) on the new server that is created when it ignores your files.  Just 
> to confirm that it is in fact configured to use twoskip format.   If it is not 
> (you don't have "twoskip file" in the top) ... that might give you some clues.
> 
> 2.  You could forcefully set those configuration options in imap.conf to set 
> the database formats to twoskip.  Just to be positive it is expecting that 
> format, and the files you have are that format.
> 
> 3.  I really don't think it matters much if they are re-created ... except for 
> mailboxes.db   That's the one that has the list of mailboxes in the user's 
> accounts.  I would focus on getting mailboxes.db to work ... and ignore the 
> rest of them.
> 
> --
> 
> When I recently had some database problems, this page was some good insight 
> (although written quite some time ago) :
> https://www.banquise.org/software/how-to-recover-from-cyrus-when-you-have-some-db-errors/
> 
> I just found this in a link :
> https://gist.github.com/tpokorra/5643410
> 
> Did you switch from a 32 to 64 bit server?

Before I answer the questions, I've discovered an odd behaviour which I
don't understand: After a completely fresh Kolab 16 install on CentOS 7
everything looks fine. I can create mailboxes, stop/start Cyrus, all
works as it should do. The contents of /var/lib/imap looks like this:

-rw------- 1 cyrus mail 3.8K Sep 29 14:48 annotations.db
drwxr-x--- 2 cyrus mail    6 Sep 22 17:25 backup
drwxr-x--- 2 cyrus mail   22 Sep 29 14:48 db
drwx------ 2 cyrus mail   46 Sep 29 14:48 db.backup1
-rw------- 1 cyrus mail  336 Sep 29 14:48 deliver.db
drwx------ 3 cyrus mail   14 Sep 29 14:48 domain
drwx------ 5 cyrus mail   35 Sep 29 14:48 lock
drwxr-x--- 2 cyrus mail    6 Sep 22 17:25 log
-rw------- 1 cyrus mail 3.7K Sep 29 14:48 mailboxes.db
drwxr-x--- 2 cyrus mail    6 Sep 22 17:25 md5
drwxr-x--- 2 cyrus mail    6 Sep 22 17:25 meta
drwxr-x--- 2 cyrus mail    6 Sep 22 17:25 msg
drwxr-x--- 2 cyrus mail   18 Sep 29 14:56 proc
drwxr-x--- 2 cyrus mail   37 Sep 29 14:48 ptclient
drwxr-x--- 2 cyrus mail    6 Sep 22 17:25 quota
drwxr-x--- 2 cyrus mail   51 Sep 29 14:48 rpm
drwxr-x--- 2 cyrus mail    6 Sep 22 17:25 sieve
drwxr-x--- 2 cyrus mail 4.0K Sep 29 14:56 socket
-rw------- 1 cyrus mail  336 Sep 29 14:48 statuscache.db
drwxr-x--- 2 cyrus mail    6 Sep 22 17:25 sync
-rw------- 1 cyrus mail  768 Sep 29 14:48 tls_sessions.db
drwxr-x--- 2 cyrus mail    6 Sep 22 17:25 user

Then I do:

1. Stop Cyrus: systemctl stop cyrus-imapd. Log says:

Sep 29 14:57:59 kolabv.vagrant.dev master[16944]: attempting clean
shutdown on signal
Sep 29 14:57:59 kolabv.vagrant.dev pop3[16965]: graceful shutdown
initiated by unexpected process 1 (/usr/lib/systemd/systemd
--switched-root --system --deserialize 21)
Sep 29 14:57:59 kolabv.vagrant.dev pop3[16971]: graceful shutdown
initiated by unexpected process 1 (/usr/lib/systemd/systemd
--switched-root --system --deserialize 21)
Sep 29 14:57:59 kolabv.vagrant.dev lmtpunix[16967]: graceful shutdown
initiated by unexpected process 1 (/usr/lib/systemd/systemd
--switched-root --system --deserialize 21)
Sep 29 14:57:59 kolabv.vagrant.dev systemd[1]: Stopping Cyrus-imapd
IMAP/POP3 email server...
Sep 29 14:57:59 kolabv.vagrant.dev master[16944]: process type:SERVICE
name:imap path:/usr/lib/cyrus-imapd/imapd age:561.385s pid:16959 exited,
status 75
Sep 29 14:57:59 kolabv.vagrant.dev master[16944]: process type:SERVICE
name:imap path:/usr/lib/cyrus-imapd/imapd age:561.385s pid:16961 exited,
status 75
Sep 29 14:57:59 kolabv.vagrant.dev master[16944]: process type:SERVICE
name:pop3 path:/usr/lib/cyrus-imapd/pop3d age:561.385s pid:16963 exited,
status 75
Sep 29 14:57:59 kolabv.vagrant.dev master[16944]: process type:SERVICE
name:pop3 path:/usr/lib/cyrus-imapd/pop3d age:561.385s pid:16964 exited,
status 75
Sep 29 14:57:59 kolabv.vagrant.dev master[16944]: process type:SERVICE
name:pop3s path:/usr/lib/cyrus-imapd/pop3d age:561.385s pid:16966
exited, status 75
Sep 29 14:57:59 kolabv.vagrant.dev master[16944]: process type:SERVICE
name:imap path:/usr/lib/cyrus-imapd/imapd age:561.387s pid:16958 exited,
status 75
Sep 29 14:57:59 kolabv.vagrant.dev master[16944]: process type:SERVICE
name:imap path:/usr/lib/cyrus-imapd/imapd age:561.389s pid:16960 exited,
status 75
Sep 29 14:57:59 kolabv.vagrant.dev master[16944]: process type:SERVICE
name:pop3 path:/usr/lib/cyrus-imapd/pop3d age:561.389s pid:16965 exited,
status 75
Sep 29 14:57:59 kolabv.vagrant.dev master[16944]: process type:SERVICE
name:lmtpunix path:/usr/lib/cyrus-imapd/lmtpd age:561.388s pid:16967
exited, status 75
Sep 29 14:57:59 kolabv.vagrant.dev master[16944]: process type:SERVICE
name:notify path:/usr/lib/cyrus-imapd/notifyd age:561.388s pid:16968
exited, status 75
Sep 29 14:57:59 kolabv.vagrant.dev master[16944]: process type:SERVICE
name:pop3 path:/usr/lib/cyrus-imapd/pop3d age:561.388s pid:16969 exited,
status 75
Sep 29 14:57:59 kolabv.vagrant.dev master[16944]: process type:SERVICE
name:pop3 path:/usr/lib/cyrus-imapd/pop3d age:561.388s pid:16970
signaled to death by signal 15 (Terminated)
Sep 29 14:57:59 kolabv.vagrant.dev master[16944]: process type:SERVICE
name:pop3 path:/usr/lib/cyrus-imapd/pop3d age:561.388s pid:16971 exited,
status 75
Sep 29 14:57:59 kolabv.vagrant.dev master[16944]: process type:SERVICE
name:pop3s path:/usr/lib/cyrus-imapd/pop3d age:561.388s pid:16972
exited, status 75
Sep 29 14:57:59 kolabv.vagrant.dev systemd[1]: Stopped Cyrus-imapd
IMAP/POP3 email server.

2. Remove all content of /var/lib/imap: rm -rf /var/lib/imap/*
3. Start Cyrus, which automatically recreates the folder structure under
/var/lib/imap. The folder content:

-rw------- 1 cyrus mail 3.8K Sep 29 15:00 annotations.db
drwxr-xr-x 2 cyrus mail   22 Sep 29 15:00 db
drwx------ 2 cyrus mail   46 Sep 29 15:00 db.backup1
-rw------- 1 cyrus mail  336 Sep 29 15:00 deliver.db
drwx------ 3 cyrus mail   14 Sep 29 15:00 domain
drwx------ 5 cyrus mail   35 Sep 29 15:00 lock
drwxr-xr-x 2 cyrus mail    6 Sep 29 15:00 log
-rw------- 1 cyrus mail 3.6K Sep 29 15:00 mailboxes.db
drwxr-xr-x 2 cyrus mail    6 Sep 29 15:00 msg
drwxr-xr-x 2 cyrus mail   18 Sep 29 15:00 proc
drwxr-xr-x 2 cyrus mail   37 Sep 29 15:00 ptclient
drwxr-xr-x 2 cyrus mail   26 Sep 29 15:00 rpm
drwxr-xr-x 2 cyrus mail 4.0K Sep 29 15:00 socket
-rw------- 1 cyrus mail  336 Sep 29 15:00 statuscache.db
drwxr-xr-x 2 cyrus mail    6 Sep 29 15:00 sync
-rw------- 1 cyrus mail 1.3K Sep 29 15:00 tls_sessions.db

4. Stop Cyrus which now leads to broken DBs, renamed to *.db.berkeley:

-rw------- 1 cyrus mail 3.8K Sep 29 15:00 annotations.db.berkeley
drwxr-xr-x 2 cyrus mail   22 Sep 29 15:00 db
drwx------ 2 cyrus mail   46 Sep 29 15:00 db.backup1
-rw------- 1 cyrus mail  336 Sep 29 15:00 deliver.db.berkeley
drwx------ 3 cyrus mail   14 Sep 29 15:00 domain
drwx------ 5 cyrus mail   35 Sep 29 15:00 lock
drwxr-xr-x 2 cyrus mail    6 Sep 29 15:00 log
-rw------- 1 cyrus mail 3.6K Sep 29 15:00 mailboxes.db.berkeley
drwxr-xr-x 2 cyrus mail    6 Sep 29 15:00 msg
drwxr-xr-x 2 cyrus mail    6 Sep 29 15:01 proc
drwxr-xr-x 2 cyrus mail   46 Sep 29 15:01 ptclient
drwxr-xr-x 2 cyrus mail   46 Sep 29 15:01 rpm
drwxr-xr-x 2 cyrus mail 4.0K Sep 29 15:01 socket
-rw------- 1 cyrus mail  336 Sep 29 15:00 statuscache.db.berkeley
drwxr-xr-x 2 cyrus mail    6 Sep 29 15:00 sync
-rw------- 1 cyrus mail 1.5K Sep 29 15:00 tls_sessions.db.berkeley

5. Start Cyrus, files are recreated:

-rw------- 1 cyrus mail  336 Sep 29 15:01 annotations.db
-rw------- 1 cyrus mail 3.8K Sep 29 15:00 annotations.db.berkeley
drwxr-xr-x 2 cyrus mail   22 Sep 29 15:00 db
drwx------ 2 cyrus mail   46 Sep 29 15:01 db.backup1
drwx------ 2 cyrus mail   46 Sep 29 15:00 db.backup2
-rw------- 1 cyrus mail  336 Sep 29 15:01 deliver.db
-rw------- 1 cyrus mail  336 Sep 29 15:00 deliver.db.berkeley
drwx------ 3 cyrus mail   14 Sep 29 15:00 domain
drwx------ 5 cyrus mail   35 Sep 29 15:00 lock
drwxr-xr-x 2 cyrus mail    6 Sep 29 15:00 log
-rw------- 1 cyrus mail  336 Sep 29 15:01 mailboxes.db
-rw------- 1 cyrus mail 3.6K Sep 29 15:00 mailboxes.db.berkeley
drwxr-xr-x 2 cyrus mail    6 Sep 29 15:00 msg
drwxr-xr-x 2 cyrus mail    6 Sep 29 15:01 proc
drwxr-xr-x 2 cyrus mail   46 Sep 29 15:01 ptclient
drwxr-xr-x 2 cyrus mail   46 Sep 29 15:01 rpm
drwxr-xr-x 2 cyrus mail 4.0K Sep 29 15:01 socket
-rw------- 1 cyrus mail  336 Sep 29 15:01 statuscache.db
-rw------- 1 cyrus mail  336 Sep 29 15:00 statuscache.db.berkeley
drwxr-xr-x 2 cyrus mail    6 Sep 29 15:00 sync
-rw------- 1 cyrus mail 1.5K Sep 29 15:00 tls_sessions.db.berkeley

I even tried mkimap before step 3 which basically creates the same
folder structure as Cyrus does on startup.

It seems to me that Cyrus is doing some bogus stuff. Has anyone an
explanation for this odd behaviour? What am I missing here? How is the
initial folder structure created which seems to be fine?

Cheers,
Tobias


-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 825 bytes
Desc: OpenPGP digital signature
URL: <http://lists.kolab.org/pipermail/users/attachments/20160929/e1a39977/attachment.sig>


More information about the users mailing list