Roundcube server 500 - restore SQLite Database and Fix Access After cPanel v120/v126 Updates

Modified on Sat, 31 May at 9:09 AM

Immediate Recovery for v120/v126 Update Issue
If you have recently upgraded to cPanel v120 or v126 and cannot access Roundcube due to an outdated SQLite schema, run the following auto-repair command as root to recover immediately (instead of waiting for the cron job):

/usr/local/cpanel/scripts/autorepair recoverymgmt




Step 1. Identify the Roundcube Database for One Mailbox


Step 1.1 – Locate the mailbox database path

Roundcube creates a per-user SQLite file under the cPanel user’s home directory. For each mailbox, that file is named

$EMAIL_USER.rcube.db

and resides here:

/home/$CPANELUSER/etc/$DOMAIN/$EMAIL_USER.rcube.db
  • $CPANELUSER = cPanel account username (e.g., johndoe)

  • $DOMAIN = the domain for that mailbox (e.g., example.com)

  • $EMAIL_USER = the mailbox local-part (e.g., info for info@example.com)


Step 1.2 – Locate the system account database path

Roundcube also maintains a database for the cPanel-system login (no-domain). That file is named

$CPANELUSER.rcube.db

in this directory:

/home/$CPANELUSER/etc/$CPANELUSER.rcube.db

Replace $CPANELUSER with the actual cPanel username.


Step 1.3 – List current plus backup files

To verify both active databases and any automatically created backups for a mailbox and for the system account, run:

ls -l /home/$CPANELUSER/etc/"$DOMAIN"/"$EMAIL_USER".rcube.db* /home/$CPANELUSER/etc/"$CPANELUSER".rcube.db*

Example output:

-rw------- 1 johndoe johndoe  512000 Jan 21 19:52 info.rcube.db
-rw------- 1 johndoe johndoe  466944 Jul 31  2024 info.rcube.db.1722461863
-rw------- 1 johndoe johndoe  491520 Oct 31  2024 info.rcube.db.1730428585
-rw------- 1 johndoe johndoe  505856 Jan 10  2025 info.rcube.db.1731234567
-rw------- 1 johndoe johndoe  490000 Feb 15  2025 johndoe.rcube.db
-rw------- 1 johndoe johndoe  480000 Dec 10  2024 johndoe.rcube.db.1734200000
  • Files ending in *.rcube.db (without a timestamp) are active databases.

  • Files ending in *.rcube.db.TIMESTAMP are automatic backups (with Unix-epoch suffixes).


Step 2. Backup/Rename the Current (Possibly Corrupt) Database


Warning: Always back up (rename) the “current” database file before overwriting or deleting it.


Step 2.1 – SSH into the server as root

ssh root@your-cpanel-server

Step 2.2 – Change into the mailbox’s Roundcube directory

cd /home/"$CPANELUSER"/etc/"$DOMAIN"/

Step 2.3 – List existing Roundcube database files for that mailbox

ls -l "$EMAIL_USER".rcube.db*

Example output:

-rw------- 1 johndoe johndoe 512000 Jan 21 19:52 info.rcube.db
-rw------- 1 johndoe johndoe 466944 Jul 31  2024 info.rcube.db.1722461863
-rw------- 1 johndoe johndoe 491520 Oct 31  2024 info.rcube.db.1730428585
-rw------- 1 johndoe johndoe 505856 Jan 10  2025 info.rcube.db.1731234567

Step 2.4 – Rename (move) the current database to a timestamped filename

Append today’s date (YYYYMMDD) to preserve it:

mv "$EMAIL_USER.rcube.db" "$EMAIL_USER.rcube.db.$(date +%Y%m%d)" -v

Expected verbose output:

'info.rcube.db' -> 'info.rcube.db.20250531'

Now only the files with .rcube.db.TIMESTAMP suffixes remain in that directory.


Step 2.5 – Repeat for the system account database

Change into the etc folder without specifying a domain, then rename the system account file:

cd /home/"$CPANELUSER"/etc/ mv "$CPANELUSER.rcube.db" "$CPANELUSER.rcube.db.$(date +%Y%m%d)" -v

Expected output:

'johndoe.rcube.db' -> 'johndoe.rcube.db.20250531'

Step 3. Locate & Restore a Valid Backup


Roundcube automatically saves older copies of each SQLite database as *.rcube.db.TIMESTAMP. Follow the substeps to restore one.


Step 3.1 – List available backups for the mailbox

ls -l /home/"$CPANELUSER"/etc/"$DOMAIN"/*".rcube.db."*

Example output:

-rw------- 1 johndoe johndoe 466944 Jul 31  2024 info.rcube.db.1722461863
-rw------- 1 johndoe johndoe 491520 Oct 31  2024 info.rcube.db.1730428585
-rw------- 1 johndoe johndoe 505856 Jan 10  2025 info.rcube.db.1731234567
-rw------- 1 johndoe johndoe 502784 May  1  2025 info.rcube.db.1735803200

Identify the backup with the most recent timestamp or the largest file size—this is likely the healthiest copy.


Step 3.2 – Copy the chosen backup to become the active database

Assuming you pick the May 1, 2025 backup (suffix 1735803200):

cp -p "info.rcube.db.1735803200" "info.rcube.db"

Using cp -p preserves ownership and modification timestamps.


Step 3.3 – Restore ownership and file permissions

chown "$CPANELUSER":"$CPANELUSER" "info.rcube.db" chmod 600 "info.rcube.db"

Verify with:

ls -l "info.rcube.db"

Expected output:

-rw------- 1 johndoe johndoe 502784 May  1 12:00 info.rcube.db

Step 3.4 – Restore the system account database (if needed)

Change directory to /home/$CPANELUSER/etc and copy its most recent backup:

chown -R "$CPANELUSER":"$CPANELUSER" /home/"$CPANELUSER"/etc/"$DOMAIN"/
chmod 700 /home/"$CPANELUSER"/etc/"$DOMAIN"/


chown -R "$CPANELUSER":"$CPANELUSER" /home/"$CPANELUSER"/etc/
chmod 700 /home/"$CPANELUSER"/etc/

Step 3.5 – Verify Roundcube functionality

Step 3.5.1 – Mailbox login

Log in to Webmail and select Roundcube for the mailbox. The “no such table: carddav_accounts” error should no longer appear.


Step 3.5.2 – System account login

Log in as the cPanel system user (no-domain). Roundcube should load using the restored system account database.


Step 4. Fallback: Delete & Let Roundcube Recreate the Database


If no valid backup exists or restoring still fails, delete the existing SQLite file so Roundcube can build a fresh one upon next login.


Step 4.1 – Remove the corrupted mailbox database file

rm /home/"$CPANELUSER"/etc/"$DOMAIN"/"$EMAIL_USER".rcube.db

Step 4.2 – Remove the corrupted system account database file (if present)

rm /home/"$CPANELUSER"/etc/"$CPANELUSER".rcube.db

Step 4.3 – Ensure correct ownership on parent directories

chown -R "$CPANELUSER":"$CPANELUSER" /home/"$CPANELUSER"/etc/"$DOMAIN"/ chmod 700 /home/"$CPANELUSER"/etc/"$DOMAIN"/ 
chown -R "$CPANELUSER":"$CPANELUSER" /home/"$CPANELUSER"/etc/ chmod 700 /home/"$CPANELUSER"/etc/

Step 4.4 – Prompt the user to log in to Roundcube

Step 4.4.1 – Mailbox login

When the mailbox user logs in via Webmail, Roundcube will automatically create a new info.rcube.db.


Step 4.4.2 – System account login

When the system account logs in (no-domain), Roundcube will create a new johndoe.rcube.db.

Afterward, instruct users to re-create any custom folders, address books, and preferences.


Step 5. List Each Affected cPanel Username Exactly Once


To enumerate all cPanel users whose Roundcube logs contain the string “no such table: carddav_accounts,” run:

grep -l "no such table: carddav_accounts" /home/*/logs/roundcube/errors.log \  | sed -E 's#^/home/([^/]+)/logs/roundcube/errors.log$#\1#'
  • This outputs each matching filename a single time (-l causes grep to list only filenames).

  • Then sed captures and prints just the username portion of each path.


If you need the full matching lines (verbose) for a particular user, omit the -l flag:

grep "no such table: carddav_accounts" /home/elzisnl/logs/roundcube/errors.log

Related Sources


How-To Restore a RoundCube SQLite Database backup

https://support.cpanel.net/hc/en-us/articles/360051956994-How-To-Restore-a-RoundCube-SQLite-Database-backup


v120/v126: Unable to access Roundcube after updates

https://support.cpanel.net/hc/en-us/articles/25294429672599-v120-v126-Unable-to-access-Roundcube-after-updates


Was this article helpful?

That’s Great!

Thank you for your feedback

Sorry! We couldn't be helpful

Thank you for your feedback

Let us know how can we improve this article!

Select at least one of the reasons
CAPTCHA verification is required.

Feedback sent

We appreciate your effort and will try to fix the article