Skip Navigation

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.

Sun Mon Tue Wed Thu Fri Sat
- 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 -
- 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 -

Supporter timezone: Asia/Ho_Chi_Minh (GMT+07:00)

This topic contains 4 replies, has 2 voices.

Last updated by Long Nguyen 1 year, 6 months ago.

Assisted by: Long Nguyen.

Author Posts
July 20, 2023 at 1:04 pm #14072563

brunoF-29

I am trying to:
Access Widgets page

I expected to see:
The widget page.

Instead, I got:
A request timeout after 2 minutes

Following this ticket by Yvette (https://wpml.org/forums/topic/wpml-is-missing-some-records-in-the-language-tables/) we tried to access the widgets page but it keeps timing out... apparently and so far is the only page we can't access.

We checked the error log and this was there:

[code]
WordPress database error Illegal mix of collations for operation 'UNION' for query (
SELECT
translation_status.rid AS id, 'post' AS type, translation_status.tp_id AS tp_id, batches.id AS local_batch_id, batches.tp_id AS tp_batch_id, batches.batch_name, translation_status.status AS status, original_translations.element_id AS original_element_id, translations.source_language_code AS source_language, translations.language_code AS target_language, translations.trid, translations.element_type, translations.element_id, translation_status.translation_service AS translation_service, translation_status.timestamp AS sent_date, translate_job.deadline_date AS deadline_date, translate_job.completed_date AS completed_date, posts.post_title AS title, source_languages.english_name AS source_language_name, target_languages.english_name AS target_language_name, translate_job.translator_id AS translator_id, translate_job.job_id AS translate_job_id, translation_status.tp_revision AS revision, translation_status.ts_status AS ts_status, translation_status.needs_update AS needs_update, translate_job.editor AS editor, (
SELECT COUNT(job_id)
FROM wp_icl_translate_job as copmpleted_translation_job
WHERE copmpleted_translation_job.rid = translation_status.rid AND copmpleted_translation_job.translated = 1
) > 0 AS has_completed_translation, translate_job.editor_job_id AS editor_job_id, translate_job.automatic AS automatic, translate_job.title AS job_title, translation_status.review_status AS review_status
FROM wp_icl_translation_status translation_status
INNER JOIN wp_icl_translations translations
ON translations.translation_id = translation_status.translation_id INNER JOIN wp_icl_translations original_translations
ON original_translations.trid = translations.trid AND original_translations.language_code = translations.source_language_code INNER JOIN (
SELECT *
FROM wp_icl_translate_job as translate_job
WHERE job_id = (
SELECT MAX(job_id) AS job_id
FROM wp_icl_translate_job as sub_translate_job
WHERE sub_translate_job.rid = translate_job.rid
)
) AS translate_job ON translate_job.rid = translation_status.rid INNER JOIN wp_posts posts ON posts.ID = original_translations.element_id LEFT JOIN wp_icl_languages source_languages
ON source_languages.code = translations.source_language_code LEFT JOIN wp_icl_languages target_languages
ON target_languages.code = translations.language_code INNER JOIN wp_icl_translation_batches batches
ON batches.id = translation_status.batch_id WHERE original_translations.element_type LIKE 'post%' AND translation_status.status IN (1,2) AND translation_status.translation_service = 'local' AND translation_status.status != '42' ) UNION (
SELECT
translation_status.rid AS id, 'package' AS type, translation_status.tp_id AS tp_id, batches.id AS local_batch_id, batches.tp_id AS tp_batch_id, batches.batch_name, translation_status.status AS status, original_translations.element_id AS original_element_id, translations.source_language_code AS source_language, translations.language_code AS target_language, translations.trid, translations.element_type, translations.element_id, translation_status.translation_service AS translation_service, translation_status.timestamp AS sent_date, translate_job.deadline_date AS deadline_date, translate_job.completed_date AS completed_date, string_packages.title AS title, source_languages.english_name AS source_language_name, target_languages.english_name AS target_language_name, translate_job.translator_id AS translator_id, translate_job.job_id AS translate_job_id, translation_status.tp_revision AS revision, translation_status.ts_status AS ts_status, translation_status.needs_update AS needs_update, translate_job.editor AS editor, (
SELECT COUNT(job_id)
FROM wp_icl_translate_job as copmpleted_translation_job
WHERE copmpleted_translation_job.rid = translation_status.rid AND copmpleted_translation_job.translated = 1
) > 0 AS has_completed_translation, translate_job.editor_job_id AS editor_job_id, translate_job.automatic AS automatic, translate_job.title AS job_title, translation_status.review_status AS review_status
FROM wp_icl_translation_status translation_status
INNER JOIN wp_icl_translations translations
ON translations.translation_id = translation_status.translation_id INNER JOIN wp_icl_translations original_translations
ON original_translations.trid = translations.trid AND original_translations.language_code = translations.source_language_code INNER JOIN (
SELECT *
FROM wp_icl_translate_job as translate_job
WHERE job_id = (
SELECT MAX(job_id) AS job_id
FROM wp_icl_translate_job as sub_translate_job
WHERE sub_translate_job.rid = translate_job.rid
)
) AS translate_job ON translate_job.rid = translation_status.rid INNER JOIN wp_icl_string_packages string_packages
ON string_packages.ID = original_translations.element_id LEFT JOIN wp_icl_languages source_languages
ON source_languages.code = translations.source_language_code LEFT JOIN wp_icl_languages target_languages
ON target_languages.code = translations.language_code INNER JOIN wp_icl_translation_batches batches
ON batches.id = translation_status.batch_id WHERE original_translations.element_type LIKE 'package%' AND translation_status.status IN (1,2) AND translation_status.translation_service = 'local' AND translation_status.status != '42' ) UNION (
SELECT
translation_status.rid AS id, 'st-batch_strings' AS type, translation_status.tp_id AS tp_id, batches.id AS local_batch_id, batches.tp_id AS tp_batch_id, batches.batch_name, translation_status.status AS status, original_translations.element_id AS original_element_id, translations.source_language_code AS source_language, translations.language_code AS target_language, translations.trid, translations.element_type, translations.element_id, translation_status.translation_service AS translation_service, translation_status.timestamp AS sent_date, translate_job.deadline_date AS deadline_date, translate_job.completed_date AS completed_date, translation_batches.batch_name AS title, source_languages.english_name AS source_language_name, target_languages.english_name AS target_language_name, translate_job.translator_id AS translator_id, translate_job.job_id AS translate_job_id, translation_status.tp_revision AS revision, translation_status.ts_status AS ts_status, translation_status.needs_update AS needs_update, translate_job.editor AS editor, (
SELECT COUNT(job_id)
FROM wp_icl_translate_job as copmpleted_translation_job
WHERE copmpleted_translation_job.rid = translation_status.rid AND copmpleted_translation_job.translated = 1
) > 0 AS has_completed_translation, translate_job.editor_job_id AS editor_job_id, translate_job.automatic AS automatic, translate_job.title AS job_title, translation_status.review_status AS review_status
FROM wp_icl_translation_status translation_status
INNER JOIN wp_icl_translations translations
ON translations.translation_id = translation_status.translation_id INNER JOIN wp_icl_translations original_translations
ON original_translations.trid = translations.trid AND original_translations.language_code = translations.source_language_code INNER JOIN (
SELECT *
FROM wp_icl_translate_job as translate_job
WHERE job_id = (
SELECT MAX(job_id) AS job_id
FROM wp_icl_translate_job as sub_translate_job
WHERE sub_translate_job.rid = translate_job.rid
)
) AS translate_job ON translate_job.rid = translation_status.rid INNER JOIN wp_icl_translation_batches translation_batches ON translation_batches.id = original_translations.element_id LEFT JOIN wp_icl_languages source_languages
ON source_languages.code = translations.source_language_code LEFT JOIN wp_icl_languages target_languages
ON target_languages.code = translations.language_code INNER JOIN wp_icl_translation_batches batches
ON batches.id = translation_status.batch_id WHERE original_translations.element_type = 'st-batch_strings' AND translation_status.status IN (1,2) AND translation_status.translation_service = 'local' AND translation_status.status != '42' ) made by require('wp-blog-header.php'), wp, WP->main, WP->parse_request, do_action_ref_array('parse_request'), WP_Hook->do_action, WP_Hook->apply_filters, rest_api_loaded, WP_REST_Server->serve_request, WP_REST_Server->dispatch, WP_REST_Server->respond_to_request, WPML\TM\ATE\REST\Sync->sync, WPML\TM\ATE\Sync\Process->run, WPML\TM\ATE\Sync\Process->runSyncInit, WPML\TM\ATE\Sync\Process->getAteJobIdsToSync, WPML_TM_ATE_Job_Repository->get_jobs_to_sync, WPML_TM_Jobs_Repository->get
[/code]

so we installed and activated the plugin WordPress fix collation as we searched for the problem and saw that a supporter recommended to solve that issue.
But the timeout still persists and the error log now shows:

[code]
WordPress database error Commands out of sync; you can't run this command now for query SELECT element_id, language_code
FROM wp_icl_translations
WHERE trid =
(SELECT trid
FROM wp_icl_translations
WHERE element_type = 'post_page'
AND element_id = (SELECT option_value
FROM wp_options
WHERE option_name='page_for_posts'
LIMIT 1))
made by shutdown_action_hook, do_action('shutdown'), WP_Hook->do_action, WP_Hook->apply_filters, LiteSpeed\Core->send_headers, LiteSpeed\Control->finalize, LiteSpeed\Metabox->setting, get_option, apply_filters('pre_option_page_for_posts'), WP_Hook->apply_filters, SitePress->pre_option_page_for_posts, WPML_Pre_Option_Page->get

[/code]

We deactivated Liitespeed cache plugin since it was mentioned in the errors and we can access the widget page but it loads incredibly SLOW (more than 1 minute). The site is on a powerful VPS and its not certainly memory issues, and we need the cache plugin activated.

Note: We purged all cache without success. If we deactivate WPML the widgets page loads in 2s without any issue.

July 21, 2023 at 8:57 am #14077269

Long Nguyen
Supporter

Languages: English (English )

Timezone: Asia/Ho_Chi_Minh (GMT+07:00)

Hi Bruno,

Thank you for contacting WPML support, I'd be happy to help you with this issue.

I would like to request temporary access (wp-admin and FTP) to your site to take a better look at the issue. It would be better to a testing site where the issue is replicated. Your next reply is set to private to share the info.

❌ IMPORTANT: Please backup your database and website before proceeding ❌
You can use this plugin to create the backup: 
https://wordpress.org/plugins/duplicator/
✙ I would need your permission to de-activate and re-activate Plugins and the Theme and to change configurations on the site if needed. This is also a reason the backup is critical.

Look forward to your reply.
Thanks

July 22, 2023 at 4:07 pm #14083559

Long Nguyen
Supporter

Languages: English (English )

Timezone: Asia/Ho_Chi_Minh (GMT+07:00)

Hi,

After I login to your site and visit the Widgets page, I do not see any issues, no errors in the log related to "Commands out of sync". Please check this screenshot hidden link

There was a notice about the issue with string translation and I just click on the X icon at the top-left of the notice area and everything is working properly.

Can you please recheck your site or am I missing something?

Look forward to your reply.
Thanks

July 23, 2023 at 12:47 pm #14084649

brunoF-29

Hi Long,

Thank you for your time.
Well that is strange because I just access the site we gave you and despite the error didn't show up in dashboard I cannot still access the widget area. It takes too long and ends up with the message of timeout.

So I went and logged in with the user we created for you and still had the same issue.

We do have an error message on our main site in admin dashboard (don't know why it disappeared just like that) that is the following:

WordPress database error: The query could not be executed because it contains invalid data.

Array
(
[language] => pt-pt
[context] => gutenberg-214831
[gettext_context] =>
[domain_name_context_md5] => d1c296cc7d41d35d9a749774467db097
[name] => 3eb26083e1735343c567f96d4254bd5e
[value] => Edições
[status] => 0
[translation_priority] => optional
[allow_empty_value] =>
)

Would it be any related to this?

Could you please try again to access the widgets area and see if the problem persists on your side?

thanks once again.

EDIT: I now know why you can access the widget area. If you change to the English language in wp-admin bar I can access widget area like you do... but if I change to the Portuguese language I cannot. Its perhaps related to the error mentioned above?

July 24, 2023 at 4:07 am #14085407

Long Nguyen
Supporter

Languages: English (English )

Timezone: Asia/Ho_Chi_Minh (GMT+07:00)

Hi,

Regarding the "WordPress database error: The query could not be executed because it contains invalid data.", the error could be a false positive. Could you please close the message via the (x) icon in the top right corner? After that, please check if the banner will appear again.

Regarding the slow loading on the Widgets page, I try to enable a minimal environment as below:
- deactivate all non-WPML plugins
- switch to a standard theme of WordPress
and do not see that issue. Then I switch to your current theme (Bimber) and see it will query to get a list of 24k terms (post tags) on your site in the default language Portuguese for the widget Bimber Posts and causes this issue. We can also understand when this page loads fast in the English language because there are 5 tags in English.
Please check this screenshot hidden link

So I try to disable this widget in the theme file /wp-content/themes/bimber/includes/widgets/widgets.php line 21 and the Widgets page loads properly.

// register_widget( 'Bimber_Widget_Posts' );

The theme "Bimber" is not in the list of compatible themes, which you can check here https://wpml.org/theme/
I suggest you contact the theme author and ask them to join our Go Global program where our Compatibility developers will help them to make their product compatible with WPML.
https://wpml.org/documentation/support/go-global-program/

Look forward to your reply.
Thanks

The topic ‘[Closed] WordPress database error Commands out of sync’ is closed to new replies.