Wednesday, March 13, 2013

Fixing "An error occured while saving" in roundcube


After having updated my Ubuntu server from 10.04 version to 12.04 version, an error occurred while trying to save contacts and identities in the webmail roundcube. This tutorial explains how to find out what the problem is and how to fix it.

Error while saving a contact in the addressbook


While trying to save a new contact, I obtain the following message:

An error occured while saving

The error is more precisely described in roundcube's log files:

?View Code BASH
tail -f /var/log/roundcube/errors
where the following lines can be found

[21-Aug-2012 07:52:12 UTC] MDB2 Error: no such field (-19): _doQuery: [Error message:
Could not execute statement]
[Last executed query: INSERT INTO contacts (user_id, changed, del, `vcard`, `name`,
`email`, `firstname`, `surname`, `words`) VALUES ...
[Native code: 1054] [Native message: Unknown column 'words' in 'field list']
This indicates that the field "words" does not exist in the table "contact" in roundcube's database. Using SQL server (or PhpMyAdmin if it is installed), this error can be fixed by inserting the missing field:

ALTER TABLE `contacts` ADD `words` VARCHAR (500) NULL DEFAULT NULL


Error while adding a new identity


Trying to save a new identity resulted in the same error message. Once again, it comes from a missing field ("changed" is missing in the table "identities")

Code SQL

ALTER TABLE `identities` ADD `changed` DATETIME NOT NULL DEFAULT '1000-01-01 00:00:00'
AFTER `identity_id`


No comments:

Post a Comment