Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Bug#1007965: cyrus-imapd: Upgrade to 3.6.0~beta2-1+b1 didn't succeed. No migration from old mailbox to new uuid

296 views
Skip to first unread message

F Hamelin

unread,
Mar 19, 2022, 11:30:04 AM3/19/22
to
Package: cyrus-imapd
Version: 3.6.0~beta2-1+b1
Severity: normal

Dear Maintainer,

I have updated to cyrus-imapd 3.6.0-beta2-1+b1 but the installation
didn't succeed.
process type:START name:recover path:/usr/sbin/cyrus age:0.000s pid:678146 signaled to death by signal 11 (Segmentation fault)

I restarted cyrus via systemctl ans saw that I couldn't access to mail,
despite the fact that all the mails are in the usual /var/spool/cyrus.
I also saw that a new user was created under uuid folder and this user
is receiving my new mails.
I tried to downgrade to previous version but cyrus couldn't find my
mailbox.
I reinstalled the beta2 and checked on cyrus website. I tried to perfrom the
relocate_by_id command but I could not find it. I copied all mails from
mu user under the uuid and perfomed several reconstruct.

I managed to get my mails back under the user with uuid but all the
sublfolders failed to reconstruct

cyrus/reconstruct[54080]: IOERROR: lock failed: mailbox=<user.mailuser.Folder> error=<Invalid mailbox name> syserror=<No such file or directory> func=<mailbox_open_advanced>

and, yes, mailsuer.Folder exists under /var/spool/cyrus/mail/uuid/

I have the feeling all my problems are due to the fact that the
relocate_by_id command is not provide by any cyrus packages.


-- System Information:
Debian Release: bookworm/sid
APT prefers testing
APT policy: (400, 'testing'), (300, 'unstable'), (200, 'stable')
Architecture: amd64 (x86_64)

Kernel: Linux 5.16.0-4-cloud-amd64 (SMP w/4 CPU threads; PREEMPT)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8), LANGUAGE not set
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled

Versions of packages cyrus-imapd depends on:
ii cyrus-common 3.6.0~beta2-1+b1
ii libc6 2.33-7
ii libcom-err2 1.46.5-2
ii libsasl2-2 2.1.28+dfsg-2+b1
ii libssl1.1 1.1.1n-1
ii libwrap0 7.6.q-31
ii zlib1g 1:1.2.11.dfsg-2

Versions of packages cyrus-imapd recommends:
ii rsync 3.2.3-8

cyrus-imapd suggests no packages.

-- no debconf information

Andy Dorman

unread,
Mar 23, 2022, 2:50:03 PM3/23/22
to
FWIW, we had a similar problem with the upgrade.

The issue is being discussed on a cyrus list at

> https://cyrus.topicbox.com/groups/info/T3e85440ddbb44ec6-Maf769decd0dd45d4572145b8

TLDR; it appears that this might have been caused by 3 new cyrus
utilities not being included in the debian package:

relocate_by_id
cyr_ls
cyr_cd.sh

Also, it looks like we will need relocate_by_id to be able to recover
several of our mailboxes that we have been unable to manually move to
the new storage introduced by .

Sincere regards.

--
Andy Dorman
Ironic Design, Inc.
AnteSpam.com

Yadd

unread,
Mar 23, 2022, 3:40:03 PM3/23/22
to
Hi,

As discuss before, these tools are not in beta2 archive
--
Envoyé de mon appareil Android avec Courriel K-9 Mail. Veuillez excuser ma brièveté.

Francis Russell

unread,
Mar 30, 2022, 12:10:03 PM3/30/22
to
Just wanted to add that I had a similar issue attempting to migrate the
Cyrus 3.6 in Debian. After the upgrade it was possible to log-in and
receive e-mails but all existing e-mails and sub-folders were no longer
visible.

In case it's helpful to anyone, I ended up downgrading back to Cyrus 3.4
from the bullseye-backports release. I then used the reconstruct command
to rebuild my mailboxes which managed to get everything back. However, I
guess sub-mailboxes were given some sort of new unique identifiers since
my IMAP folder subscriptions were lost, which I initially mistook for a
failure to reconstruct the sub-folders.

In addition, I got some new mailboxes which were erroneously constructed
and were difficult to delete both due permissions issues and the fact
that their names contained unprintable characters.

Petr Vandrovec

unread,
Apr 1, 2022, 3:20:03 AM4/1/22
to
Hi,
I'm on the same boat. But it seems that upgrade failure is not
caused by missing utilities, but rather by mailboxes created more than
7 years ago (probably in cyrus 2.x).

Code to upgrade mailboxes
(https://github.com/cyrusimap/cyrus-imapd/blob/add814e90cb2cb5804e5e9c87faca7af253ded4e/imap/mboxlist.c#L5411)
is calling hash_lookup with mbentry->uniqueid - but mbentry->uniqueid
may be NULL, causing NULL pointer dereference and crash.

When I dumped my old mailbox db, I can see that "new" entries have new
% format, with 'I' field, but old ones use legacy format without 'I'
key:

...
user.petr.Inbox2013 0 default petr lrswipcda
user.petr.Inbox2014 0 default petr lrswipcda
user.petr.Inbox2015 %(A %(petr lrswipcda) I
ol64w50y514kvpoke32tg6a3 P default V 1569218712 F 1 M 1569218711)
user.petr.Inbox2016 %(A %(petr lrswipcda) I
abommco8w0dxyzyjju8nu2rw P default V 1569218720 F 1 M 1569218719)
...

So to me this looks like upstream problem. I have applied patch below
on my host, and it seems to have fixed update crash.

--- cyrus-imapd-3.6.0~beta2/imap/mboxlist.c 2022-03-10
15:09:08.000000000 -0800
+++ cyrus-imapd-3.6.0~beta2.new/imap/mboxlist.c 2022-03-31
23:52:52.427711987 -0700
@@ -5408,6 +5408,9 @@
mbentry->mbtype |= MBTYPE_LEGACY_DIRS;

int idx = 0;
+ if (mbentry->uniqueid == NULL) {
+ mbentry->uniqueid = xstrdup(makeuuid());
+ }
ptrarray_t *pa = hash_lookup(mbentry->uniqueid, urock->ids);
if (!pa) {
pa = ptrarray_new();


Also I think it would be nice if update code would create new
mailbox.db.NEW, and then rename .db to db.OLD and db.NEW to db on
success, rather than moving mailbox.db to mailbox.db.OLD, and then
perform upgrade - as then you end up with empty mailbox.db, and so 2nd
upgrade attempt succeeds, deleting mailbox.db.OLD and causing data
loss.

And finally I would suggest adding 'mailbox_legacy_dirs: true' to
imapd.conf on upgrade - if upgrade would not have failed, I would have
been for rude awakening when mailboxes for new users would have moved
into uuid directory without any warning.

Thanks,
Petr

P.S.: Sorry about using gmail, my own email server is now in a bit of
disarray :-(

Gabriel Rolland [Res Novae]

unread,
Oct 10, 2022, 3:50:04 AM10/10/22
to
We had the same problem.
We downgraded Cyrus and proceed with the reconstruct, the messages
reappeared but with many duplicates (especially those that had been
moved to subfolders).

In our opinion, the bug is really serious

Yadd

unread,
Oct 10, 2022, 4:50:04 AM10/10/22
to
Control: tags -1 + help
Control: severity -1 serious
Hi,

I don't know how to help here. relocate_by_id, cyr_ls and cyr_cd.sh are
installed by cyrus-common. Is there a command to launch to upgrade db ?

Yadd

unread,
Oct 10, 2022, 7:50:03 AM10/10/22
to
Question: did you update from 3.2.6-2+deb11u2 or an older release ? I
added an upstream patch in this version to be able to update to 3.6
0 new messages