Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[5 ERR] Error adding addressbook from preset SOGo_autodiscovery: [1406] Data too long for column 'name' at row 1 #382

Closed
chaos-prevails opened this issue May 17, 2022 · 2 comments
Assignees
Labels
DB schema change Resolution to this issue involves change of the database schema enhancement

Comments

@chaos-prevails
Copy link

Dear all,

I use SOGo as backend, and shared address books have the sharer with the full username (+domain) in their name, e.g.

name_of_addressbook ([email protected])

I see that the varchar limit for the name attribute in carddav_addressbook is 64 characters. However, my shared address book has 84 characters. This happens easily especially if the address book name is long (or the domain is long). I get the following error:

May 17 14:01:47 mail roundcube: <f093uvfo> [5 ERR] Error adding addressbook from preset SOGo_autodiscovery: [1406] Data too long for column 'name' at row 1 
May 17 14:01:47 mail roundcube: <f093uvfo> DB Error: [1406] Data too long for column 'name' at row 1 (SQL Query: INSERT INTO carddav_addressbooks(`name`,`username`,`password`,`url`,`user_id`,`sync_token`,`active`,`presetname`,`use_categories`,`refresh_time`) VALUES ('(addressbookname (addressbookname_XX.net-test (sharer-name <[email protected]>))','%u','{ENCRYPTED}XXXX','https://mail.mydomain.org/SOGo/dav/[email protected]/Contacts/314CF5-62837A80-B-XXYYZZWW/','5','','1','addressbookname','1','240')) in /opt/www/roundcubemail/program/lib/Roundcube/rcube_db.php on line 566 (POST /mail/?_task=login&_action=login)
May 17 14:01:47 mail roundcube: <f093uvfo> [5 ERR] Database::insert (INSERT INTO carddav_addressbooks(`name`,`username`,`password`,`url`,`user_id`,`sync_token`,`active`,`presetname`,`use_categories`,`refresh_time`) VALUES (?,?,?,?,?,?,?,?,?,?)) ERROR: [1406] Data too long for column 'name' at row 1 
May 17 14:01:47 mail roundcube: <f093uvfo> [5 ERR] Error adding addressbook from preset addressbookname: [1406] Data too long for column 'name' at row 1 

after alter table carddav_addressbooks modify column name VARCHAR(255); all is fine. Maybe the SQL init could be changed to varchar(255) for the name attribute?

thanks!

@mstilkerich
Copy link
Owner

Hi, yes, I can change it to a TEXT column to lift that limit. The name column is not used in any index, so it should not be an issue.

@mstilkerich mstilkerich self-assigned this May 17, 2022
@mstilkerich mstilkerich added enhancement DB schema change Resolution to this issue involves change of the database schema labels May 17, 2022
@chaos-prevails
Copy link
Author

Hi, yes, I think TEXT or a long varchar should be sufficient. Thanks for updating!

mstilkerich added a commit that referenced this issue May 21, 2022
This aligns with the change on the master branch for #382.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
DB schema change Resolution to this issue involves change of the database schema enhancement
Projects
None yet
Development

No branches or pull requests

2 participants