Roundcube Community Forum

 

Could not save contact address

Started by adrianleigh, November 21, 2007, 05:51:27 AM

Previous topic - Next topic

adrianleigh

Hi,

I have recently installed roundcube on iis 6 with mysql but when the users click the + sign to add the contact it gives this message.
Could not save contact address.
I have done loads of searches on teh forum but just cant find the anwser.
I did wonder if it was a file permission thing but i have installed as of the manual.

Any help would be great.

Cheers Ady

yitbos

Hi...Were you able to solve this ? I am having the same problem...Thanks

daz

Check your log files for roundcube. You are looking for /logs/errors. I had this problem and my error looked like this:

[14-Feb-2008 16:55:54 -0700] DB Error: DB Error: unknown error Query: INSERT INTO contacts (user_id, changed, del, `name`, `email`) VALUES ('3', now(), 0, 'Info', '[email protected]') [nativecode=1364 ** Field 'firstname' doesn't have a default value] in C:\Inetpub\Webmail\roundcubemail-0.1-rc2\program\include\rcube_db.inc on line 505
[14-Feb-2008 16:57:34 -0700] DB Error: DB Error: unknown error Query: INSERT INTO contacts (user_id, changed, del, `name`, `email`) VALUES ('3', now(), 0, 'Info', '[email protected]') [nativecode=1364 ** Field 'firstname' doesn't have a default value] in C:\Inetpub\Webmail\roundcubemail-0.1-rc2\program\include\rcube_db.inc on line 505
[14-Feb-2008 16:57:36 -0700] DB Error: DB Error: unknown error Query: INSERT INTO contacts (user_id, changed, del, `name`, `email`) VALUES ('3', now(), 0, 'Info', '[email protected]') [nativecode=1364 ** Field 'firstname' doesn't have a default value] in C:\Inetpub\Webmail\roundcubemail-0.1-rc2\program\include\rcube_db.inc on line 505

The problem was caused by MySQL running in strict mode, which means the db will reject any query that tries to insert an empty value into a NOTNULL field. When you click the [ + ], there is no way to set the 'firstname' field, so roundcube leaves it blank, causing problems with a strict db. I believe this mainly affects MySQL 5 (which I am running) as strict mode was only introduced in 5.0.2.

How To Fix:
- Open my.cnf or my.ini depending on your installation
- Look for the following lines:
# Set the SQL mode to strict
sql-mode="STRICT_TRANS_TABLES,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION"
- Remove any instance of 'STRICT_TRANS_TABLES' or 'STRICT_ALL_TABLES' from the 'sql-mode' parameter
- Restart the MySQL service

This should fix the same problem on nix boxes too.

methilnet

Fix the database dont break the server!
Set the field to allow null value instead.
Learn to deal with strick_mode that how SQL is suppose to work.
Why set a field to NotNull if you are not going to put a value in it anyway?

methilnet

Here is the script to fix the identities table


ALTER TABLE `identities` MODIFY COLUMN `organization` VARCHAR(128) CHARACTER SET utf8 COLLATE utf8_general_ci,
 MODIFY COLUMN `reply-to` VARCHAR(128) CHARACTER SET utf8 COLLATE utf8_general_ci,
 MODIFY COLUMN `bcc` VARCHAR(128) CHARACTER SET utf8 COLLATE utf8_general_ci,
 MODIFY COLUMN `signature` TEXT CHARACTER SET utf8 COLLATE utf8_general_ci,
 MODIFY COLUMN `html_signature` TINYINT(1);


And the one for the contacts table


ALTER TABLE `contacts` MODIFY COLUMN `firstname` VARCHAR(128) CHARACTER SET utf8 COLLATE utf8_general_ci,
 MODIFY COLUMN `surname` VARCHAR(128) CHARACTER SET utf8 COLLATE utf8_general_ci,
 MODIFY COLUMN `vcard` TEXT CHARACTER SET utf8 COLLATE utf8_general_ci;


kait-ahoi

When I try to fix the webmail with command listed in forum Terminal says
could not save history to file "/var/empty/.psql_history": Permission denied
Can anybody help on this