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
9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 - -
14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 - -

Supporter timezone: Asia/Jerusalem (GMT+03:00)

Tagged: ,

This topic contains 4 replies, has 2 voices.

Last updated by Itamar 1 day, 2 hours ago.

Assisted by: Itamar.

Author Posts
September 19, 2024 at 7:57 am #16196467

iuliiaK-3

Background of the issue:
We are running the WPML String Translation plugin in a Kubernetes-based environment with 9 pods hosting the site. Each pod is constantly updating records in the wp_icl_mo_files_domains table. The function @filemtime($file) returns slightly different results due to containers being launched at different times, leading to discrepancies in file modification times (often by just a few seconds). This causes issues with how the plugin checks file modification timestamps.
UPDATE `wp_icl_mo_files_domains` SET `domain` = 'acf', `status` = 'not_imported', `num_of_strings` = 0, `last_modified` = 1726638200 WHERE `file_path_md5` = '04f6b368cded3ef1c63f57fa4bca095b'
The affected code appears as follows:
} elseif ( $file->get_last_modified() !== $last_modified ) {
The strict comparison between $file->get_last_modified() and $last_modified does not account for minor time differences between containers.

Symptoms:

Questions:

September 19, 2024 at 12:48 pm #16198762

Itamar
Supporter

Languages: English (English ) Hebrew (עברית )

Timezone: Asia/Jerusalem (GMT+03:00)

Hi,

I forgot to ask something important.

I just noticed that the WPML plugins on your site have not been updated to their latest versions.

Have you tried to check if the problem occurs when all of our plugins are updated to their latest versions?

Regards,
Itamar.

September 20, 2024 at 8:16 am #16201582

iuliiaK-3

Hi Itamar,

Thank you for your message.

I have checked the latest version of the WPML plugins, and unfortunately, the issue persists. The code in question has not changed in the new version, so the problem remains unresolved.

Regards, Igor

September 22, 2024 at 10:16 am #16205809

Itamar
Supporter

Languages: English (English ) Hebrew (עברית )

Timezone: Asia/Jerusalem (GMT+03:00)

Hi,

Our second-tier supporter consults our developers about this issue.

Meanwhile, he suggested the following workaround.

Set the last modified files via code to a specific date.

<?php
$file = 'your_file.txt'; // Replace with your file path
$yesterday_midnight = strtotime('yesterday midnight');
touch($file, $yesterday_midnight);
?>

Please note that this workaround has not been tested.

We will keep you updated here on any news regarding this issue.

Regards,
Itamar.

September 30, 2024 at 8:13 pm #16237594

Itamar
Supporter

Languages: English (English ) Hebrew (עברית )

Timezone: Asia/Jerusalem (GMT+03:00)

Hi,

Our second-tier supporter asks for further clarification from your side.

To investigate this issue further, he needs some more details.

You mentioned that there are two WordPress containers (wordpress1 and wordpress2), both sharing the same volume for WordPress data. From what he understands, since the files and database are shared between the containers, any changes made by one container should be reflected in the other.

However, you also noted that the same files in both Docker containers sometimes have different last modified times. Could you provide some context or explain why this might be happening?

He is asking to determine whether this is an isolated case or a broader issue that needs to be addressed.

Regards,
Itamar.