Short answer: A Roundcube DATABASE ERROR on cPanel means webmail cannot open its own database, which holds contacts, settings and sessions, not mail. Check which back end it uses with grep -Ei 'db_dsnw.*//' /usr/local/cpanel/base/3rdparty/roundcube/config/config.inc.php. For the deprecated MySQL back end, make sure MariaDB is running, then rebuild with /usr/local/cpanel/bin/update-roundcube-db. For SQLite, check ownership, disk space and quota for the user’s .rcube.db file. A login loop usually means the session cannot be saved or a proxy drops the cookie; test directly on port 2096. (Reviewed October 2026.)
Applies to cPanel & WHM 120 and later (Roundcube 1.6 branch; version 136 ships Roundcube 1.6.15), with either the SQLite back end or the MySQL back end that cPanel deprecated in version 120.
Roundcube on cPanel is updated as part of the normal upcp run (1.6.15 shipped with 136 and 1.6.19 with 138), and most of the time the schema migration it needs runs silently. When it does not, or when the underlying database is unhealthy, users get either a bare “DATABASE ERROR: CONNECTION FAILED” page or a login form that accepts the password and then shows itself again. Both are server-side problems, both are quick to fix once you know which back end the server uses, and neither is caused by the user’s password.
Table of Contents
Identify the Roundcube back end
cPanel supports two storage modes for Roundcube’s own data (contacts, preferences, sessions, identities): a single MySQL database called roundcube, or one SQLite file per mail account under the user’s home. Check which is in use:
grep -Ei 'db_dsnw.*//' /usr/local/cpanel/base/3rdparty/roundcube/config/config.inc.php
ls /home/*/etc/*/*.rcube.db 2>/dev/null | head -3
A db_dsnw value starting with mysql:// means the shared database; one starting with sqlite:/// means per-user files at /home/username/etc/domain/username.rcube.db. The failures and the fixes differ by mode, so establish this first. The MySQL back end has been deprecated since cPanel & WHM version 120, and moving to SQLite is a one-way conversion with /usr/local/cpanel/scripts/convert_roundcube_mysql2sqlite, not a Tweak Setting.
DATABASE ERROR with the MySQL back end
The message means Roundcube could not open its MySQL connection. The credentials are in /usr/local/cpanel/base/3rdparty/roundcube/config/config.inc.php in the $config['db_dsnw'] line. Check each part in turn:
systemctl status mariadb
mysql -e "SHOW DATABASES LIKE 'roundcube'"
mysql roundcube -e "SHOW TABLES" | head
If MariaDB is down, fix that first; the MariaDB startup guide covers it. If the database is missing or the roundcube MySQL user cannot connect, let cPanel recreate it:
/usr/local/cpanel/bin/update-roundcube-db
cPanel documents this script as the way to rebuild the Roundcube database: it archives the current data to /var/cpanel/roundcube/roundcube.backup.sql.<timestamp>, rebuilds the database and applies pending schema updates, and it detects SQLite and runs update-roundcube-sqlite-db instead when needed. Roundcube is locked out while it runs, so use a quiet period.
If the tables exist but the error page shows a query failure rather than a connection failure, a table is usually crashed or the schema is behind the code version:
mysqlcheck --auto-repair roundcube
mysql roundcube -e "SELECT name, value FROM system"
The system table holds roundcube-version. Its value is a date-style schema stamp such as 2022081200, not the 1.6.x release number defined in program/include/iniset.php, so the two cannot be compared directly. If the error log reports a missing table or column, the migration did not run; update-roundcube-db applies it. If MariaDB is refusing connections outright, check for the connection-limit case described in fixing MySQL too many connections.
DATABASE ERROR with the SQLite back end
Here the database is a file owned by the mail account’s user and the failure is nearly always ownership, permissions or a full disk:
ls -la /home/USER/etc/example.com/
df -h /home
The .rcube.db file must be owned by the cPanel user and writable by it, and the directory it lives in must be writable so SQLite can create its journal. Fix ownership with chown USER:USER /home/USER/etc/example.com/*.rcube.db. If the file is zero bytes or corrupt (the log says file is not a database), move it aside and Roundcube will create a fresh one on the next login; the user loses contacts and preferences but mail is untouched, because mail lives in Dovecot, not Roundcube.
A quota at 100% produces the same error because SQLite cannot write. Check with quota -u USER and see our quota guide if the numbers look wrong.
The login loop
When the form reloads with no message, Roundcube authenticated against Dovecot successfully and then failed to store the session. Causes, in order of likelihood:
- Session storage broken: with MySQL, the
sessiontable is crashed or full; with SQLite, the same permission issues as above.mysqlcheck --auto-repair roundcubeor the ownership fix resolves it. - PHP session or temp directory unwritable: Roundcube under cPanel uses
/usr/local/cpanel/base/3rdparty/roundcube/temp/. Confirm it exists and is writable by the cPanel user context, and that/tmpis not mountednoexecwith an oldsessionssetting. Checkdf -h /tmp. - Clock skew between the browser and server: session cookies expire immediately if the server clock is hours out.
chronyc tracking. - Proxy or Cloudflare stripping cookies: if webmail is behind a proxy that rewrites the
Set-Cookieheader or the hostname differs between the form post and the redirect (mixedwebmail.example.comandhostname:2096), the session cookie is never presented. Test directly againsthttps://hostname:2096to rule the proxy in or out. - Dovecot 2.4 auth changes: a login that works in a mail client but loops in Roundcube after an update is sometimes a stale IMAP host setting in the Roundcube config; compare the IMAP host in
config.inc.phpwith the server’s mail hostname.
The Roundcube error log is the quickest confirmation:
tail -50 /var/cpanel/roundcube/log/errors.log # MySQL back end
tail -50 /home/USER/logs/roundcube/errors.log # SQLite back end
tail -50 /usr/local/cpanel/logs/error_log | grep -i roundcube
A common pitfall: switching back ends
Moving from MySQL to SQLite is done with /usr/local/cpanel/scripts/convert_roundcube_mysql2sqlite, which walks every account, and it is one-way: cPanel documents that you cannot revert to a MySQL database afterwards. On a server with many mailboxes it takes a long time, so run it out of hours. The script also accepts a single user (/usr/local/cpanel/scripts/convert_roundcube_mysql2sqlite USER) to convert or retry one account.
Verify
Log in to webmail as the affected account through cPanel » Email Accounts » Check Email, open Contacts and Settings, and change and save a preference. That exercises reads and writes on every table that matters. Then confirm the log has stayed quiet:
tail -5 /var/cpanel/roundcube/log/errors.log # SQLite: /home/USER/logs/roundcube/errors.log
For the MySQL back end, add the roundcube database to whatever backup and mysqlcheck schedule you already run; the MySQL health snapshot script reports crashed tables before users hit them.
Undo or roll back
- Before rebuilding or converting a MySQL back end, take a copy:
mysqldump roundcube > /root/roundcube.sql. To roll back, restore it withmysql roundcube < /root/roundcube.sql.update-roundcube-dbalso archives the old data to/var/cpanel/roundcube/roundcube.backup.sql.<timestamp>. - For SQLite, move a damaged
.rcube.dbfile aside instead of deleting it (for example append.broken); moving it back restores the user’s contacts and settings. - The MySQL to SQLite conversion cannot be reversed, so keep the
roundcubedatabase dump from before the conversion until users confirm their contacts and settings are intact.
Roundcube database error at a glance



Official documentation (checked 9 October 2026): How do I check what backend Roundcube is using? · cPanel Support · How to Rebuild the Roundcube Database · cPanel & WHM documentation · How to Convert Roundcube to SQLite · cPanel & WHM documentation · cPanel Deprecation Plan · cPanel & WHM documentation · Where can I find the Roundcube error log? · cPanel Support · Roundcube MySQL dbmigration fails with Unknown column user_id · cPanel Support · Roundcube databases are not generated when accessing Webmail · cPanel Support · 136 Change Log · cPanel & WHM documentation · roundcubemail release-1.6 SQL/mysql.initial.sql · Roundcube on GitHub · How to Configure Your Firewall for cPanel & WHM Services · cPanel & WHM documentation
Related guides: Email forwarders with MailBaby: SRS, strict forwarding errors and backoffs · Find the source of outgoing spam on a cPanel server · Choosing a VPS for a cPanel or DirectAdmin server in 2026.
Frequently asked questions
Does the Roundcube database error mean email has been lost?
No. Roundcube’s database only stores contacts, identities, preferences and sessions. Mail itself lives in Dovecot’s maildirs, so even recreating the Roundcube database from scratch leaves every message in place.
Is it safe to run update-roundcube-db on a live cPanel server?
Yes, with care. cPanel documents it as the way to rebuild the Roundcube database: it first archives the current data under /var/cpanel/roundcube/, and Roundcube is locked out while it runs, so use a quiet period. Mail itself is not touched.
Why does Roundcube work on port 2096 but loop behind Cloudflare or a proxy?
The session cookie is being dropped or rewritten. A proxy that alters the Set-Cookie header, or a hostname mismatch between the login post and the redirect, means the browser never presents the session, so Roundcube shows the form again. Fix the proxy rule or use a consistent webmail hostname.
