Skip to content Skip to sidebar

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.

This topic contains 1 reply, has 0 voices.

Last updated by Dražen 7 months, 1 week ago.

Author Posts
June 4, 2025 at 11:24 am #17106090

charlesD-31

Background of the issue:
[Wed Jun 04 11:31:29.227590 2025] [proxy_fcgi:error] [pid 2722242:tid 139851290625792] [client xxx:xxx] AH01071: Got error 'PHP message: WordPress database error Deadlock found when trying to get lock; try restarting transaction for query INSERT IGNORE INTO wp_options ( `option_name`, `option_value`, `autoload` ) VALUES ('wpml.WPML\\TM\\Settings\\ProcessNewTranslatableFields.lock', '1749029489', 'no') /* LOCK */ made by 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, WPML\LIB\WP\Hooks::WPML\LIB\WP\{closure}, WPML\FP\Promise->resolve, WPML\FP\Right->chain, WPML\FP\Right->map, WPML\BackgroundTask\BackgroundTaskLoader->WPML\BackgroundTask\{closure}, WPML\BackgroundTask\BackgroundTaskLoader->getSerializedTasks, WPML\FP\Fns::__callStatic, call_user_func_array, WPML\FP\Fns::WPML\FP\{closure}, call_user_func_array, WPML\FP\Fns::WPML\FP\{closure}, array_map, WPML\BackgroundTask\BackgroundTaskLoader->WPML\BackgroundTask\{closure}, WPML\BackgroundTask\BackgroundTaskViewModel::get, WPML\Utilities\Lock->create, WPML\Uti...', referer: hidden link

We are seeing a lot of these in the error log. When the db deadlock happens, WordPress is inaccessible for 3-4 minutes. We would like to understand what is going on by means of the following questions

1. The referrer is a post.php with action=edit. Does WPML need to launch a background task during a post edit? Can we disable WPML background tasks? What are the implications?

2. It is clear that the contention is happening with the key option_name with value "wpml.WPML\\TM\\Settings\\ProcessNewTranslatableFields.lock" - could you kindly explain what are Translatable Fields in the context of editing a post? Many posts edits are racing for the lock with that key given the INSERT IGNORE will lock the row before update if it already exists.

Thank you,

Reuben

Symptoms:
WordPress database error: Deadlock found when trying to get lock; try restarting transaction. This occurs during a post edit and makes WordPress inaccessible for 3-4 minutes.

Questions:
Does WPML need to launch a background task during a post edit?
Can we disable WPML background tasks? What are the implications?
What are Translatable Fields in the context of editing a post, and why are many post edits racing for the lock with the key 'wpml.WPML\TM\Settings\ProcessNewTranslatableFields.lock'?

June 6, 2025 at 7:51 am #17113108

Dražen
Supporter

Languages: English (English )

Timezone: Europe/Zagreb (GMT+02:00)

Hello,

Thanks for contacting us.

While you wait for my colleague to take over the ticket, let me try to help you with the issue quickly.

This is a known issue, and it was fixed with latest WPML versions.

Go to Plugins > Add New > Commercial > Click “Check for updates" and update WPML plugins to latest versions. (4.7.6)

Please make sure to create a backup, before doing any actions, just in case.

Let us know how it goes and if you still have issues.

Regards,
Drazen

The topic ‘[Closed] Deadlock by WPML BackgroundTask’ is closed to new replies.