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.

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

Supporter timezone: Europe/Zagreb (GMT+02:00)

Tagged: 

This topic contains 20 replies, has 2 voices.

Last updated by Bruno Kos 1 year, 9 months ago.

Assisted by: Bruno Kos.

Author Posts
July 26, 2023 at 10:44 pm #14107089

ianC-25

I am having the same issue as this ticket that was closed unresolved - https://wpml.org/forums/topic/504-gateway-timeout-when-trying-to-sync-an-acf-field-update/

When doing a sync with a large large, I get a 504 error. When I disable the ACFML plugin I do not get the error. When I disable it the import takes a couple seconds and completes successfully.

I am also sending a bug report to ACF, but was hoping someone here knows a solution.

July 27, 2023 at 2:01 pm #14111533

Bruno Kos
WPML Supporter since 12/2018

Languages: English (English ) German (Deutsch ) French (Français )

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

Hi,

Can you try this:

1. Edit wp-config.php and insert the following lines (just before /* That's all, stop editing! Happy publishing. */ part)

define( 'WP_DEBUG', true);
define( 'WP_DEBUG_LOG', true);
define( 'WP_DEBUG_DISPLAY', false);

2. Reproduce the issue

3. Locate the debug log in: /wp-content/debug.log

4. Paste the latest lines here. No need to paste the entire log file, just 10 lines or so will do. Please censor any sensitive information.

https://codex.wordpress.org/Debugging_in_WordPress

But more importantly we need this:

- do the above reproducing (so from step 2)
- get the latest server debug logs (you can ask hosting support if unsure how to locate them)

Let us know how it goes or if you need further information!

Regards,
Bruno Kos

July 31, 2023 at 6:48 pm #14129217

ianC-25

2023/07/31 18:44:46 [error] 2428#2428: *59335 upstream timed out (110: Unknown error) while reading response header from upstream, client: 10.10.12.173, server: staging.metergroup.com, request: "GET /wp/wp-admin/edit.php?post_type=acf-field-group&acfsync=group_63890e4a3df8e&_wpnonce=100a5a889c HTTP/2.0", upstream: "hidden link", host: "staging.metergroup.com", referrer: "hidden link"

August 1, 2023 at 6:37 am #14130527

Bruno Kos
WPML Supporter since 12/2018

Languages: English (English ) German (Deutsch ) French (Français )

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

I see, can you tell me if there is website available for us to check or only in the localhost? Or if you can provide us with Duplicator package so we could debug this?

August 2, 2023 at 6:24 am #14139071

Bruno Kos
WPML Supporter since 12/2018

Languages: English (English ) German (Deutsch ) French (Français )

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

Can you also tell me where in the backend can I see the issue? How do I reproduce it? You can send me even screenshot only if I only need to click somewhere.

August 2, 2023 at 5:26 pm #14144053

ianC-25

If you go into an ACF and do a local import json on Page Blocks you will run into the issue. If you disable the plugin ACF WPML plugin then it will work fine. The issue may be the ACF plugin and I may need to contact them instead. Let me know if you need a new json file in order to see the import option

August 3, 2023 at 6:41 am #14145827

Bruno Kos
WPML Supporter since 12/2018

Languages: English (English ) German (Deutsch ) French (Français )

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

So to confirm, what I need to do is to export Page Blocks Field Group from this interface and only try to upload the same JSON file back?

export and then import.jpg
August 7, 2023 at 9:58 pm #14166243

ianC-25

Yes, try doing an export, then edit a json field, then go back to the ACF groups - /wp-admin/edit.php?post_type=acf-field-group and you should see a Sync Available inside the group you edited

August 7, 2023 at 9:59 pm #14166245

ianC-25

updated comment below

August 8, 2023 at 2:05 pm #14169789

Bruno Kos
WPML Supporter since 12/2018

Languages: English (English ) German (Deutsch ) French (Français )

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

I don't see Sync Available inside the group, but I see this:
hidden link

But this import of edited file took several minutes, I paused the recording. I think that in most hosting environments it would hit the timeout.

If I disable ACFML, it goes quickly, this import takes several seconds only.

I can report this issue to our 2nd tier for further checks if this is what you are reporting?

August 9, 2023 at 4:45 pm #14177565

ianC-25

Yes, that's the bug I am experiencing as well

August 9, 2023 at 4:46 pm #14177567

ianC-25

Yes, that's the bug I am experiencing as well. I experienced the issue using the sync feature, but I'm going to assume it is the same issue.

August 10, 2023 at 8:26 am #14180155

Bruno Kos
WPML Supporter since 12/2018

Languages: English (English ) German (Deutsch ) French (Français )

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

This is escalated to our 2nd tier team and may take some debugging time, I'll get back to you as soon as I have any news or questions for you.

August 10, 2023 at 2:54 pm #14183669

Bruno Kos
WPML Supporter since 12/2018

Languages: English (English ) German (Deutsch ) French (Français )

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

We found that this is most likely related WPML_ACF_Field_Settings::update_existing_subfields function, specifically problematic thing is about OEmbed field (as it's triggering an external request).

Our developers are currently investigating this, but can you try this as a workaround?

in \WPML_ACF_Field_Settings::update_existing_subfields in acfml\classes\class-wpml-acf-field-settings.php

Change the line:

$query          = "SELECT * FROM {$wpdb->postmeta} WHERE meta_key LIKE %s";

to:

$query          = "SELECT `meta_key`,`post_id` FROM {$wpdb->postmeta} WHERE meta_key LIKE %s";

also, after the line:

	$acf_field_object = get_field_object( $custom_field->meta_key, $custom_field->post_id );

change from:

								$acf_field_object = get_field_object( $custom_field->meta_key, $custom_field->post_id );
									if ( $acf_field_object ) { // this is valid ACF field.
										foreach ( $this->tm_setting_index as $setting_index ) {
											$this->maybe_set_new_preference( $setting_index, $custom_field->meta_key, $field['wpml_cf_preferences'] );
										}
										if ( WPML_IGNORE_CUSTOM_FIELD !== (int) $field['wpml_cf_preferences'] ) {
											$this->update_corresponding_system_field_settings( $acf_field_object, $custom_field->meta_key );
										}
									}

to:

								$acf_field_object = get_field_object( $custom_field->meta_key, $custom_field->post_id );
								if ( $acf_field_object["type"] !== "oembed" ) {
									if ( $acf_field_object ) { // this is valid ACF field.
										foreach ( $this->tm_setting_index as $setting_index ) {
											$this->maybe_set_new_preference( $setting_index, $custom_field->meta_key, $field['wpml_cf_preferences'] );
										}
										if ( WPML_IGNORE_CUSTOM_FIELD !== (int) $field['wpml_cf_preferences'] ) {
											$this->update_corresponding_system_field_settings( $acf_field_object, $custom_field->meta_key );
										}
									}
								}

and finally, In the import file change from:

        "acfml_field_group_mode": "translation",

to:

        "acfml_field_group_mode": "advanced",

Let me know if still getting 504.

August 14, 2023 at 5:37 pm #14199411

ianC-25

I'm having an issue finding this file
and finally, In the import file change from:
"acfml_field_group_mode": "translation",

I also did a grep for acfml_field_group_mode and not seeing that string anywhere.