[BUG] Roundcube update 1.4.11 -> 1.5.0

priest666

Verified User
Joined
Feb 27, 2015
Messages
18
Hi.
When trying to update Roundcube using custombuild, a set of errors are thrown.

Code:
[root@vs050 custombuild]# ./build roundcube
Downloading             roundcubemail-1.5.0.tar.gz...
--2021-11-01 14:21:56--  https://files-de.directadmin.com/services/custombuild/all/roundcube/roundcubemail-1.5.0.tar.gz
Resolving files-de.directadmin.com (files-de.directadmin.com)... 157.90.223.115, 2a01:4f8:251:1dd0::115
Connecting to files-de.directadmin.com (files-de.directadmin.com)|157.90.223.115|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 7802014 (7.4M) [application/octet-stream]
Saving to: '/usr/local/directadmin/custombuild/roundcubemail-1.5.0.tar.gz'

100%[========================================================================================================>] 7,802,014   27.2MB/s   in 0.3s

2021-11-01 14:21:56 (27.2 MB/s) - '/usr/local/directadmin/custombuild/roundcubemail-1.5.0.tar.gz' saved [7802014/7802014]

Found MySQL version 10.1
Granting access: GRANT SELECT,INSERT,UPDATE,DELETE,CREATE,DROP,ALTER,LOCK TABLES,INDEX,REFERENCES ON da_roundcube.* TO 'da_roundcube'@'localhost';
Setting password: SET PASSWORD FOR 'da_roundcube'@'localhost' = PASSWORD('XXX');
Editing roundcube configuration...
Roundcube 1.5.0 has been installed successfully.
WARNING: Changed defaults (These config options have new default values):
- 'skin'
- 'smtp_port'
- 'smtp_user'
- 'smtp_pass'
- 'jquery_ui_skin_map'
Executing database schema update.
Updating database schema (2020020100)... [OK]
Updating database schema (2020020101)... [FAILED]
ERROR: Error in DDL upgrade 2020020101: [1071] Specified key was too long; max key length is 767 bytes
Reloading apache.
[root@vs050 custombuild]# ./build roundcube
Found MySQL version 10.1
Granting access: GRANT SELECT,INSERT,UPDATE,DELETE,CREATE,DROP,ALTER,LOCK TABLES,INDEX,REFERENCES ON da_roundcube.* TO 'da_roundcube'@'localhost';
Setting password: SET PASSWORD FOR 'da_roundcube'@'localhost' = PASSWORD('XXX');
Editing roundcube configuration...
Roundcube 1.5.0 has been installed successfully.
WARNING: Changed defaults (These config options have new default values):
- 'skin'
- 'smtp_port'
- 'smtp_user'
- 'smtp_pass'
- 'jquery_ui_skin_map'
Executing database schema update.
Updating database schema (2020020101)... [FAILED]
ERROR: Error in DDL upgrade 2020020101: [1091] Can't DROP 'user_id_fk_cache'; check that column/key exists
Reloading apache.

Custombuild: 2.0.0 (rev: 2773)
OS: Centos 7 x64
SQL: MariaDB 10.1
 
Updating database schema (2020020101)... [FAILED] ERROR: Error in DDL upgrade 2020020101: [1091] Can't DROP 'user_id_fk_cache'; check that column/key exists
Spoken many times on this forum, please search before post
 
Hi, I am not sure if this is an bug or not, our Centos 7 an 8 boxes made the upgrade without problems only one Centos6 box gave this error
Because you have Centos 7 this should be not an problem, did you found this post also ?
 
I just now notice that when CB installed RoundCube 1.5 (2021-10-21 03:23) I got many errors in the log:
DB Error: [1146] Table 'da_roundcube.collected_addresses' doesn't exist

I assume this is a new table, unless the update script deleted it?
This error will not go away out of its own.
How would I get the table definition to fix this?

ps: I just now notice this line:
Auto-removal of log files: Every 1 week. To change the setting please edit /usr/local/directadmin/plugins/custombuild/tools/clearlogs.php

I can not look up the errors now as the installations is over 1 weeks ago.

One more detail, as I tried to edit /usr/local/directadmin/plugins/custombuild/tools/clearlogs.php I found out it does not exist. How would I know what it should contain? O wait, I see one here:/usr/local/directadmin/plugins/custombuild/admin/tools/clearlogs.php
For anyone else: the file is located in a different place, see above!

I downloaded https://files-de.directadmin.com/services/custombuild/all/roundcube/roundcubemail-1.5.0.tar.gz and extracted it. Then I searched for the table. Found it in SQL/2020091000.sql
CREATE TABLE `collected_addresses` (
`address_id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT,
`changed` datetime NOT NULL DEFAULT '1000-01-01 00:00:00',
`name` varchar(255) NOT NULL DEFAULT '',
`email` varchar(255) NOT NULL,
`user_id` int(10) UNSIGNED NOT NULL,
`type` int(10) UNSIGNED NOT NULL,
PRIMARY KEY(`address_id`),
CONSTRAINT `user_id_fk_collected_addresses` FOREIGN KEY (`user_id`)
REFERENCES `users`(`user_id`) ON DELETE CASCADE ON UPDATE CASCADE,
UNIQUE INDEX `user_email_collected_addresses_index` (`user_id`, `type`, `email`)
) /*!40000 ENGINE=INNODB */ /*!40101 CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci */;

When I ran it in phpmyadmin (MySql 5.6) I found the problem:
#1071 - Specified key was too long; max key length is 767 bytes
The email field has a size of 255, the maximum length of a utf8mb4 character is four bytes! This will not work.

I am not able to solve this problem. Lowering the character set might work, but I may run into encoding problems then.
Anyone knows a way how to solve this?
(ps: I am not getting complains the from the end users, and I don't use RoundCube myself, maybe we can leave the contacts out).

( I found: This limit has been increased to 3072 bytes In MySQL version 5.7 (and upwards). )
* would upgrading to MySql 5.7 be the only way to solve this problem?
 
Yes, this is an issue between older MySQL/MariaDB versions and the current Roundcube version (so not directly Directadmin-related). You can either stay on Roundcube 1.4.11, upgrade MySQL (to 5.7.7+)/MariaDB (to 10.2.2+) or add the my.cnf entries suggested in the link below:

 
If someone else needs the details .. ..

Yep, that works. Even though I am on an old MariaDB 5.5.41 system on CentOs 7.
What did I do?
edit (nano) /etc/my.cnf.d/server.cnf
[mariadb]
innodb_large_prefix=true
innodb_file_format=Barracuda
innodb_file_per_table = ON

(the [mariadb] section was empty on beforehand)

then
systemctl restart mysqld

Then in phpmyadmni open database da_roundcube and run SQL commands:
SET SESSION innodb_strict_mode=ON;
CREATE TABLE `collected_addresses` (
`address_id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT,
`changed` datetime NOT NULL DEFAULT '1000-01-01 00:00:00',
`name` varchar(255) NOT NULL DEFAULT '',
`email` varchar(255) NOT NULL,
`user_id` int(10) UNSIGNED NOT NULL,
`type` int(10) UNSIGNED NOT NULL,
PRIMARY KEY(`address_id`),
CONSTRAINT `user_id_fk_collected_addresses` FOREIGN KEY (`user_id`) REFERENCES `users`(`user_id`) ON DELETE CASCADE ON UPDATE CASCADE,
UNIQUE INDEX `user_email_collected_addresses_index` (`user_id`, `type`, `email`)
) ENGINE=INNODB CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC;

The table has now been created. I assume Roundcube will start using it from here on.
 
Back
Top