Posted: August 22, 2018 at 4:18 am
|
I have recently updated all the EE4 plugins and when I activate the Promotion plugin it gives the following error: Can’t create table ‘XXXXX.XXX.wp_esp_promotion_object’ (errno: -1) I have removed the database name and replaced with XXX. Followed by: This is the info Health Check gives on my site: WordPress Version 4.9.8 Event Espresso is Version 4.9.67.p Any help would be appreciated. |
Hi, Two things: 1) The mysql user that is configured to access the database for your website needs to have the privilege of creating tables in order for the promotions plugin to be set up and function. 2) The Health Check plugin recommends updating the database server to a newer version. You can contact your web host and inquire about both items. |
|
|
Hi Josh, thanks as always for the quick response. I will check permissions and see about upgrading My SQL. |
|
Permissions for the user are all boxes ticked. I have upgraded to MySQL 5.6. When I activate the Promotion plugin I get the same message but suffixed with : wp_esp_promotion_object`’ exists. Please DISCARD the tablespace before IMPORT |
According to It’s advised to do a database backup first and check with the server admin and ask them to check for a locked table and clear that first. |
|
|
Thanks, will take a look at that. |
|
I can’t find any file called wp_esp_promotion_object.idb. Have restarted the db server and still the same. I am not sure if this helps you but under the database error is this: Stack Trace:#0 /home/training/public_html/wp-content/plugins/event-espresso-core-reg/core/helpers/EEH_Activation.helper.php(671): EventEspresso\core\services\database\TableManager->createTable(‘esp_promotion_o…’, ‘POB_ID INT UNSI…’, ‘InnoDB ‘) #1 /home/training/public_html/wp-content/plugins/event-espresso-core-reg/core/data_migration_scripts/EE_Data_Migration_Script_Base.core.php(647): EEH_Activation::create_table(‘esp_promotion_o…’, ‘POB_ID INT UNSI…’, ‘ENGINE=InnoDB ‘, false) #2 /home/training/public_html/wp-content/plugins/event-espresso-core-reg/core/data_migration_scripts/EE_Data_Migration_Script_Base.core.php(553): EE_Data_Migration_Script_Base->_create_table_and_catch_errors(‘esp_promotion_o…’, ‘POB_ID INT UNSI…’, ‘ENGINE=InnoDB ‘, false) #3 /home/training/public_html/wp-content/plugins/eea-promotions/core/data_migration_scripts/EE_DMS_Promotions_1_0_0.dms.php(78): EE_Data_Migration_Script_Base->_table_should_exist_previously(‘esp_promotion_o…’, ‘POB_ID INT UNSI…’, ‘ENGINE=InnoDB ‘) #4 /home/training/public_html/wp-content/plugins/event-espresso-core-reg/core/EE_Addon.core.php(428): EE_DMS_Promotions_1_0_0->schema_changes_before_migration() #5 /home/training/public_html/wp-content/plugins/event-espresso-core-reg/core/EE_Addon.core.php(381): EE_Addon->initialize_db() #6 /home/training/public_html/wp-content/plugins/event-espresso-core-reg/core/EE_System.core.php(590): EE_Addon->initialize_db_if_no_migrations_required() #7 /home/training/public_html/wp-content/plugins/event-espresso-core-reg/core/db_models/EEM_Base.model.php(2527): EE_System->initialize_addons() #8 /home/training/public_html/wp-content/plugins/event-espresso-core-reg/core/db_models/EEM_Base.model.php(2457): EEM_Base->_verify_addons_db(‘get_results’, Array) #9 /home/training/public_html/wp-content/plugins/event-espresso-core-reg/core/db_models/EEM_Base.model.php(2468): EEM_Base->_process_wpdb_query(‘get_results’, Array) #10 /home/training/public_html/wp-content/plugins/event-espresso-core-reg/core/db_models/EEM_Base.model.php(2395): EEM_Base->_process_wpdb_query(‘get_results’, Array) #11 /home/training/public_html/wp-content/plugins/event-espresso-core-reg/core/db_models/EEM_Base.model.php(1080): EEM_Base->_do_wpdb_query(‘get_results’, Array) #12 /home/training/public_html/wp-content/plugins/event-espresso-core-reg/core/db_models/EEM_Base.model.php(954): EEM_Base->_get_all_wpdb_results(Array, ‘ARRAY_A’, NULL) #13 /home/training/public_html/wp-content/plugins/eea-promotions/admin/promotions/Promotions_Admin_List_Table.class.php(278): EEM_Base->get_all(Array) #14 /home/training/public_html/wp-content/plugins/eea-promotions/admin/promotions/Promotions_Admin_List_Table.class.php(26): Promotions_Admin_List_Table->_get_promotions(10) #15 /home/training/public_html/wp-content/plugins/event-espresso-core-reg/core/admin/EE_Admin_List_Table.core.php(212): Promotions_Admin_List_Table->_setup_data() #16 [internal function]: EE_Admin_List_Table->__construct(Object(Promotions_Admin_Page)) #17 /home/training/public_html/wp-content/plugins/event-espresso-core-reg/core/EE_Registry.core.php(1262): ReflectionClass->newInstanceArgs(Array) #18 /home/training/public_html/wp-content/plugins/event-espresso-core-reg/core/EE_Registry.core.php(773): EE_Registry->_create_object(‘Promotions_Admi…’, Array, ”, false) #19 /home/training/public_html/wp-content/plugins/event-espresso-core-reg/core/services/loaders/CoreLoader.php(117): EE_Registry->create(‘Promotions_Admi…’, Array, true, false, false, false) #20 /home/training/public_html/wp-content/plugins/event-espresso-core-reg/core/services/loaders/CachingLoader.php(147): EventEspresso\core\services\loaders\CoreLoader->load(‘Promotions_Admi…’, Array, true) #21 /home/training/public_html/wp-content/plugins/event-espresso-core-reg/core/services/loaders/Loader.php(82): EventEspresso\core\services\loaders\CachingLoader->load(‘Promotions_Admi…’, Array, true) #22 /home/training/public_html/wp-content/plugins/event-espresso-core-reg/core/services/loaders/Loader.php(105): EventEspresso\core\services\loaders\Loader->load(‘Promotions_Admi…’, Array) #23 /home/training/public_html/wp-content/plugins/event-espresso-core-reg/core/admin/EE_Admin_Page.core.php(2145): EventEspresso\core\services\loaders\Loader->getShared(‘Promotions_Admi…’, Array) #24 /home/training/public_html/wp-content/plugins/event-espresso-core-reg/core/admin/EE_Admin_Page.core.php(2096): EE_Admin_Page->_set_list_table_object() #25 /home/training/public_html/wp-content/plugins/event-espresso-core-reg/core/admin/EE_Admin_Page.core.php(676): EE_Admin_Page->_set_list_table() #26 /home/training/public_html/wp-content/plugins/event-espresso-core-reg/core/admin/EE_Admin_Page.core.php(639): EE_Admin_Page->_load_page_dependencies() #27 [internal function]: EE_Admin_Page->load_page_dependencies(”) #28 /home/training/public_html/wp-includes/class-wp-hook.php(286): call_user_func_array(Array, Array) #29 /home/training/public_html/wp-includes/class-wp-hook.php(310): WP_Hook->apply_filters(”, Array) #30 /home/training/public_html/wp-includes/plugin.php(453): WP_Hook->do_action(Array) #31 /home/training/public_html/wp-admin/admin.php(214): do_action(‘load-event-espr…’) #32 {main} |
What do you get if you run |
|
|
I have located the two ibd files that contain promotion but they have no associated frm files. They are wp_esp_promotion_object.ibd and wp_esp_promotion.ibd. I renamed them, restarted the db server and then re activated the plugin and it says: wp_esp_promotion_object`’ already exists Just run your query and it gives a syntax error. By the way I have now upgraded to MySQL 5.7 as I was getting reporting that some of the other plugins were not compatible with 5.6. I double checked on your forums first that EE was OK with 5.7. Also tried disabling all other plugins except EE and that didn’t work. It looks like the promotion plugin is trying to create the .frm files but can’t. |
The promotions plugin doesn’t directly create the form files, that happens at a lower level. Do you have backups of the two promotions tables that can be restored to? |
|
|
Just run your query again, my mistake I had a typo! It now returns I do have backups but it will be of the MySQL 5.5. |
Ideally you could import the backups onto another server and try them out there before importing onto the live server. |
|
|
I will give it a go. This could be a late night! |
|
This is where I am up to: Restored the backup to a temporary database. Copied wp_esp_promotion.ibd to the working database and got an error that the table already exists even though it is not visible in the list of tables. |
I don’t think you’d actually copy .ibd files. Instead you’ll use a tool like phpmyadmin to import the table. |
|
|
That’s what I did. Deleted the files in terminal in WHM first then used phpmyadmin to create a temporary database, imported the backup and then copied one of the promotion tables across to the working database. It gave an error that the table already exists. |
The working database would already have that table though, right? |
|
|
The working database did not show the two promotion tables in PHPMyadmin until I copied the relevant .frm files from the backup. Now I can see the tables and data in the working database in PHPMyadmin but when I run the promotion plugin I get a permissions error. I need to change the owner and permissions of the files I copied from the backup. I am on that now and fingers crossed it will work. |
|
That didn’t work. I changed the ownership and the group of wp_esp_promotion.frm |
You should probably stick with the solutions outlined here: |
|
|
I worked my way through that post and after a lot of trial and error I now have it working. I created a new database, restored data from 3 days ago, deleted the original database and redirected WP to the new one. I had to manually add the existing promo codes but there were only a few that were still active of the 115 on the old system. Checking historical bookings the original discount codes still show on the bookings even though they are not in the Promotions plugin. Thanks for your help. |
The support post ‘Promotion module can't create a table’ is closed to new replies.
Have a question about this support post? Create a new support post in our support forums and include a link to this existing support post so we can help you.