#1037537 Upgrade To Bookworm Fails with Roundcube Update

Package:
roundcube-core
Source:
roundcube-core
Submitter:
Bryan K. Walton
Date:
2025-09-19 10:57:03 UTC
Severity:
normal
Tags:
#1037537#5
Date:
2023-06-13 21:16:51 UTC
From:
To:
Today, I tried to upgrade my webserver to Debian 12.0 (bookworm).
Everything succeeded but Roundcube.  The upgrade of Roundcube fails with
the following:

Installing new version of config file /etc/roundcube/htaccess ...
Installing new version of config file /etc/roundcube/mimetypes.php ...
INFO: Running /usr/share/roundcube/bin/update.sh as user 'www-data'
dpkg: error processing package roundcube-core (--configure):
 installed roundcube-core package post-installation script subprocess returned error exit status 255
dpkg: dependency problems prevent configuration of roundcube-plugins:
 roundcube-plugins depends on roundcube-core (= 1.6.1+dfsg-1); however:
  Package roundcube-core is not configured yet.

dpkg: error processing package roundcube-plugins (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of roundcube:
 roundcube depends on roundcube-core (= 1.6.1+dfsg-1); however:
  Package roundcube-core is not configured yet.

dpkg: error processing package roundcube (--configure):
 dependency problems - leaving unconfigured
Errors were encountered while processing:
 roundcube-core
 roundcube-plugins
 roundcube
E: Sub-process /usr/bin/dpkg returned an error code (1)

#1037537#10
Date:
2023-06-13 21:41:48 UTC
From:
To:
Control: tag -1 unreproducible moreinfo

What was the previous Roundcube (and Debian itself) version?  Please
also share your roundcube configuration file.  piuparts checks the
upgrade path of the stock config (for all of DB backends) and that
appear to be smooth.

#1037537#17
Date:
2023-06-14 01:45:19 UTC
From:
To:
Previous Roundcube version: 1.4.13+dfsg.1-1~deb11u1
Previous Debian version: 11.7

I've attached the Roundcube configuration file, as requested.  Please
note, for privacy reasons, I have replaced the real des_key value with a
series of "#" symbols.  The same applies to the host value in the
default_host setting.

Thanks!
Bryan Walton

#1037537#22
Date:
2023-06-14 11:18:56 UTC
From:
To:
Which DB backend are you using?  I'm unable to reproduce this in a
Bullseye (11.7) VM with roundcube-mysql (the default):

   ~# apt install -y default-mysql-server
   ~# apt install -y roundcube-core ## don't change pre-selected debconf values
   ## replace /etc/roundcube/config.inc.php with yours (except $config['des_key'])
   ~# sed -i s/bullseye/bookworm/ /etc/apt/sources.list
   ~# apt update
   ~# apt dist-upgrade

Works here, both when selecting “install the package maintainer's
version” or “keep the local version currently installed” for
/etc/roundcube/config.inc.php.  (In both cases, I answered “Yes” to
“Perform upgrade on database for roundcube with dbconfig-common?”.)

Does `apt install -f` fix the problem for you?  If not, you might want
to edit /var/lib/dpkg/info/roundcube-core.postinst and replace `set -e`
with `set -ex` to get a debug trace.

AFAICT ‘twofactor_gauthenticator’, ‘carddav’ and ‘chbox’ don't come from
Debian.  Does it help to remove these 3 from the array?

#1037537#27
Date:
2023-06-15 14:18:05 UTC
From:
To:
Thanks for the reply, Guilhem.

After restoring my VM back to Debian 11.7, I then tried upgrading
Roundcube, first:

# sed -i s/bullseye/bookworm/ /etc/apt/sources.list
# apt-get install roundcube-core

This worked.  I then was able to do the full upgrade to bookworm.

While I'm not sure why this worked, I'm happy to get the upgrade
completed.

Thanks,
Bryan

#1037537#32
Date:
2023-08-10 14:57:14 UTC
From:
To:
Alright, thanks for the follow-up!  As there was no further reports or
confirmations of the issue I'm closing it now.

#1037537#43
Date:
2025-09-18 15:22:51 UTC
From:
To:
Control: reopen

Setting up roundcube-core (1.6.5+dfsg-1+deb12u5) ...
Installing new version of config file /etc/cron.d/roundcube-core ...
Installing new version of config file /etc/roundcube/apache.conf ...
Installing new version of config file
/etc/roundcube/debian-db-roundcube.php ...
Installing new version of config file /etc/roundcube/defaults.inc.php ...
Installing new version of config file /etc/roundcube/htaccess ...
Installing new version of config file /etc/roundcube/mimetypes.php ...
dbconfig-common: writing config to /etc/dbconfig-common/roundcube.conf
creating database backup in
/var/cache/dbconfig-common/backups/roundcube_1.4.15+dfsg.1-1+deb11u5.2025-09-17-10.01.15.
applying upgrade sql for 1.4.15+dfsg.1-1+deb11u5 -> 1.5.0+dfsg.1-1.
applying upgrade sql for 1.4.15+dfsg.1-1+deb11u5 -> 1.6~beta+dfsg-1.
applying upgrade sql for 1.4.15+dfsg.1-1+deb11u5 -> 1.6.1+dfsg-1.
dbconfig-common: flushing administrative password
INFO: Running /usr/share/roundcube/bin/update.sh as user 'www-data'
dpkg: error processing package roundcube-core (--configure):
  installed roundcube-core package post-installation script subprocess
returned error exit status 255

This happens when upgrading from Debian 11 Bullseye to 12 Bookworm:

roundcube-core:amd64 (1.4.15+dfsg.1-1+deb11u5, 1.6.5+dfsg-1+deb12u5)

Trying to debug the issue by including a "set -x" into
/var/lib/dpkg/info/roundcube-core.postinst shows this:

[...]
+ OLD_UPSTREAM_VERSION=1.4.15+dfsg.1
+ OLD_UPSTREAM_VERSION=1.4.15
+ stat -c%f -- /etc/roundcube/config.inc.php
+ m=81a0
+ [ 0 -ne 0 ]
+ stat -c%u -- /etc/roundcube/config.inc.php
+ user=0
+ [ -n 0 ]
+ [ 0 -ne 0 ]
+ [ 32 -eq 0 ]
+ stat -c%g -- /etc/roundcube/config.inc.php
+ gid=33
+ [ 33 -eq 0 ]
+ getent passwd
+ + cut -sd: -f1,4
sed -n s/:0*33$//p
+ user=www-data
+ [ -z www-data ]
+ getent passwd -- www-data
+ install -owww-data -groot -m0600 /dev/null
/etc/roundcube/config.inc.php.dpkg-new
+ stat -c%i %#a -- /etc/roundcube/config.inc.php.dpkg-new
+ st1=32989 0600
+ [ www-data = root ]
+ echo INFO: Running /usr/share/roundcube/bin/update.sh as user 'www-data'
INFO: Running /usr/share/roundcube/bin/update.sh as user 'www-data'
+ runuser -uwww-data -- env DEBIAN_PKG=1 php
/usr/share/roundcube/bin/update.sh --version=1.4.15 --accept=true
dpkg: error processing package roundcube-core (--configure):
   installed roundcube-core package post-installation script subprocess
returned error exit status 255
Errors were encountered while processing:
  roundcube-core

Also when adding -d display_errors=on parameter for php I don't get any
error messages from the PHP script:

/tmp # runuser -uwww-data -- env DEBIAN_PKG=1 php -d display_errors=on
/usr/share/roundcube/bin/update.sh --version=1.4.15 --accept=true

If I request php to display errors and log error them the log file does
not appear:

/tmp # runuser -uwww-data -- env DEBIAN_PKG=1 php -d display_errors=on
-d log_errors=on -d error_log=php-cli-error.log 
/usr/share/roundcube/bin/update.sh --version=1.4.15 --accept=true

/tmp # ls php-cli*
ls: cannot access 'php-cli*': No such file or directory

The user www-data *can* write here:

/tmp # runuser -uwww-data -- touch touched-file
/tmp # ls -la touch*
-rw-r--r-- 1 www-data www-data 0 18. Sep 16:47 touched-file


Any ideas? How can I support on finding the reason for this?


Thanks in advance & kind Regards,

Paul

#1037537#48
Date:
2025-09-18 17:29:09 UTC
From:
To:
Please share your Roundcube configuration file.  FWIW piuparts checks
the upgrade path of the stock config (for each DB backend) and that
appears to be smooth according to https://piuparts.debian.org/bullseye2next/pass.html .

#1037537#53
Date:
2025-09-18 19:35:19 UTC
From:
To:
Hi,

many thanks for the quick reaction, Guilhem. :-)

Well, that's boring, I think:

<?php

/*
+----------------------------------------------------------------------+
| Local configuration for the Roundcube Webmail installation.
[...]|
+----------------------------------------------------------------------+
*/

$config = array();

/* Do not set db_dsnw here, use dpkg-reconfigure roundcube-core to
configure database ! */
include_once("/etc/roundcube/debian-db-roundcube.php");

$config['smtp_server'] = '';
$config['smtp_port'] = 25;
$config['smtp_user'] = '';
$config['smtp_pass'] = '';
$config['support_url'] = '';
$config['product_name'] = 'Roundcube Webmail';
$config['des_key'] = 'XXXXXXXXXXXXXXXXXXXXXXXX';
$config['plugins'] = array(
'archive',
'zipdownload',
'managesieve',
'carddav'
);
$config['skin'] = 'larry';
$config['enable_spellcheck'] = true;
$config['spellcheck_languages'] = array('en'=>'English', 'de'=>'Deutsch');

I do not really understand what I see there when looking at
roundcube-core. Looks to me like an update from 1.4.15+dfsg.1-1+deb11u4
to 1.4.15+dfsg.1-1+deb11u5 but not to 1.6.5+dfsg-1+deb12u5.
On that link
<https://piuparts.debian.org/bookworm/pass/roundcube-core_1.6.5+dfsg-1+deb12u5.log>
I find a line
Setting up roundcube-core (1.6.5+dfsg-1+deb12u5) ...
but that looks like a fresh install and not an upgrade.


Is there a way to debug the php script
/usr/share/roundcube/bin/update.sh as with set -x in a bash script?


Thanks & kind Rgards,

Paul

#1037537#58
Date:
2025-09-18 21:49:49 UTC
From:
To:
Like for https://bugs.debian.org/#1037537#22 , `carddav` is not a plugin
coming from Debian.  AFAICT it has its own DB migrations, which are not
supported by `apt upgrade`.  Does it work if you remove the plugin from
the array?

Right, that's the bookworm test (package installation, removal, and
purge test).  My previous link was for upgrade from bullseye to bookworm
(package installation in bullseye, dist-upgrade to bullseye-next,
removal, and purge test).  Thought bullseye-next is currently .4.15+dfsg.1-1+deb11u5
for some reason, and not the version currently found in bookworm.  But I
tried manually and the upgrade was smooth :-)

There is Xdebug for instance.

#1037537#63
Date:
2025-09-19 01:42:32 UTC
From:
To:
Yes, it does. Thanks for pointing this out.


Last step was to replace 'skin' 'larry' with 'elastic' to get rid of
  File Not Found
  The requested resource was not found!


Now RoundCube is working again and apt is happy. :-)


Kind Regards,

Paul

#1037537#68
Date:
2025-09-19 10:55:34 UTC
From:
To:
Great!  Thanks for confirming, I'm therefore closing this bug again.