Skip Navigation

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

Problem:
The client is experiencing an 'Internal Server Error' on their website pages when activating WPML or reviewing translated pages. The error log indicates a PHP Fatal error with the message 'Uncaught InvalidArgumentException: Argument ID must be numeric and greater than 0.' This issue is related to the WPML plugin and Elementor page builder.
Solution:
1. We recommend activating the WordPress debug mode by following the steps described in this guide.
2. After enabling debug mode, reproduce the error to generate a new entry in the debug.log file.
3. Review the debug.log file for the latest fatal error message.
4. Apply the workaround provided on the WPML errata page, which can be found here: WPML Errata.
5. Ensure to create a full backup of the site before applying the workaround.

Please note that the solution provided might be outdated or not applicable to your case. If the issue persists, we highly recommend checking related known issues at WPML Known Issues, verifying the version of the permanent fix, and confirming that you have installed the latest versions of themes and plugins. If you still need assistance, 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.

Tagged: 

This topic contains 5 replies, has 3 voices.

Last updated by Carlos Rojas 10 months ago.

Assisted by: Carlos Rojas.

Author Posts
April 17, 2024 at 9:47 am #15530555

anita-kragelundT

I regularly experience that a page (most or all pages of the website) turns into an error page (inspection says id="error page"), sometimes as soon as I activate WPML (sometimes the string translation plugin), and sometimes when I start reviewing my translated pages.
Console says "Get ... / 500 (Internal server error)".

WP and PHP versions are up to date, as are all plugins. Have tried deactivating all other plugins (sofar except Elementor and theme Astra), but that changes nothing.

WP memory limit set at 512, PHP input vars at 10000.

April 17, 2024 at 10:03 am #15530750

Laura
Supporter

Languages: English (English ) Italian (Italiano )

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

Hi,

thanks for contacting us.

It could be a serever related issue. Since there is an internal server error, I would ask you to retrieve the server error log (you can ask your hosting support if you don't know where to find it) and report us the exact error.

April 17, 2024 at 10:27 am #15530991

anita-kragelundT

Where do I send it? (It's LONG)

April 17, 2024 at 11:36 am #15531588

Carlos Rojas
Supporter

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

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

Hello,
My name is Carlos and I will continue working on this ticket

I kindly ask you to follow these steps in order to provide the information about the error:
- Activate the WordPress debug mode by following the steps described in this guide: https://developer.wordpress.org/advanced-administration/debug/debug-wordpress/
- Reproduce the error on the site
- Share the last fatal error that appears in the debug.log file located within the wp-content folder

Looking forward to your message.

April 17, 2024 at 3:16 pm #15533744

anita-kragelundT

According to my hosting provider, the following message appears often:

2024-04-17 15:43:03.985708 [NOTICE] [1021493] [T0] [85.191.205.78:51229-H3:B03E21F4BE4CE03B-764#APVH_www.inropa.com:443] [STDERR] PHP Fatal error: Uncaught InvalidArgumentException: Argument ID must be numeric and greater than 0. in /var/www/www.inropa.com/www/wp-content/plugins/sitepress-multilingual-cms/classes/translations/class-wpml-translation-element.php:29
Stack trace:
#0 /var/www/www.inropa.com/www/wp-content/plugins/sitepress-multilingual-cms/classes/translations/class-wpml-translation-element-factory.php(41): WPML_Translation_Element->__construct()
#1 /var/www/www.inropa.com/www/wp-content/plugins/sitepress-multilingual-cms/addons/wpml-page-builders/classes/Shared/media/class-wpml-page-builders-media-translate.php(89): WPML_Translation_Element_Factory->create_post()
#2 /var/www/www.inropa.com/www/wp-content/plugins/sitepress-multilingual-cms/addons/wpml-page-builders/classes/Shared/media/class-wpml-page-builders-media-translate.php(69): WPML_Page_Builders_Media_Translate->get_translated_attachment()
#3 /var/www/www.inropa.com/www/wp-content/plugins/sitepress-multilingual-cms/addons/wpml-page-builders/classes/Integrations/Elementor/media/modules/abstract/class-wpml-elementor-media-node.php(56): WPML_Page_Builders_Media_Translate->translate_id()
#4 /var/www/www.inropa.com/www/wp-content/plugins/sitepress-multilingual-cms/addons/wpml-page-builders/classes/Integrations/Elementor/media/modules/abstract/class-wpml-elementor-media-node.php(22): WPML_Elementor_Media_Node->translate_image_array()
#5 /var/www/www.inropa.com/www/wp-content/plugins/sitepress-multilingual-cms/addons/wpml-page-builders/classes/Integrations/Elementor/media/modules/AllNodes.php(25): WPML_Elementor_Media_Node->translate_image_property()
#6 /var/www/www.inropa.com/www/wp-content/plugins/sitepress-multilingual-cms/addons/wpml-page-builders/classes/Integrations/Elementor/media/class-wpml-elementor-media-nodes-iterator.php(28): WPML\PB\Elementor\Media\Modules\AllNodes->translate()
#7 /var/www/www.inropa.com/www/wp-content/plugins/sitepress-multilingual-cms/addons/wpml-page-builders/classes/Integrations/Elementor/media/class-wpml-elementor-media-nodes-iterator.php(22)
2024-04-17 15:43:03.985763 [NOTICE] [1021493] [T0] [85.191.205.78:51229-H3:B03E21F4BE4CE03B-764#APVH_www.inropa.com:443] [STDERR] : WPML_Elementor_Media_Nodes_Iterator->translate()
#8 /var/www/www.inropa.com/www/wp-content/plugins/sitepress-multilingual-cms/addons/wpml-page-builders/classes/Integrations/Elementor/media/class-wpml-elementor-media-nodes-iterator.php(22): WPML_Elementor_Media_Nodes_Iterator->translate()
#9 /var/www/www.inropa.com/www/wp-content/plugins/sitepress-multilingual-cms/addons/wpml-page-builders/classes/Integrations/Elementor/media/class-wpml-elementor-media-nodes-iterator.php(22): WPML_Elementor_Media_Nodes_Iterator->translate()
#10 /var/www/www.inropa.com/www/wp-content/plugins/sitepress-multilingual-cms/addons/wpml-page-builders/classes/Shared/media/class-wpml-page-builders-update-media.php(49): WPML_Elementor_Media_Nodes_Iterator->translate()
#11 /var/www/www.inropa.com/www/wp-content/plugins/sitepress-multilingual-cms/addons/wpml-page-builders/classes/Shared/st/class-wpml-pb-integration.php(471): WPML_Page_Builders_Update_Media->translate()
#12 /var/www/www.inropa.com/www/wp-content/plugins/sitepress-multilingual-cms/addons/wpml-page-builders/classes/Shared/Shutdown/Hooks.php(39): WPML_PB_Integration->translate_media()
#13 /var/www/www.inropa.com/www/wp-includes/class-wp-hook.php(324): WPML\PB\Shutdown\Hooks->translateMedias()
#14 /var/www/www.inropa.com/www/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters()
#15 /var/www/www.inropa.com/www/wp-includes/plugin.php(517): WP_Hook->do_action()
#16 /var/www/www.inropa.com/www/wp-includes/load.php(1270): do_action()
#17 [internal function]: shutdown_action_hook()
#18 {main}
thrown in /var/www/www.inropa.com/www/wp-content/plugins/sitepress-multilingual-cms/classes/translations/class-wpml-translation-element.php on line 29

April 17, 2024 at 4:25 pm #15534015

Carlos Rojas
Supporter

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

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

Thank you for your feedback.

Please apply the workaround described in this errata page: https://wpml.org/errata/fatal-error-uncaught-exception-invalidargumentexception-with-message-argument-id-must-be-numeric-and-greater-than-0/ and check if the issue disappeared.

Note: Create a full backup of the site before applying the workaround.

April 20, 2024 at 10:42 am #15545901

anita-kragelundT

The issue seems to have been caused by an automatic translation getting stuck, and I am receiving help for this in another thread.