Skip Navigation

This thread is resolved. Here is a description of the problem and solution.

Problem:
The client encountered a 'Critical error' on their website while a page was open in the browser. The error was related to the WPML plugin and was caused by a missing auto-increment on a primary key in one of the database tables.
Solution:
We recommend checking the ICL tables manually to ensure that they all have at least one primary key and that they are set to auto-increment. This also applies to the

wp_options

,

wp_post

, and

wp_postmeta

tables, which should all have a primary key with auto-increment. If you're experiencing this issue, please verify these database table configurations.

If this solution doesn't seem relevant to your situation, please open a new support ticket with us.

This is the technical support forum for WPML - the multilingual WordPress plugin.

Everyone can read, but only WPML clients can post here. WPML team is replying on the forum 6 days per week, 22 hours per day.

No supporters are available to work today on this forum. Feel free to create tickets and we will handle it as soon as we are online. Thank you for your understanding.

Tagged: 

This topic contains 13 replies, has 2 voices.

Last updated by Alejandro 3 years, 8 months ago.

Assisted by: Alejandro.

Author Posts
February 17, 2021 at 4:19 pm #8109165

John Hobson

I was just on the site with this page open in the browser: hidden link

and without me actually doing anything (not editing or typing anything) it came up with the 'Critical error' message and wordpress emailed the following stack trace:

Error Details
=============
An error of type E_ERROR was caused in line 29 of the file /home/ecozonec/dev.ecozone.com/wp-content/plugins/sitepress-multilingual-cms/classes/translations/class-wpml-translation-element.php. Error message: Uncaught InvalidArgumentException: Argument ID must be numeric and greater than 0. in /home/ecozonec/dev.ecozone.com/wp-content/plugins/sitepress-multilingual-cms/classes/translations/class-wpml-translation-element.php:29
Stack trace:
#0 /home/ecozonec/dev.ecozone.com/wp-content/plugins/sitepress-multilingual-cms/classes/translations/class-wpml-translation-element-factory.php(41): WPML_Translation_Element->__construct(0, Object(SitePress), NULL)
#1 /home/ecozonec/dev.ecozone.com/wp-content/plugins/sitepress-multilingual-cms/classes/translations/class-wpml-translation-element-factory.php(33): WPML_Translation_Element_Factory->create_post(0)
#2 /home/ecozonec/dev.ecozone.com/wp-content/plugins/wpml-translation-management/classes/words-count/hooks/wpml-tm-word-count-refresh-hooks.php(39): WPML_Translation_Element_Factory->create(0, 'post')
#3 /home/ecozonec/dev.ecozone.com/wp-includes/class-wp-hook.php(289): WPML_TM_Word_Count_Refresh_Hooks->refresh_post_word_count(0)
#4 /home/ecozonec/dev.ecozone.com/wp-include

Just prior to this I turned off the ATE and set it to just use the wordpress editor.

February 18, 2021 at 11:51 am #8117663

Alejandro
Supporter

Languages: English (English ) Spanish (Español ) Italian (Italiano )

Timezone: Europe/Rome (GMT+01:00)

Hi there!

This problem usually involves another plugin or theme. it happens because something else is sending a value that has a different format than the one WPML is expecting. things are working in the background so it seems as if you didn't do anything, because it's an automated action the one causing this problem.

Many times this happens because auto increment is not set to a table in the database and Yoast has lately caused some of these issues because for some reason they don't use this at all (Even though it's kind of considered bad practice to do this).

I'd kindly ask you to contact your hosting or developer and ask them if they can check for you if all the tables have the auto increment feature enabled.

About WPML, you can run this query to make sure all our tables do (they should by default, however):

ALTER TABLE `wp_icl_core_status`
CHANGE `id` `id` bigint(20) NOT NULL AUTO_INCREMENT PRIMARY KEY FIRST;
ALTER TABLE `wp_icl_flags`
CHANGE `id` `id` int(11) NOT NULL AUTO_INCREMENT PRIMARY KEY FIRST;
ALTER TABLE `wp_icl_languages`
CHANGE `id` `id` int(11) NOT NULL AUTO_INCREMENT PRIMARY KEY FIRST;
ALTER TABLE `wp_icl_languages_translations`
CHANGE `id` `id` int(11) NOT NULL AUTO_INCREMENT PRIMARY KEY FIRST;
ALTER TABLE `wp_icl_message_status`
CHANGE `id` `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT PRIMARY KEY FIRST;
ALTER TABLE `wp_icl_mo_files_domains`
CHANGE `id` `id` int(11) NOT NULL AUTO_INCREMENT PRIMARY KEY FIRST;
ALTER TABLE `wp_icl_strings`
CHANGE `id` `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT PRIMARY KEY FIRST;
ALTER TABLE `wp_icl_string_pages`
CHANGE `id` `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT PRIMARY KEY FIRST;
ALTER TABLE `wp_icl_string_positions`
CHANGE `id` `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT PRIMARY KEY FIRST;
ALTER TABLE `wp_icl_string_status`
CHANGE `id` `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT PRIMARY KEY FIRST;
ALTER TABLE `wp_icl_string_translations`
CHANGE `id` `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT PRIMARY KEY FIRST;
ALTER TABLE `wp_icl_string_urls`
CHANGE `id` `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT PRIMARY KEY FIRST;
ALTER TABLE `wp_icl_translate`
CHANGE `tid` `tid` bigint(20) unsigned NOT NULL AUTO_INCREMENT PRIMARY KEY FIRST;
ALTER TABLE `wp_icl_translate_job`
CHANGE `job_id` `job_id` bigint(20) unsigned NOT NULL AUTO_INCREMENT PRIMARY KEY FIRST;
ALTER TABLE `wp_icl_translation_batches`
CHANGE `id` `id` int(11) NOT NULL AUTO_INCREMENT PRIMARY KEY FIRST;
ALTER TABLE `wp_icl_translation_status`
CHANGE `rid` `rid` bigint(20) NOT NULL AUTO_INCREMENT PRIMARY KEY FIRST;

Only do this after a site backup

--------------------

Please keep your debug.log enabled in case this happens again: https://wpml.org/documentation/support/debugging-wpml/

Try to recreate the problem (or wait to see if it happens again) once you have added those lines to your wp-config.php file and then go to your installation's wp-content folder and find the "debug.log" file that should've appeared by now (it will appear if it enocunters an error in your server).

Then, upload that file into a storage platform of your choosing (Google Drive, Dropbox, etc) and send me the link (make sure it's set as "public" otherwise i won't be able to access its content) so i can download it and take a look at it, and determine where to go from there.

Regards.

February 18, 2021 at 12:40 pm #8118313

John Hobson

Thanks Alejandro,

I think this issue has been caused by the previous 'out of memory' issue so that elements of the site are in an abnormal or unexpected state.

That being said I would argue strongly that the WPML code should be defended against such instances so that it can fail gracefully and not with a critical error.

I tried to run the SQL you supplied on the dev site and it errored:

ALTER TABLE `ecz_icl_core_status`
CHANGE `id` `id` BIGINT(20) NOT NULL AUTO_INCREMENT PRIMARY KEY FIRST

MySQL said: Documentation
#1068 - Multiple primary key defined

on checking that table it has 2 indexes, but only one is primary: hidden link

Any ideas?

February 18, 2021 at 2:15 pm #8119399

Alejandro
Supporter

Languages: English (English ) Spanish (Español ) Italian (Italiano )

Timezone: Europe/Rome (GMT+01:00)

Ok, you can remove that query and try again, however if you see this again, then check the ICL tables manually and make sure they all have at least 1 primary key and that they have auto increment, although i doubt the problem is coming from there.

The same goes to wp_options. wp_post and wp_postmeta they should all have a primary key with autoincrement installed.

We are trying to handle these stiuations in a different way, it's just that it's quite difficult because they don't really rely on us entirely.

February 19, 2021 at 11:26 am #8127139

John Hobson

I'm just about to try the database changes but wanted to report this similar error that just occurred:

I was just trying to load hidden link and the page failed to load and I received this error, again pointing to a WPML issue:

Error Details
=============
An error of type E_ERROR was caused in line 29 of the file /home/ecozonec/dev.ecozone.com/wp-content/plugins/sitepress-multilingual-cms/classes/translations/class-wpml-translation-element.php. Error message: Uncaught InvalidArgumentException: Argument ID must be numeric and greater than 0. in /home/ecozonec/dev.ecozone.com/wp-content/plugins/sitepress-multilingual-cms/classes/translations/class-wpml-translation-element.php:29
Stack trace:
#0 /home/ecozonec/dev.ecozone.com/wp-content/plugins/sitepress-multilingual-cms/classes/translations/class-wpml-translation-element-factory.php(41): WPML_Translation_Element->__construct(0, Object(SitePress), NULL)
#1 /home/ecozonec/dev.ecozone.com/wp-content/plugins/sitepress-multilingual-cms/classes/translations/class-wpml-translation-element-factory.php(33): WPML_Translation_Element_Factory->create_post(0)
#2 /home/ecozonec/dev.ecozone.com/wp-content/plugins/wpml-translation-management/classes/words-count/hooks/wpml-tm-word-count-refresh-hooks.php(39): WPML_Translation_Element_Factory->create(0, 'post')
#3 /home/ecozonec/dev.ecozone.com/wp-includes/class-wp-hook.php(289): WPML_TM_Word_Count_Refresh_Hooks->refresh_post_word_count(0)
#4 /home/ecozonec/dev.ecozone.com/wp-include

February 19, 2021 at 11:54 am #8127543

John Hobson

Just ran the database queries on the DEV site - they didn't work as the primary key was already defined so I removed that part from the statements and ran again:

LTER TABLE `ecz_icl_core_status`
CHANGE `id` `id` bigint(20) NOT NULL AUTO_INCREMENT ;
ALTER TABLE `ecz_icl_flags`
CHANGE `id` `id` int(11) NOT NULL AUTO_INCREMENT ;
ALTER TABLE `ecz_icl_languages`
CHANGE `id` `id` int(11) NOT NULL AUTO_INCREMENT ;
ALTER TABLE `ecz_icl_languages_translations`
CHANGE `id` `id` int(11) NOT NULL AUTO_INCREMENT ;
ALTER TABLE `ecz_icl_message_status`
CHANGE `id` `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT ;
ALTER TABLE `ecz_icl_mo_files_domains`
CHANGE `id` `id` int(11) NOT NULL AUTO_INCREMENT ;
ALTER TABLE `ecz_icl_strings`
CHANGE `id` `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT ;
ALTER TABLE `ecz_icl_string_pages`
CHANGE `id` `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT ;
ALTER TABLE `ecz_icl_string_positions`
CHANGE `id` `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT ;
ALTER TABLE `ecz_icl_string_status`
CHANGE `id` `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT ;
ALTER TABLE `ecz_icl_string_translations`
CHANGE `id` `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT ;
ALTER TABLE `ecz_icl_string_urls`
CHANGE `id` `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT ;
ALTER TABLE `ecz_icl_translate`
CHANGE `tid` `tid` bigint(20) unsigned NOT NULL AUTO_INCREMENT ;
ALTER TABLE `ecz_icl_translate_job`
CHANGE `job_id` `job_id` bigint(20) unsigned NOT NULL AUTO_INCREMENT ;
ALTER TABLE `ecz_icl_translation_batches`
CHANGE `id` `id` int(11) NOT NULL AUTO_INCREMENT ;
ALTER TABLE `ecz_icl_translation_status`
CHANGE `rid` `rid` bigint(20) NOT NULL AUTO_INCREMENT ;

Also AUTO_INCREMENT was not previously set for any of the those tables.

February 20, 2021 at 12:24 pm #8134779

Alejandro
Supporter

Languages: English (English ) Spanish (Español ) Italian (Italiano )

Timezone: Europe/Rome (GMT+01:00)

Just out of curiosity (that will help us create better unit tests for this scenario), did you happen to have WPML installed here since version 3.X or before 4.1? i'm asking because these issues should not happen anymore with newest installations.

February 22, 2021 at 10:35 am #8143459

John Hobson

I think it was around August last year that we first experienced issues of this type. The site would have been up to date with whatever the current WPML version was then.

WPML was originally installed on the site around 4 years ago (I think).

Hope that helps!

February 22, 2021 at 1:19 pm #8145149

Alejandro
Supporter

Languages: English (English ) Spanish (Español ) Italian (Italiano )

Timezone: Europe/Rome (GMT+01:00)

let's keep waiting because i do remember when you last came here, but that ticket got closed and i supposed the problem had been gone.

I can only suspect that there is something in the database, a broken entry or something that might not even be used anymore or not that much but that comes up when reading the database, and that makes it crash, but taht would be very difficult to diagnose or even prove since there is always a trigger to these scenarios.

Let's check in the meantime what happens with the other tickets you have opened because i suspect the problem is all connected to them as well.

February 23, 2021 at 5:59 pm #8156643

John Hobson

Yes, I agree. My theory is that the original 'out of memory' issue has caused data in the database to be in an abnormal/unexpected state which is causing the knock-on issues that we're still seeing.

So the challenge is being able to detect what is not in the state that it should, and then to put that right.

I do sense that we are getting closer to a resolution, certainly adding the missing AUTO_INCREMENT has made a difference.

Thanks for your continued help, it's appreciated.

February 24, 2021 at 8:56 am #8160633

Alejandro
Supporter

Languages: English (English ) Spanish (Español ) Italian (Italiano )

Timezone: Europe/Rome (GMT+01:00)

I agree too, itr's tricky when things get interrupted, and if something was executing queries when interrupted, it's likely that might've messed up things. not necessarily out of memory issues alone, but sometimes even small connection issues that sometimes are translated in "longer than usual" waiting times.

However i'll leave this ticket open for another 7 days so you can alwas write here if something happens.

If nothing happens, then you can leave our system close the ticket automatically.

February 25, 2021 at 9:10 am #8170489

John Hobson

So I was just doing some testing on the dev site and created a new product in the primary en-GB site and got a critical error on saving:

Error Details
=============
An error of type E_ERROR was caused in line 193 of the file /home/ecozonec/dev.ecozone.com/wp-content/plugins/wpml-translation-management/classes/records/class-wpml-tm-icl-translations.php. Error message: Uncaught InvalidArgumentException: No translation entry found for query: s:42:" element_id = %d AND element_type LIKE %s ";a:2:{i:0;i:38022;i:1;s:16:"post_mm_product%";} in /home/ecozonec/dev.ecozone.com/wp-content/plugins/wpml-translation-management/classes/records/class-wpml-tm-icl-translations.php:193
Stack trace:
#0 /home/ecozonec/dev.ecozone.com/wp-content/plugins/wpml-translation-management/classes/records/class-wpml-tm-icl-translations.php(59): WPML_TM_ICL_Translations->select_translation_id(' element_id = %...', Array)
#1 /home/ecozonec/dev.ecozone.com/wp-content/plugins/wpml-translation-management/classes/records/class-wpml-tm-icl-translations.php(41): WPML_TM_ICL_Translations->build_from_element_id(Array)
#2 /home/ecozonec/dev.ecozone.com/wp-content/plugins/wpml-translation-management/classes/records/class-wpml-tm-records.php(143): WPML_TM_ICL_Translations->__construct(Object(WPML_TM_Records), Array, 'id_type_prefix')
#3 /home/ecozonec/dev.ecozone.com/wp-content/plugins/wpml-translation-management/i

Now when I go to look at the list of products they don't display:

hidden link

Here's the full stack trace:

[25-Feb-2021 08:55:52 UTC] PHP Fatal error:  Uncaught InvalidArgumentException: No translation entry found for query: s:42:" element_id = %d AND element_type LIKE %s ";a:2:{i:0;i:38022;i:1;s:16:"post_mm_product%";} in /home/ecozonec/dev.ecozone.com/wp-content/plugins/wpml-translation-management/classes/records/class-wpml-tm-icl-translations.php:193
Stack trace:
#0 /home/ecozonec/dev.ecozone.com/wp-content/plugins/wpml-translation-management/classes/records/class-wpml-tm-icl-translations.php(59): WPML_TM_ICL_Translations->select_translation_id(' element_id = %...', Array)
#1 /home/ecozonec/dev.ecozone.com/wp-content/plugins/wpml-translation-management/classes/records/class-wpml-tm-icl-translations.php(41): WPML_TM_ICL_Translations->build_from_element_id(Array)
#2 /home/ecozonec/dev.ecozone.com/wp-content/plugins/wpml-translation-management/classes/records/class-wpml-tm-records.php(143): WPML_TM_ICL_Translations->__construct(Object(WPML_TM_Records), Array, 'id_type_prefix')
#3 /home/ecozonec/dev.ecozone.com/wp-content/plugins/wpml-translation-management/i in /home/ecozonec/dev.ecozone.com/wp-content/plugins/wpml-translation-management/classes/records/class-wpml-tm-icl-translations.php on line 193
[25-Feb-2021 08:56:07 UTC] WordPress database error Duplicate entry '0' for key 'PRIMARY' for query INSERT INTO `ecz_icl_translations` (`element_type`, `language_code`, `source_language_code`, `trid`, `element_id`) VALUES ('post_mm_product', 'en', 'en', '23651', '38022') made by do_action('wp_ajax_heartbeat'), WP_Hook->do_action, WP_Hook->apply_filters, wp_ajax_heartbeat, apply_filters('heartbeat_received'), WP_Hook->apply_filters, heartbeat_autosave, wp_autosave, edit_post, wp_update_post, wp_insert_post, do_action('save_post'), WP_Hook->do_action, WP_Hook->apply_filters, WPML_Admin_Post_Actions->save_post_actions, WPML_Post_Translation->after_save_post, WPML_Post_Translation->maybe_set_elid, SitePress->set_element_language_details, WPML_Set_Language->set, WPML_Set_Language->insert_new_row
[25-Feb-2021 08:56:07 UTC] PHP Fatal error:  Uncaught InvalidArgumentException: No translation entry found for query: s:42:" element_id = %d AND element_type LIKE %s ";a:2:{i:0;i:38022;i:1;s:16:"post_mm_product%";} in /home/ecozonec/dev.ecozone.com/wp-content/plugins/wpml-translation-management/classes/records/class-wpml-tm-icl-translations.php:193
Stack trace:
#0 /home/ecozonec/dev.ecozone.com/wp-content/plugins/wpml-translation-management/classes/records/class-wpml-tm-icl-translations.php(59): WPML_TM_ICL_Translations->select_translation_id(' element_id = %...', Array)
#1 /home/ecozonec/dev.ecozone.com/wp-content/plugins/wpml-translation-management/classes/records/class-wpml-tm-icl-translations.php(41): WPML_TM_ICL_Translations->build_from_element_id(Array)
#2 /home/ecozonec/dev.ecozone.com/wp-content/plugins/wpml-translation-management/classes/records/class-wpml-tm-records.php(143): WPML_TM_ICL_Translations->__construct(Object(WPML_TM_Records), Array, 'id_type_prefix')
#3 /home/ecozonec/dev.ecozone.com/wp-content/plugins/wpml-translation-management/i in /home/ecozonec/dev.ecozone.com/wp-content/plugins/wpml-translation-management/classes/records/class-wpml-tm-icl-translations.php on line 193
[25-Feb-2021 08:56:22 UTC] WordPress database error Duplicate entry '0' for key 'PRIMARY' for query INSERT INTO `ecz_icl_translations` (`element_type`, `language_code`, `source_language_code`, `trid`, `element_id`) VALUES ('post_mm_product', 'en', 'en', '23651', '38022') made by do_action('wp_ajax_heartbeat'), WP_Hook->do_action, WP_Hook->apply_filters, wp_ajax_heartbeat, apply_filters('heartbeat_received'), WP_Hook->apply_filters, heartbeat_autosave, wp_autosave, edit_post, wp_update_post, wp_insert_post, do_action('save_post'), WP_Hook->do_action, WP_Hook->apply_filters, WPML_Admin_Post_Actions->save_post_actions, WPML_Post_Translation->after_save_post, WPML_Post_Translation->maybe_set_elid, SitePress->set_element_language_details, WPML_Set_Language->set, WPML_Set_Language->insert_new_row
[25-Feb-2021 08:56:22 UTC] PHP Fatal error:  Uncaught InvalidArgumentException: No translation entry found for query: s:42:" element_id = %d AND element_type LIKE %s ";a:2:{i:0;i:38022;i:1;s:16:"post_mm_product%";} in /home/ecozonec/dev.ecozone.com/wp-content/plugins/wpml-translation-management/classes/records/class-wpml-tm-icl-translations.php:193
Stack trace:
#0 /home/ecozonec/dev.ecozone.com/wp-content/plugins/wpml-translation-management/classes/records/class-wpml-tm-icl-translations.php(59): WPML_TM_ICL_Translations->select_translation_id(' element_id = %...', Array)
#1 /home/ecozonec/dev.ecozone.com/wp-content/plugins/wpml-translation-management/classes/records/class-wpml-tm-icl-translations.php(41): WPML_TM_ICL_Translations->build_from_element_id(Array)
#2 /home/ecozonec/dev.ecozone.com/wp-content/plugins/wpml-translation-management/classes/records/class-wpml-tm-records.php(143): WPML_TM_ICL_Translations->__construct(Object(WPML_TM_Records), Array, 'id_type_prefix')
#3 /home/ecozonec/dev.ecozone.com/wp-content/plugins/wpml-translation-management/i in /home/ecozonec/dev.ecozone.com/wp-content/plugins/wpml-translation-management/classes/records/class-wpml-tm-icl-translations.php on line 193
[25-Feb-2021 08:56:37 UTC] WordPress database error Duplicate entry '0' for key 'PRIMARY' for query INSERT INTO `ecz_icl_translations` (`element_type`, `language_code`, `source_language_code`, `trid`, `element_id`) VALUES ('post_mm_product', 'en', 'en', '23651', '38022') made by do_action('wp_ajax_heartbeat'), WP_Hook->do_action, WP_Hook->apply_filters, wp_ajax_heartbeat, apply_filters('heartbeat_received'), WP_Hook->apply_filters, heartbeat_autosave, wp_autosave, edit_post, wp_update_post, wp_insert_post, do_action('save_post'), WP_Hook->do_action, WP_Hook->apply_filters, WPML_Admin_Post_Actions->save_post_actions, WPML_Post_Translation->after_save_post, WPML_Post_Translation->maybe_set_elid, SitePress->set_element_language_details, WPML_Set_Language->set, WPML_Set_Language->insert_new_row
[25-Feb-2021 08:56:37 UTC] PHP Fatal error:  Uncaught InvalidArgumentException: No translation entry found for query: s:42:" element_id = %d AND element_type LIKE %s ";a:2:{i:0;i:38022;i:1;s:16:"post_mm_product%";} in /home/ecozonec/dev.ecozone.com/wp-content/plugins/wpml-translation-management/classes/records/class-wpml-tm-icl-translations.php:193
Stack trace:
#0 /home/ecozonec/dev.ecozone.com/wp-content/plugins/wpml-translation-management/classes/records/class-wpml-tm-icl-translations.php(59): WPML_TM_ICL_Translations->select_translation_id(' element_id = %...', Array)
#1 /home/ecozonec/dev.ecozone.com/wp-content/plugins/wpml-translation-management/classes/records/class-wpml-tm-icl-translations.php(41): WPML_TM_ICL_Translations->build_from_element_id(Array)
#2 /home/ecozonec/dev.ecozone.com/wp-content/plugins/wpml-translation-management/classes/records/class-wpml-tm-records.php(143): WPML_TM_ICL_Translations->__construct(Object(WPML_TM_Records), Array, 'id_type_prefix')
#3 /home/ecozonec/dev.ecozone.com/wp-content/plugins/wpml-translation-management/i in /home/ecozonec/dev.ecozone.com/wp-content/plugins/wpml-translation-management/classes/records/class-wpml-tm-icl-translations.php on line 193
[25-Feb-2021 08:56:51 UTC] WordPress database error Duplicate entry '0' for key 'PRIMARY' for query INSERT INTO `ecz_icl_translations` (`element_type`, `language_code`, `source_language_code`, `trid`, `element_id`) VALUES ('post_mm_product', 'en', 'en', '23651', '38022') made by edit_post, wp_update_post, wp_insert_post, do_action('save_post'), WP_Hook->do_action, WP_Hook->apply_filters, WPML_Admin_Post_Actions->save_post_actions, WPML_Post_Translation->after_save_post, WPML_Post_Translation->maybe_set_elid, SitePress->set_element_language_details, WPML_Set_Language->set, WPML_Set_Language->insert_new_row
[25-Feb-2021 08:56:51 UTC] PHP Fatal error:  Uncaught InvalidArgumentException: No translation entry found for query: s:42:" element_id = %d AND element_type LIKE %s ";a:2:{i:0;i:38022;i:1;s:16:"post_mm_product%";} in /home/ecozonec/dev.ecozone.com/wp-content/plugins/wpml-translation-management/classes/records/class-wpml-tm-icl-translations.php:193
Stack trace:
#0 /home/ecozonec/dev.ecozone.com/wp-content/plugins/wpml-translation-management/classes/records/class-wpml-tm-icl-translations.php(59): WPML_TM_ICL_Translations->select_translation_id(' element_id = %...', Array)
#1 /home/ecozonec/dev.ecozone.com/wp-content/plugins/wpml-translation-management/classes/records/class-wpml-tm-icl-translations.php(41): WPML_TM_ICL_Translations->build_from_element_id(Array)
#2 /home/ecozonec/dev.ecozone.com/wp-content/plugins/wpml-translation-management/classes/records/class-wpml-tm-records.php(143): WPML_TM_ICL_Translations->__construct(Object(WPML_TM_Records), Array, 'id_type_prefix')
#3 /home/ecozonec/dev.ecozone.com/wp-content/plugins/wpml-translation-management/i in /home/ecozonec/dev.ecozone.com/wp-content/plugins/wpml-translation-management/classes/records/class-wpml-tm-icl-translations.php on line 193
[25-Feb-2021 09:00:02 UTC] PHP Fatal error:  Uncaught InvalidArgumentException: No translation entry found for query: s:42:" element_id = %d AND element_type LIKE %s ";a:2:{i:0;s:5:"38022";i:1;s:5:"post%";} in /home/ecozonec/dev.ecozone.com/wp-content/plugins/wpml-translation-management/classes/records/class-wpml-tm-icl-translations.php:193
Stack trace:
#0 /home/ecozonec/dev.ecozone.com/wp-content/plugins/wpml-translation-management/classes/records/class-wpml-tm-icl-translations.php(59): WPML_TM_ICL_Translations->select_translation_id(' element_id = %...', Array)
#1 /home/ecozonec/dev.ecozone.com/wp-content/plugins/wpml-translation-management/classes/records/class-wpml-tm-icl-translations.php(41): WPML_TM_ICL_Translations->build_from_element_id(Array)
#2 /home/ecozonec/dev.ecozone.com/wp-content/plugins/wpml-translation-management/classes/records/class-wpml-tm-records.php(143): WPML_TM_ICL_Translations->__construct(Object(WPML_TM_Records), Array, 'id_type_prefix')
#3 /home/ecozonec/dev.ecozone.com/wp-content/plugins/wpml-translation-management/classes/f in /home/ecozonec/dev.ecozone.com/wp-content/plugins/wpml-translation-management/classes/records/class-wpml-tm-icl-translations.php on line 193
[25-Feb-2021 09:00:07 UTC] PHP Fatal error:  Uncaught InvalidArgumentException: No translation entry found for query: s:42:" element_id = %d AND element_type LIKE %s ";a:2:{i:0;s:5:"38022";i:1;s:5:"post%";} in /home/ecozonec/dev.ecozone.com/wp-content/plugins/wpml-translation-management/classes/records/class-wpml-tm-icl-translations.php:193
Stack trace:
#0 /home/ecozonec/dev.ecozone.com/wp-content/plugins/wpml-translation-management/classes/records/class-wpml-tm-icl-translations.php(59): WPML_TM_ICL_Translations->select_translation_id(' element_id = %...', Array)
#1 /home/ecozonec/dev.ecozone.com/wp-content/plugins/wpml-translation-management/classes/records/class-wpml-tm-icl-translations.php(41): WPML_TM_ICL_Translations->build_from_element_id(Array)
#2 /home/ecozonec/dev.ecozone.com/wp-content/plugins/wpml-translation-management/classes/records/class-wpml-tm-records.php(143): WPML_TM_ICL_Translations->__construct(Object(WPML_TM_Records), Array, 'id_type_prefix')
#3 /home/ecozonec/dev.ecozone.com/wp-content/plugins/wpml-translation-management/classes/f in /home/ecozonec/dev.ecozone.com/wp-content/plugins/wpml-translation-management/classes/records/class-wpml-tm-icl-translations.php on line 193
February 25, 2021 at 9:18 am #8170687

John Hobson

OK, have just resolved this one myself - there was a missing auto-increment from this table. When I add the auto-increment on the primary key it works.

February 25, 2021 at 9:57 am #8170983

Alejandro
Supporter

Languages: English (English ) Spanish (Español ) Italian (Italiano )

Timezone: Europe/Rome (GMT+01:00)

Oh good!

I think at this time, the problem did come from the missing auto increment feature in some tables.