Notifications
Clear all

wpForo 1.x.x [Closed] DB errors

21 Posts
2 Users
1 Reactions
12.7 K Views
Posts: 1602
Topic starter
(@anonymous20)
Noble Member
Joined: 9 years ago

Hello.

I see 3 of those errors (one per update ?)  in my debug.log

[11-Jan-2018 08:22:19 UTC] WordPress database error Specified key was too long; max key length is 767 bytes for query ALTER TABLE `wp_wpforo_subscribes` ADD UNIQUE KEY `fld_group_unq`( `itemid`, `type`, `userid`, `user_email` ) made by require_once('wp-admin/admin.php'), require_once('wp-load.php'), require_once('wp-config.php'), require_once('wp-settings.php'), do_action('wp_loaded'), WP_Hook->do_action, WP_Hook->apply_filters, wpforo_update, wpforo_activation

20 Replies
Robert
Posts: 10591
Admin
(@robert)
Support Team
Joined: 9 years ago

I see the Unique key has not been created for _wpforo_subscription table. Please execute these SQLs to add it:

ALTER TABLE `wp_wpforo_subscribes`
CHANGE COLUMN `user_name` `user_name` VARCHAR(99) NOT NULL DEFAULT '' COLLATE 'utf8mb4_unicode_520_ci' AFTER `active`,
CHANGE COLUMN `user_email` `user_email` VARCHAR(99) NOT NULL DEFAULT '' COLLATE 'utf8mb4_unicode_520_ci' AFTER `user_name`;

ALTER TABLE `wp_wpforo_subscribes` ADD UNIQUE INDEX `itemid_type_user_name_user_email` (`itemid`, `type`, `user_name`, `user_email`);

 

Don't forget to change the wp_ table prefis if your database tables prefix is not wp_ .

Posts: 1602
Topic starter
(@anonymous20)
Noble Member
Joined: 9 years ago

Doing what you suggest, i get:

 

#1062 - Duplicate entry '12-topic--' for key 'itemid_type_user_name_user_email'

 

Posts: 1602
Topic starter
(@anonymous20)
Noble Member
Joined: 9 years ago

Also it seems that if i didn't had the option WP Debug to log, that error would exist but i would never know about it.

I'm pretty sure others also have it and don't know it.

So the question is why this happened in the first place ? I have an extremely stable and controled hosting plan, so hosting is not an issue.

I feel a bit unconfortable with DB errors.

 

Robert
Posts: 10591
Admin
(@robert)
Support Team
Joined: 9 years ago

Just delete all duplicated entries, try as many times as it returns error and delete all duplicated entries. Once all are deleted the SQL will work and problem will be fixed.

Page 1 / 4