Page MenuHomePhabricator

Translation memory does not display anymore
Closed, ResolvedPublic2 Estimated Story PointsBUG REPORT

Description

Trying to translate Tech-News, memory translations from previous week do not display anymore as translation aid.

Note there is neither Apertium suggestion, but on other page, Apertium still works (whereas I have not found any page where TTM works).

Event Timeline

Note that I do see Apertium suggestions for Spanish appearing: https://meta.wikimedia.org/w/index.php?title=Special:Translate&group=page-Tech%2FNews%2F2022%2F16&action=page&filter=&language=es

TTM appears to not work anywhere. Possibly related to some refactoring work being done. I'll try to reproduce this locally.

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

[mediawiki/extensions/Translate@master] TTMServerAid::getData: Do not swallow TranslationHelperException

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

I downgraded to the same Elasticsearch version (6.5.4) on Meta but was unable to reproduce this issue locally. Its not possible for me to simulate the exact configuration on Meta-Wiki.

We were also swallowing some exceptions so that may be hiding the issue. I've submitted a patch to avoid doing that.

Change 783822 merged by jenkins-bot:

[mediawiki/extensions/Translate@master] TTMServerAid::getData: Do not swallow TranslationHelperException

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

Is it possible to backport this? If it’s backported today, maybe there’s enough information to find the real bug and let the fix ride the train this week.

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

[mediawiki/extensions/Translate@wmf/1.39.0-wmf.7] TTMServerAid::getData: Do not swallow TranslationHelperException

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

@Nikerabbit has production access and was able to run some code to identify the issue:

nikerabbit@mwmaint1002:~$ mwscript eval.php --wiki=metawiki
> $s = TTMServer::primary();

> TTMServer::primary()->query( 'en', 'fi', 'hello' );
Caught exception MediaWiki\Extension\Translate\TranslatorInterface\TranslationHelperException: Elastica exception: Elastica\Exception\ResponseException: Fielddata access on the _id field is disallowed [reason: all shards failed] in /srv/mediawiki/php-1.39.0-wmf.7/vendor/ruflin/elastica/lib/Elastica/Transport/Http.php:182
Stack trace:

This issue should be fixed by https://gerrit.wikimedia.org/r/c/mediawiki/extensions/Translate/+/780878 which is already included in the wmf/1.39.0-wmf.8 and should ride the train.

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

[mediawiki/extensions/Translate@wmf/1.39.0-wmf.7] ElasticSearchTTMServer: tie break on wiki+localid

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

Change 780641 merged by Urbanecm:

[mediawiki/extensions/Translate@wmf/1.39.0-wmf.7] TTMServerAid::getData: Do not swallow TranslationHelperException

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

Change 783907 merged by Urbanecm:

[mediawiki/extensions/Translate@wmf/1.39.0-wmf.7] ElasticSearchTTMServer: tie break on wiki+localid

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

Mentioned in SAL (#wikimedia-operations) [2022-04-19T07:11:55Z] <urbanecm@deploy1002> Synchronized php-1.39.0-wmf.7/extensions/Translate/ttmserver/ElasticSearchTTMServer.php: e9668719a6eb928b28ef67ba6d97348068012d04: ElasticSearchTTMServer: tie break on wiki+localid (T305428, T306233) (duration: 00m 51s)

Mentioned in SAL (#wikimedia-operations) [2022-04-19T07:12:46Z] <urbanecm@deploy1002> Synchronized php-1.39.0-wmf.7/extensions/Translate/src/TranslatorInterface/Aid/TTMServerAid.php: 36c6682: TTMServerAid::getData: Do not swallow TranslationHelperException (T306233) (duration: 00m 51s)

abi_ claimed this task.
abi_ moved this task from In Progress to Done on the Language-Team (Language-2022-April-June) board.
abi_ set the point value for this task to 2.
abi_ added subscribers: Urbanecm, KartikMistry.

We've back-ported the patches. Translation memory suggestions are now appearing:

image.png (694×1 px, 80 KB)

Tested on Meta-Wiki and MediaWiki.

Thanks @Urbanecm and @KartikMistry for helping with the back-port