SOLVED [CPANEL-31773] RoundCube DATABASE ERROR: CONNECTION FAILED after cPanel update to 86.0.8

cPanel & WHM Version
86.0.8

GuntherR

Member
Nov 16, 2009
13
0
51
RoundCube is giving a DATABASE ERROR: CONNECTION FAILED! Unable to connect to the database! after an automatic upgrade from 84.x to 86.x last night.

My current server:
/etc/redhat-release:CentOS release 6.10 (Final)
/usr/local/cpanel/version:11.86.0.8
/var/cpanel/envtype:standard
CPANEL=release

mariadb 10.3.22
exim 4.93-2
imap 2.3.8

Restarted exim but did not change anything.

/var/cpanel/roundcube/log/errors:
[04-Mar-2020 09:31:04 America/Miami] PHP Warning: file_get_contents(/usr/local/cpanel/base/3rdparty/roundcube/plugins/carddav/dbinit/mysql.sql): failed to open stream: No such file or directory in /usr/local/cpanel/base/3rdparty/roundcube/plugins/carddav/carddav.php on line 54
[04-Mar-2020 09:31:04 -0400]: <3967603f> DB Error: [1146] Table 'roundcube.carddav_addressbooks' doesn't exist (SQL Query: SELECT * FROM carddav_addressbooks WHERE user_id='180' AND presetname is not null) in /usr/local/cpanel/base/3rdparty/roundcube/program/lib/Roundcube/rcube_db.php on line 543 (GET /cpsess0429168017/3rdparty/roundcube/index.php?login=1&post_login=....)

Current installed packages: Apache 2.4, PHP 5.6, PHP 7.1, PHP 7.2, and PHP 7.3

On strange update was part of this update (update to a lower version?):
[2020-03-04 02:32:14 -0400] info [update-roundcube-db] Roundcube update from 1.3.8-16.cp1184 to 1.3.8-13.cp1186 in progress.
[2020-03-04 02:32:14 -0400] info [update-roundcube-db] Roundcube updated to 1.3.8-13.cp1186

Found some more in /var/cpanel/roundcube/log/carddav:
[04-Mar-2020 07:41:52 -0400]: <883552e1> Can't find migration: /dbinit/mysql.sql

I do not see the table 'carddav_addressbooks' in the current DB, I only see 'carddav_migrations'.

I can find a mysql.sql file in /usr/local/cpanel/base/3rdparty/roundcube/plugins/carddav/dbmigrations/0000-dbinit/ and in that file the missing tables are created.
So I guess somewhere in the update an absolute path (/dbinit/mysql.sql) was used instead of the correct one.

Any idea how to get the RoundCube DB connected again?

Thanks!
 
Last edited:

cPanelLauren

Product Owner
Staff member
Nov 14, 2017
13,295
1,255
313
Houston
Hello,

This issue is related to an internal case in which Roundcube using MySQL as opposed to SQLite fails after the update to v86. The internal case ID is CPANEL-31773 and the current workaround for it is one of the following:

Known workaround(s)
Alter roundcube tables to use InnoDB storage

mysql roundcube -e "drop table carddav_migrations"; unalias ls; for each in `ls -1 /var/lib/mysql/roundcube/ |cut -d"." -f1 |uniq |grep -v db`; do mysql roundcube -e "alter table $each ENGINE=INNODB;";done

OR

Edit File below to remove ENGINE=INNODB lines from each table creation query.

/usr/local/cpanel/base/3rdparty/roundcube/plugins/carddav/dbmigrations/0000-dbinit/mysql.sql

Then, create a new login session for Roundcube to observe the tables get created as expected.

Alternatively you could also convert to SQLite which is the preferred storage format:


We're also tracking this case here: In Progress - cPanel & WHM 86 - Known Issues
 

GuntherR

Member
Nov 16, 2009
13
0
51
Thanks Lauren,
Changed RoundCube tables to INNODB after troubleshooting with cPanel Tony and all is working fine again.
Might consider changing to SQLite at a later time.
Unfortunately the impact of this automatic update (86.0.8) was a full day without RoundCube for 100+ users.
Would have been nice to find a INNODB comment in one of the update log files.
Glad it's back online again.
 

cPanelLauren

Product Owner
Staff member
Nov 14, 2017
13,295
1,255
313
Houston
Hi @GuntherR

I'm glad you got it resolved.

Would have been nice to find a INNODB comment in one of the update log files.
I think, more to that, it would have been nice if it wouldn't have happened at all, the internal case that's open for this should resolve that though.
 

cPanelLauren

Product Owner
Staff member
Nov 14, 2017
13,295
1,255
313
Houston
As of v86.0.13, this issue is noted as being resolved. This can be confirmed by checking the changelogs here: 86 Change Log | cPanel & WHM Documentation

If you're on this version of cPanel & WHM and you're still experiencing an issue please open a ticket so that we can investigate further.