Page MenuHomePhabricator

FuzzyBot overwriting fully translated pages with original text
Closed, ResolvedPublicBUG REPORT

Description

NOTE: The issue has been fixed. All outdated translation pages have been updated.

Steps to reproduce

  1. Have a(n at least partially) translated page.
  2. Make some changes to its original and mark it for translation again. (Changes are not strictly necessary to reproduce, but they make clearer what happens.)
  3. Look at the formerly translated page.

Actual result

  1. The translation template’s changes are applied, but all translations are replaced by the original texts (properly marked up in syntax version 2).

Expected result

  1. The translation template’s changes are applied, and existing translations are preserved.

Other info

  • New regression in 1.37.0-wmf.18.
  • Examples: Commons, Meta. A mark for translation earlier today (i.e. before the train arrival) was still fine.

Impact

  • Marking for translation removes all of the translation, people can’t read pages in their native languages.

Event Timeline

Tacsipacsi triaged this task as Unbreak Now! priority.Aug 11 2021, 10:29 PM

Holding a train doesn’t make sense since (AFAIK) there are no Translate wikis in group2, but reverting would, unless it can be fixed and backported quickly.

@Pppery, @Nikerabbit: The only change last week was db253cb49674. Do you know where it could have gone wrong, or should it be reverted as a hotfix? T258756 is quite an edge case issue, so not having it fixed for some more time doesn’t seem to be a huge issue for me; at least much less than the current situation, where the translation pages are created but contain no translation, and other translation pages don’t contain translation either.

The original patch I wrote couldn't possibly have caused this. It's theoretically possible Niklas' update to my patch did, and if that is in fact the case, I agree the patch should be reverted.

I'm looking into this currently.

@Tacsipacsi - I tried reproducing this locally. Here's what I did:

  1. Created a new translatable page with 2 translation units
  2. Translated it to en-gb and fr
  3. Marked the translatable page for translation again after changing both the translation units
  4. Looked at the two translation pages: en-gb and fr.

The existing translations were marked as outdated, but were not overwritten. Can you confirm that you are still seeing it when marking pages for translation now?

I've been trying to reproduce this on Metawiki but do not have permission to mark a page for translation. Here's my test page: https://meta.wikimedia.org/wiki/User:APatro_(WMF)/Sandbox_Test

I took an existing translatable page (did not create a new one) that had a "space" in it's title and a few translation pages. I marked that for translation and was able to reproduce the issue locally as well.

I believe this is because of the usage of Title::getPrefixedText() instead of Title::getPrefixedDbKey(). See image below from patch in question:

image.png (606×1 px, 137 KB)

When fetching the definitions we we are still using the Title::getPrefixedDbKey(), see WikiPageMessageGroup::getDefinition - https://gerrit.wikimedia.org/g/mediawiki/extensions/Translate/+/master/messagegroups/WikiPageMessageGroup.php#82 causing this weird behavior.

Change 712039 had a related patch set uploaded (by Abijeet Patro; author: Abijeet Patro):

[mediawiki/extensions/Translate@master] TranslationPage: Use Title::getPrefixedDBkey when extracting messages

https://gerrit.wikimedia.org/r/712039

Change 712039 merged by jenkins-bot:

[mediawiki/extensions/Translate@master] TranslationPage: Use Title::getPrefixedDBkey when extracting messages

https://gerrit.wikimedia.org/r/712039

Related patch has been merged. To test:

Step: Mark the following page for translation (needs translation-admin right) again: https://meta.wikimedia.org/wiki/Meta:IP_block_exemption/de by going to https://meta.wikimedia.org/wiki/Special:PageTranslation. See image below.
Observation: Once the TranslateRenderJob has run (should not take more than a minute or two at max), the page content should be updated to be in German (de).

image.png (795×1 px, 189 KB)

I have marked the page for translation again seven minutes ago, but nothing has happened.

I have marked the page for translation again seven minutes ago, but nothing has happened.

The change has not been deployed.

I create new translate page https://meta.wikimedia.org/wiki/Meta:Babylon/sk and translate work right.

But older, example: https://meta.wikimedia.org/wiki/Movement_Strategy/sk and another languages of this page no.

Another. At page https://meta.wikimedia.org/wiki/Movement_Strategy/fr work translate participle. Texts are in English, but context of section News & Updates is fr,

I create new translate page https://meta.wikimedia.org/wiki/Meta:Babylon/sk and translate work right.

But older, example: https://meta.wikimedia.org/wiki/Movement_Strategy/sk and another languages of this page no.

Another. At page https://meta.wikimedia.org/wiki/Movement_Strategy/fr work translate participle. Texts are in English, but context of section News & Updates is fr,

@Dusan_Krehel - We're still waiting for the patch to be deployed. Once that is done, you can try marking the page for translation again.

Change 711718 had a related patch set uploaded (by Jforrester; author: Abijeet Patro):

[mediawiki/extensions/Translate@wmf/1.37.0-wmf.18] TranslationPage: Use Title::getPrefixedDBkey when extracting messages

https://gerrit.wikimedia.org/r/711718

I create new translate page https://meta.wikimedia.org/wiki/Meta:Babylon/sk and translate work right.

As far as I understand, the bug is about incorrectly handling spaces in page titles (space vs underscore). So any page which has no space in its title is fine even without the patch.

Another. At page https://meta.wikimedia.org/wiki/Movement_Strategy/fr work translate participle. Texts are in English, but context of section News & Updates is fr,

Because that’s from the template Movement Strategy/Updates/fr, which (fortunately) hasn’t been touched since yesterday.

Once that is done, you can try marking the page for translation again.

Just editing a translation unit (even a null edit, or by continuing the translation) would also suffice, wouldn’t it? @Dusan_Krehel doesn’t have translation admin rights on Meta, so they can’t mark the page for translation. Although maybe these pages should be fixed with a bot/maintenance script instead of just hoping that people will fix them.

Just editing a translation unit (even a null edit, or by continuing the translation) would also suffice, wouldn’t it? @Dusan_Krehel doesn’t have translation admin rights on Meta, so they can’t mark the page for translation. Although maybe these pages should be fixed with a bot/maintenance script instead of just hoping that people will fix them.

A null edit will also work.

I will look at running a script to get these fixed but that can only happen tomorrow.

@Tacsipacsi Yes. Space in title is a problem. I created (https://meta.wikimedia.org/wiki/Wikimedia_Foundation_Values/sk + translate title and one string in context), so translated context of page is in English.

If someone mark page to translate and then I edit a page, so translated context is bad. This is not right way to remove a problem. Tested on https://meta.wikimedia.org/wiki/Movement_Strategy/sk.

This is not right way to remove a problem.

It will be, once the fix is deployed. It’s not yet. You’ll notice when it is, there will be a ton of comments from @gerritbot, @Stashbot and other bots on this task.

Change 711718 merged by jenkins-bot:

[mediawiki/extensions/Translate@wmf/1.37.0-wmf.18] TranslationPage: Use Title::getPrefixedDBkey when extracting messages

https://gerrit.wikimedia.org/r/711718

Mentioned in SAL (#wikimedia-operations) [2021-08-12T19:43:12Z] <twentyafterfour@deploy1002> Synchronized php-1.37.0-wmf.18/extensions/Translate/src/PageTranslation/TranslationPage.php: sync I2f46abb20145630c27449ce57f1256e92f440144 which should fix T288683 & T288700 thus unblocking the train: T281159 (duration: 01m 07s)

The fix is merged to 1.37.0-wmf.18 and deployed. Fix confirmed by @abi_ and @Tacsipacsi. All that remains is cleanup of affected pages.

Mentioned in SAL (#wikimedia-operations) [2021-08-12T20:13:30Z] <urbanecm> [urbanecm@mwmaint2002 /srv/mediawiki/php]$ mwscript extensions/Translate/scripts/refresh-translatable-pages.php --wiki=wikimaniawiki --jobqueue # T288683

Mentioned in SAL (#wikimedia-operations) [2021-08-12T20:24:57Z] <urbanecm> [urbanecm@mwmaint2002 /srv/mediawiki/php]$ mwscript extensions/Translate/scripts/refresh-translatable-pages.php --wiki=wikimaniawiki --jobqueue # T288683

Mentioned in SAL (#wikimedia-operations) [2021-08-12T20:54:23Z] <urbanecm> [urbanecm@mwmaint2002 /srv/mediawiki/php]$ mwscript extensions/Translate/scripts/refresh-translatable-pages.php --wiki=testwiki --jobqueue # T288683

Mentioned in SAL (#wikimedia-operations) [2021-08-12T20:56:43Z] <urbanecm> [urbanecm@mwmaint2002 /srv/mediawiki/php]$ mwscript extensions/Translate/scripts/refresh-translatable-pages.php --wiki=testwikidatawiki --jobqueue # T288683, errored out

Mentioned in SAL (#wikimedia-operations) [2021-08-12T21:52:46Z] <urbanecm> Run mwscript extensions/Translate/scripts/refresh-translatable-pages.php --wiki=$WIKI --jobqueue for a bunch of Translate-enabled wikis (T288683)

Urbanecm lowered the priority of this task from Unbreak Now! to High.Aug 12 2021, 10:30 PM
Urbanecm added a project: User-Urbanecm.

So, I ran the refresh-translatable-pages script on a couple of wikis per IRC discussion with @abi_. Manual checks confirmed it indeed resolves known issues with the localized versions.

Jobqueue is now busy with running the refresh jobs. I'll leave it like that over the night, and will finish it for the rest of the wikis later. Lowering priority to high, as it can be fully resolved on wiki now.

Mentioned in SAL (#wikimedia-operations) [2021-08-13T11:59:36Z] <urbanecm> mwscript extensions/Translate/scripts/refresh-translatable-pages.php --wiki=mediawikiwiki --jobqueue # T288683

Mentioned in SAL (#wikimedia-operations) [2021-08-13T12:24:51Z] <urbanecm> mwscript extensions/Translate/scripts/refresh-translatable-pages.php --wiki=commonswiki --jobqueue # T288683

Update comment: Jobs are now running for mediawiki.org and commons, they should finish within a couple of hours. New translations can be slower to appear until the jobs finish.

Update comment: Jobs are now running for mediawiki.org and commons, they should finish within a couple of hours. New translations can be slower to appear until the jobs finish.

All the jobs finished. Pages that were broken because of this bug should now be fine again, and Translate extension should operate normally again. Closing as resolved.

Also update the translatable pages on translatewiki.net