Page MenuHomePhabricator

Automatic translation failed error when translating from de -> en using CX
Closed, ResolvedPublic2 Estimated Story Points

Description

I got a report on my talk page about automatic translation failing when translating from de -> en

Quoting Laura240406
I wanted to translate a page a few days ago but the tools failed with "Automatic translation failed". So I looked at the network log and the endpoint at https://cxserver.wikimedia.org/v2/translate/de/en/ returned "Authorization header is missing".
A git clone and grep later, I found out that this comes from line 117 in cxserver/lib/routes/v1.js, which was introduced in commit f8852f1e by you (as far as I can tell with git blame).
Is my diagnosis right and, if so, could you please fix the issue?

I investigated the issue and here's what I found:

The patch in question (f8852f1e) hasn't yet been deployed on production server yet so that cannot be the issue.

The issue was likely caused by this patch: 1119179: Use default provider if none is provided when making MT translations | https://gerrit.wikimedia.org/r/c/mediawiki/services/cxserver/+/1119179 submitted to fix T386231: /v2/translate API fails to perform any translation when no provider is provided. This patch has a side-effect where if an error occurs while creating the MT Client, cxserver returns the error to the client. Previously, the default MT provider was not being used at all.

The patch (f8852f1e) handles these MT Client errors, and continues processing so when that is deployed it should fix this issue.


The other issue I see is with how CX handles MT being disabled for certain Wikipedias. While testing this issue, I tried translating an article from de -> en: https://en.wikipedia.org/wiki/Special:ContentTranslation?title=Especial:ContentTranslation&campaign=specialcx&from=de&to=en&page=Dithmarschen

image.png (490×2 px, 122 KB)

The change in behavior breaks CX when "copy content" is selected so I think we should "revert" the change made for T386231: /v2/translate API fails to perform any translation when no provider is provided and update the documentation.

Event Timeline

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

[mediawiki/services/cxserver@master] /v2/translate/:from/:to: Do not use default MT provider

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

abi_ changed the point value for this task from 4 to 2.Feb 18 2025, 3:26 PM

Change #1120460 merged by jenkins-bot:

[mediawiki/services/cxserver@master] /v2/translate/{from}/{to}: Do not use default MT provider

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

Change #1120709 had a related patch set uploaded (by KartikMistry; author: KartikMistry):

[operations/deployment-charts@master] Update cxserver to 2025-02-20-032928-production

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

Change #1120709 merged by jenkins-bot:

[operations/deployment-charts@master] Update cxserver to 2025-02-20-032928-production

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

abi_ changed the task status from Open to In Progress.Feb 20 2025, 6:53 AM

The fix for this is now deployed on production. I tested this on https://en.wikipedia.org/wiki/Special:ContentTranslation?title=Especial:ContentTranslation&campaign=specialcx&from=de&to=en&page=Dithmarschen and it appears to be working as expected. Leaving it open to get inputs from others.

Thank you all so much for the help! It is truly appreciated.