[SRU] cyradm fails on jammy

Bug #1971547 reported by Steve Roberts
66
This bug affects 10 people
Affects Status Importance Assigned to Milestone
cyrus-imapd (Ubuntu)
Fix Released
Undecided
Unassigned
Jammy
Fix Released
Undecided
Unassigned

Bug Description

[ Impact ]

cyradm is completely unusable as it will fail with an error whenever any user tries to run "cyradm".

$ cyradm
Can't load '/usr/lib/x86_64-linux-gnu/perl5/5.34/auto/Cyrus/IMAP/IMAP.so' for module Cyrus::IMAP: /usr/lib/x86_64-linux-gnu/perl5/5.34/auto/Cyrus/IMAP/IMAP.so: undefined symbol: pcreposix_regexec at /usr/lib/x86_64-linux-gnu/perl-base/DynaLoader.pm line 187.
 at /usr/lib/x86_64-linux-gnu/perl5/5.34/Cyrus/IMAP/Admin.pm line 43.
Compilation failed in require at /usr/lib/x86_64-linux-gnu/perl5/5.34/Cyrus/IMAP/Admin.pm line 43.
BEGIN failed--compilation aborted at /usr/lib/x86_64-linux-gnu/perl5/5.34/Cyrus/IMAP/Admin.pm line 43.
Compilation failed in require at /usr/lib/x86_64-linux-gnu/perl5/5.34/Cyrus/IMAP/Shell.pm line 59.
BEGIN failed--compilation aborted at /usr/lib/x86_64-linux-gnu/perl5/5.34/Cyrus/IMAP/Shell.pm line 59.
Compilation failed in require at /usr/bin/cyradm line 66.
BEGIN failed--compilation aborted at /usr/bin/cyradm line 66.

[ Test Plan ]

* Execute "cyradm"
* if its not fixed then it will fail as the error above
* With fixed package we will reach the "cyradm" prompt as shown below:

$ cyradm
cyradm>

[ Where problems could occur ]

There was no change in the code or build dependencies. The only change is in the Makefile to explicitely link IMAP.so with libpcre3 so that Perl Dynaloader does not try to find the symbols from the latest libpcre2.
Its already completely unusable, the chances of regression more than "completely unusable" are very less.

[ Other Info ]

Upstream has added changes to support latest libpcre2 but the diff of the patches to add the support is already big and on top of that it will need 2 more fixes. So the total diff and also the fact that it will then change the dependencies and will start using a new library was (imho) inappropriate for SRU.

[ Original Bug Description ]

Running cyradm fails:

root@imap ~# cyradm 127.0.0.1
Can't load '/usr/lib/x86_64-linux-gnu/perl5/5.34/auto/Cyrus/IMAP/IMAP.so' for module Cyrus::IMAP: /usr/lib/x86_64-linux-gnu/perl5/5.34/auto/Cyrus/IMAP/IMAP.so: undefined symbol: pcreposix_regexec at /usr/lib/x86_64-linux-gnu/perl-base/DynaLoader.pm line 187.
 at /usr/lib/x86_64-linux-gnu/perl5/5.34/Cyrus/IMAP/Admin.pm line 43.
Compilation failed in require at /usr/lib/x86_64-linux-gnu/perl5/5.34/Cyrus/IMAP/Admin.pm line 43.
BEGIN failed--compilation aborted at /usr/lib/x86_64-linux-gnu/perl5/5.34/Cyrus/IMAP/Admin.pm line 43.
Compilation failed in require at /usr/lib/x86_64-linux-gnu/perl5/5.34/Cyrus/IMAP/Shell.pm line 59.
BEGIN failed--compilation aborted at /usr/lib/x86_64-linux-gnu/perl5/5.34/Cyrus/IMAP/Shell.pm line 59.
Compilation failed in require at /usr/bin/cyradm line 66.
BEGIN failed--compilation aborted at /usr/bin/cyradm line 66.

I think this is due to an imcompatibility between versions of libpcre, out of my depth commenting further but there's a discussion here: https://www.spinics.net/lists/info-cyrus/msg20361.html reporting the problem in Debian Testing. I have a Debian Bullseye Cyrus IMAP server which works fine.

I have:

root@imap ~# dpkg -l | grep pcre
ii libpcre2-32-0:amd64 10.39-3build1 amd64 New Perl Compatible Regular Expression Library - 32 bit runtime files
ii libpcre2-8-0:amd64 10.39-3build1 amd64 New Perl Compatible Regular Expression Library- 8 bit runtime files
ii libpcre3:amd64 2:8.39-13build5 amd64 Old Perl 5 Compatible Regular Expression Library - runtime files

This is a fresh install of 22.04 with little else installed but:

root@imap ~# dpkg -l | grep cyrus
ii cyrus-admin 3.4.3-3build2 amd64 Cyrus mail system - administration tools
ii cyrus-caldav 3.4.3-3build2 amd64 Cyrus mail system - CalDAV and CardDAV support
ii cyrus-clients 3.4.3-3build2 amd64 Cyrus mail system - test clients
ii cyrus-common 3.4.3-3build2 amd64 Cyrus mail system - common files
ii cyrus-imapd 3.4.3-3build2 amd64 Cyrus mail system - IMAP support
ii libcyrus-imap-perl:amd64 3.4.3-3build2 amd64 Interface to Cyrus imap client imclient library

Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in cyrus-imapd (Ubuntu):
status: New → Confirmed
Revision history for this message
Michael Tester (resselkessel) wrote :

I have the same problem on a new installation. How to fix it? Is it a problem with libpcre or with cyradm?
How can I speed up the bug fixing?

Revision history for this message
Steve Roberts (steveroberts2) wrote :

I wonder if this would only be fixed upstream in Debian Testing or Unstable. cyrus-imapd is in Universe, community maintained, and the maintainer is marked as "Debian Cyrus Team". Maybe someone can go through the existing posts and the two bug reports on the Debian and Cyrus github to see if another bug report is needed.

https://www.spinics.net/lists/info-cyrus/msg20361.html
https://github.com/cyrusimap/cyrus-imapd/issues/3861
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1000034

It looks like it is reported, but the bug reports refer to the whole cyrus-imapd package, and the discussion suggests they might not have it reported that cyradm is affected. Not sure if that matters if the whole package needs to be migrated to libpcre2 from libpcre3 which is obsolete.

This needs someone with a knowledge of libpcre and perl to figure out what's happened then poke Debian. I've resolved the issue by using Debian Stable instead of ubuntu 22.04. Disappointing for an LTS.

Revision history for this message
Dan Cooper (pcfan1234) wrote :

Is there nay new info about that?
cyradm is completely broken and that for some weeks...

Revision history for this message
Lichtmacher (fh-j) wrote :

Is it possible to use cyrus without cyradm?

Revision history for this message
Steve Roberts (steveroberts2) wrote :

If you have pre-existing mailspools and user databases then maybe you can run cyrus-imapd without needing to use cyradm. But for any proper use you need cyradm to create users and manage mailboxes. Even when I've migrated to new installs in the past I've used cyradm to create the top level mailboxes before restoring mailspools and doing a cyrus reconstruct.

So in practical terms I don't think cyrus us useable/viable without cyradm.

Revision history for this message
Lichtmacher (fh-j) wrote :

I asked, because I didn't know if there are - may be stony - other ways to administer cyrus.
Does "gyrus" work?

Revision history for this message
Dan Cooper (pcfan1234) wrote :

Give it a try. :-)

Revision history for this message
Steve Roberts (steveroberts2) wrote : Re: [Bug 1971547] Re: cyradm fails on jammy
Download full text (3.5 KiB)

My IMAP server runs headless, I wouldn't want Gnome or a desktop running on
it, nor the need to administer it through VNC. There could be other admin
tools. They might use Cyrus project libraries which have the same problems
as the perl modules used by cyradm. On a production server you want to be
using the official tools.

It's a useful lesson. If you use Ubuntu LTS but run packages from the
community maintained universe repo it's may just be pulled out of Debian
testing and not maintained at all. You end up with a production server on
Debian testing! Debian stable is called stable for a reason. Assuming an
Ubuntu LTS will do the job may be folly.

If you run Ubuntu LTS and only need main repo packages your experience will
be much more guaranteed.

On Thu, 1 Sept 2022 at 15:05, Dan Cooper <email address hidden> wrote:

> Give it a try. :-)
>
> --
> You received this bug notification because you are subscribed to the bug
> report.
> https://bugs.launchpad.net/bugs/1971547
>
> Title:
> cyradm fails on jammy
>
> Status in cyrus-imapd package in Ubuntu:
> Confirmed
>
> Bug description:
> Running cyradm fails:
>
> root@imap ~# cyradm 127.0.0.1
> Can't load
> '/usr/lib/x86_64-linux-gnu/perl5/5.34/auto/Cyrus/IMAP/IMAP.so' for module
> Cyrus::IMAP: /usr/lib/x86_64-linux-gnu/perl5/5.34/auto/Cyrus/IMAP/IMAP.so:
> undefined symbol: pcreposix_regexec at
> /usr/lib/x86_64-linux-gnu/perl-base/DynaLoader.pm line 187.
> at /usr/lib/x86_64-linux-gnu/perl5/5.34/Cyrus/IMAP/Admin.pm line 43.
> Compilation failed in require at
> /usr/lib/x86_64-linux-gnu/perl5/5.34/Cyrus/IMAP/Admin.pm line 43.
> BEGIN failed--compilation aborted at
> /usr/lib/x86_64-linux-gnu/perl5/5.34/Cyrus/IMAP/Admin.pm line 43.
> Compilation failed in require at
> /usr/lib/x86_64-linux-gnu/perl5/5.34/Cyrus/IMAP/Shell.pm line 59.
> BEGIN failed--compilation aborted at
> /usr/lib/x86_64-linux-gnu/perl5/5.34/Cyrus/IMAP/Shell.pm line 59.
> Compilation failed in require at /usr/bin/cyradm line 66.
> BEGIN failed--compilation aborted at /usr/bin/cyradm line 66.
>
> I think this is due to an imcompatibility between versions of libpcre,
> out of my depth commenting further but there's a discussion here:
> https://www.spinics.net/lists/info-cyrus/msg20361.html reporting the
> problem in Debian Testing. I have a Debian Bullseye Cyrus IMAP server
> which works fine.
>
> I have:
>
> root@imap ~# dpkg -l | grep pcre
> ii libpcre2-32-0:amd64 10.39-3build1 amd64 New Perl Compatible Regular
> Expression Library - 32 bit runtime files
> ii libpcre2-8-0:amd64 10.39-3build1 amd64 New Perl Compatible Regular
> Expression Library- 8 bit runtime files
> ii libpcre3:amd64 2:8.39-13build5 amd64 Old Perl 5 Compatible Regular
> Expression Library - runtime files
>
> This is a fresh install of 22.04 with little else installed but:
>
> root@imap ~# dpkg -l | grep cyrus
> ii cyrus-admin 3.4.3-3build2 amd64 Cyrus mail system - administration
> tools
> ii cyrus-caldav 3.4.3-3build2 amd64 Cyrus mail system - CalDAV and
> CardDAV support
> ii cyrus-clients 3.4.3-3build2 amd64 Cyrus mail system - test clients
> ii cyrus-common 3.4.3-3build2 amd64 Cyrus ma...

Read more...

Revision history for this message
Thomas Larsen (b9f576cb090d) wrote : Re: cyradm fails on jammy

Hi

I managed to make it run with the following script:

cyrus@mail:~$ cat mycyradm.sh
#!/bin/bash

export LD_PRELOAD=/usr/lib/x86_64-linux-gnu/libpcreposix.so.3
/usr/bin/cyradm $@

hope it's of any use to you as well until a proper fix arrives.

Revision history for this message
Steve Roberts (steveroberts2) wrote : Re: [Bug 1971547] Re: cyradm fails on jammy

Thanks Thomas, that's very helpful. Neat workaround.

On Thu, 22 Sept 2022 at 22:20, Thomas Larsen <email address hidden>
wrote:

> Hi
>
> I managed to make it run with the following script:
>
> cyrus@mail:~$ cat mycyradm.sh
> #!/bin/bash
>
> export LD_PRELOAD=/usr/lib/x86_64-linux-gnu/libpcreposix.so.3
> /usr/bin/cyradm $@
>
> hope it's of any use to you as well until a proper fix arrives.
>
> --
> You received this bug notification because you are subscribed to the bug
> report.
> https://bugs.launchpad.net/bugs/1971547
>
> Title:
> cyradm fails on jammy
>
> Status in cyrus-imapd package in Ubuntu:
> Confirmed
>
> Bug description:
> Running cyradm fails:
>
> root@imap ~# cyradm 127.0.0.1
> Can't load
> '/usr/lib/x86_64-linux-gnu/perl5/5.34/auto/Cyrus/IMAP/IMAP.so' for module
> Cyrus::IMAP: /usr/lib/x86_64-linux-gnu/perl5/5.34/auto/Cyrus/IMAP/IMAP.so:
> undefined symbol: pcreposix_regexec at
> /usr/lib/x86_64-linux-gnu/perl-base/DynaLoader.pm line 187.
> at /usr/lib/x86_64-linux-gnu/perl5/5.34/Cyrus/IMAP/Admin.pm line 43.
> Compilation failed in require at
> /usr/lib/x86_64-linux-gnu/perl5/5.34/Cyrus/IMAP/Admin.pm line 43.
> BEGIN failed--compilation aborted at
> /usr/lib/x86_64-linux-gnu/perl5/5.34/Cyrus/IMAP/Admin.pm line 43.
> Compilation failed in require at
> /usr/lib/x86_64-linux-gnu/perl5/5.34/Cyrus/IMAP/Shell.pm line 59.
> BEGIN failed--compilation aborted at
> /usr/lib/x86_64-linux-gnu/perl5/5.34/Cyrus/IMAP/Shell.pm line 59.
> Compilation failed in require at /usr/bin/cyradm line 66.
> BEGIN failed--compilation aborted at /usr/bin/cyradm line 66.
>
> I think this is due to an imcompatibility between versions of libpcre,
> out of my depth commenting further but there's a discussion here:
> https://www.spinics.net/lists/info-cyrus/msg20361.html reporting the
> problem in Debian Testing. I have a Debian Bullseye Cyrus IMAP server
> which works fine.
>
> I have:
>
> root@imap ~# dpkg -l | grep pcre
> ii libpcre2-32-0:amd64 10.39-3build1 amd64 New Perl Compatible Regular
> Expression Library - 32 bit runtime files
> ii libpcre2-8-0:amd64 10.39-3build1 amd64 New Perl Compatible Regular
> Expression Library- 8 bit runtime files
> ii libpcre3:amd64 2:8.39-13build5 amd64 Old Perl 5 Compatible Regular
> Expression Library - runtime files
>
> This is a fresh install of 22.04 with little else installed but:
>
> root@imap ~# dpkg -l | grep cyrus
> ii cyrus-admin 3.4.3-3build2 amd64 Cyrus mail system - administration
> tools
> ii cyrus-caldav 3.4.3-3build2 amd64 Cyrus mail system - CalDAV and
> CardDAV support
> ii cyrus-clients 3.4.3-3build2 amd64 Cyrus mail system - test clients
> ii cyrus-common 3.4.3-3build2 amd64 Cyrus mail system - common files
> ii cyrus-imapd 3.4.3-3build2 amd64 Cyrus mail system - IMAP support
> ii libcyrus-imap-perl:amd64 3.4.3-3build2 amd64 Interface to Cyrus imap
> client imclient library
>
> To manage notifications about this bug go to:
>
> https://bugs.launchpad.net/ubuntu/+source/cyrus-imapd/+bug/1971547/+subscriptions
>
>

Revision history for this message
joshL (poddmo) wrote : Re: cyradm fails on jammy

On an ARM CPU system running Ubuntu 22.04, I used this:

cyrus@mail:~# cat mycyradm.sh
#!/bin/bash

export LD_PRELOAD=/usr/lib/aarch64-linux-gnu/libpcreposix.so.3
/usr/bin/cyradm $@

Revision history for this message
John Edwards (john-cornerstonelinux) wrote :

Is it possible to apply the same patch as Debian have already done?
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1000034

Revision history for this message
Sudip Mukherjee (sudipmuk) wrote :

I have tested and confirmed that the issue is seen on Jammy. Also tested to confirm that Focal and Lunar onwards are not affected.

tags: added: jammy
Changed in cyrus-imapd (Ubuntu Jammy):
status: New → Confirmed
Changed in cyrus-imapd (Ubuntu):
status: Confirmed → Fix Released
Changed in cyrus-imapd (Ubuntu Jammy):
status: Confirmed → In Progress
assignee: nobody → Sudip Mukherjee (sudipmuk)
Revision history for this message
Sudip Mukherjee (sudipmuk) wrote :

debdiff attached for Jammy.

summary: - cyradm fails on jammy
+ [SRU] cyradm fails on jammy
description: updated
Changed in cyrus-imapd (Ubuntu Jammy):
status: In Progress → Confirmed
assignee: Sudip Mukherjee (sudipmuk) → nobody
Revision history for this message
Dave Jones (waveform) wrote :

Confirmed issue only exists on jammy (no later series need patching). Patch looks reasonable and minimal for an SRU fix. Sponsoring (with trivial fix to maintainer address in d/control now that the version number includes an ubuntu component).

Revision history for this message
Chris Halse Rogers (raof) wrote : Please test proposed package

Hello Steve, or anyone else affected,

Accepted cyrus-imapd into jammy-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/cyrus-imapd/3.4.3-3ubuntu0.1 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation on how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested, what testing has been performed on the package and change the tag from verification-needed-jammy to verification-done-jammy. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-jammy. In either case, without details of your testing we will not be able to proceed.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance for helping!

N.B. The updated package will be released to -updates after the bug(s) fixed by this package have been verified and the package has been in -proposed for a minimum of 7 days.

Changed in cyrus-imapd (Ubuntu Jammy):
status: Confirmed → Fix Committed
tags: added: verification-needed verification-needed-jammy
Revision history for this message
Lichtmacher (fh-j) wrote :

The way to install the patch:

root@SERVER:~# cat <<EOF >/etc/apt/sources.list.d/ubuntu-$(lsb_release -cs)-proposed.list
> # Enable Ubuntu proposed archive
> deb http://archive.ubuntu.com/ubuntu/ $(lsb_release -cs)-proposed restricted main multiverse universe
> EOF

Selective upgrading from -proposed

cat <<EOF >/etc/apt/preferences.d/proposed-updates
# Configure apt to allow selective installs of packages from proposed
Package: *
Pin: release a=$(lsb_release -cs)-proposed
Pin-Priority: 400
EOF

root@SERVER:~# apt update

root@SERVER:~$ apt install cyrus-admin/jammy-proposed
Die folgenden zusätzlichen Pakete werden installiert:
  libcyrus-imap-perl
Die folgenden Pakete werden aktualisiert (Upgrade):
  cyrus-admin libcyrus-imap-perl

After that
cyradm --user cyrus localhost
worked without the workaround
https://bugs.launchpad.net/ubuntu/+source/cyrus-imapd/+bug/1971547/comments/10

cyradm startet without error and some basic tasks (lam user.fh) worked.

Thank you!

Revision history for this message
Dave Jones (waveform) wrote :

Many thanks to @fh-j for testing; based on this, and a quick double-check in a jammy container I'm marking this verification done.

tags: added: verification-done-jammy
removed: verification-needed-jammy
Revision history for this message
Robie Basak (racb) wrote :

Before releasing I thought it's worth checking that binary dependencies haven't changed, so I verified that the output of these two commands are the same:

wget -qO- http://archive.ubuntu.com/ubuntu/dists/jammy/universe/binary-amd64/Packages.xz|xz -dc|grep-dctrl -XS cyrus-imapd -s Package,Depends|sort-dctrl -k Package

wget -qO- http://archive.ubuntu.com/ubuntu/dists/jammy-proposed/universe/binary-amd64/Packages.xz|xz -dc|grep-dctrl -XS cyrus-imapd -s Package,Depends|sort-dctrl -k Package

(apart from the strong versioned dependency versions as expected)

Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package cyrus-imapd - 3.4.3-3ubuntu0.1

---------------
cyrus-imapd (3.4.3-3ubuntu0.1) jammy; urgency=medium

  * Link libpcre3 with IMAP.so to resolve undefined symbols. (LP: #1971547)

 -- Sudip Mukherjee <email address hidden> Fri, 19 Jan 2024 12:29:16 +0000

Changed in cyrus-imapd (Ubuntu Jammy):
status: Fix Committed → Fix Released
Revision history for this message
Robie Basak (racb) wrote : Update Released

The verification of the Stable Release Update for cyrus-imapd has completed successfully and the package is now being released to -updates. Subsequently, the Ubuntu Stable Release Updates Team is being unsubscribed and will not receive messages about this bug report. In the event that you encounter a regression using the package from -updates please report a new bug using ubuntu-bug and tag the bug report regression-update so we can easily find any regressions.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.