Skip to main content

OnlineSupport4u

Database error on roundcube on CWP Panel

By PrasadNaik
June 25, 2026

While rest of the website were working fine and while accessing my email account via auto-login

it was showing an error Database error connection failed

Please contact server administrator

After checking the logs in /usr/local/cwpsrv/var/services/roundcube/logs/errors.log

found the error due to missing table roundcube.carddav_addressbook

18-Jun-2026 19:39:09 +0000]: <3c79m5k8> DB Error: [1146] Table ’roundcube.carddav_addressbooks’ doesn’t exist (SQL Query: SELECT * FROM carddav_addressbooks WHERE ((user_id = ‘3’))) in /usr/local/cwpsrv/var/services/roundcube/program/lib/Roundcube/rcube_db.php on line 543 (GET /?_task=mail&_token=tee6Pl7prS5tNWlXRyKRmdBY6p2cXU3o)
[18-Jun-2026 19:39:09 +0000]: <3c79m5k8> DB Error: [1146] Table ’roundcube.carddav_addressbooks’ doesn’t exist (GET /?_task=mail&_token=tee6Pl7prS5tNWlXRyKRmdBY6p2cXU3o)

logged into Mysql and went to roundcube database

[root@ok1129 ~]# mysql
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MariaDB connection id is 52184
Server version: 10.4.34-MariaDB MariaDB Server

Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.

Type ‘help;’ or ‘\h’ for help. Type ‘\c’ to clear the current input statement.

MariaDB [(none)]> use roundcube;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Database changed

Created the 2 missing tables using below commands

Database changed


MariaDB [roundcube]> CREATE TABLE IF NOT EXISTS carddav_addressbooks (
-> id INT(11) UNSIGNED NOT NULL AUTO_INCREMENT,
-> user_id INT(10) UNSIGNED NOT NULL,
-> name VARCHAR(255) NOT NULL,
-> url VARCHAR(255) NOT NULL,
-> username VARCHAR(255) DEFAULT NULL,
-> password VARCHAR(255) DEFAULT NULL,
-> active TINYINT(1) NOT NULL DEFAULT 1,
-> PRIMARY KEY (id),
-> CONSTRAINT fk_carddav_addressbooks_user_id FOREIGN KEY (user_id) REFERENCES users(user_id) ON DELETE CASCADE ON UPDATE CASCADE
-> ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
Query OK, 0 rows affected (0.016 sec)

MariaDB [roundcube]> CREATE TABLE IF NOT EXISTS carddav_accounts (
-> id INT(11) UNSIGNED NOT NULL AUTO_INCREMENT,
-> user_id INT(10) UNSIGNED NOT NULL,
-> name VARCHAR(255) NOT NULL,
-> discovery_url VARCHAR(255) NOT NULL,
-> username VARCHAR(255) DEFAULT NULL,
-> password VARCHAR(255) DEFAULT NULL,
-> active TINYINT(1) NOT NULL DEFAULT 1,
-> PRIMARY KEY (id),
-> CONSTRAINT fk_carddav_accounts_user_id FOREIGN KEY (user_id) REFERENCES users(user_id) ON DELETE CASCADE ON UPDATE CASCADE
-> ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
Query OK, 0 rows affected (0.012 sec)

MariaDB [roundcube]> exit
Bye

This fixed the issue and Roundcube was working perfectly fine