Page MenuHomePhabricator

Issue with MT on a single section
Closed, ResolvedPublic

Description

video with issue being replicated:
https://drive.google.com/file/d/1PZQRsCtgQW-DKZEOA1i7mSZcMtBr-6C3/view?usp=sharing

  • the issue happens on the Joe Sestak article, on the Education section, when the translation is done to Catalan or Spanish using google translate or yandex. it works fine with apertium.

https://ca.wikipedia.org/wiki/Special:ContentTranslation?page=Joe+Sestak&from=en&to=ca&targettitle=Joe+Sestak

this is the source of the section

===Education===
Sestak voted for the [[Improving Head Start Act]] and the [[College Cost Reduction and Access Act]].{{Citation needed|date=October 2010}} He has a 100% lifetime rating from the National Education Association.<ref>{{Cite web|url=http://www.politicspa.com/joe-sestak-leads-emergency-meeting-on-education-in-philadelphia/15530/|title=Joe Sestak Leads Emergency Meeting on Education in Philadelphia|last=|first=|date=|website=PoliticsPA|archive-url=|archive-date=|dead-url=|access-date=}}</ref>

Request URL: https://cxserver.wikimedia.org/v2/translate/en/ca/Google
Request Method: POST
Status Code: 500

Response:
Error: Invalid sourceHtml
    at Google.buildSourceDoc (/srv/service/lib/mt/MTClient.js:452:10)
    at Google.translateReducedHtml (/srv/service/lib/mt/MTClient.js:58:8)
    at Google.translate (/srv/service/lib/mt/Google.js:26:15)
    at MWLink.<anonymous> (/srv/service/lib/translationunits/MWLink.js:60:37)
    at Generator.next (<anonymous>)
    at resume (/srv/service/lib/util.js:285:21)
    at resumeNext (/srv/service/lib/util.js:295:30)


 Uncaught TypeError: Cannot read property 'store' of null
    at VeDmCXTransclusionInlineNode.ve.dm.CXTransclusionInlineNode.convertToPlainText (<anonymous>:457:33)
    at VeDmCXSectionNode.oo.EventEmitter.emit (<anonymous>:68:486)
    at VeUiCXTranslationAction.ve.ui.CXTranslationAction.afterTranslate (<anonymous>:483:281)
    at VeUiCXTranslationAction.<anonymous> (<anonymous>:482:783)
    at fire (load.php?debug=false&lang=en&modules=ext.visualEditor.core|jquery%2Coojs-ui-core%2Coojs-ui-widgets|oojs-ui.styles.icons-editing-advanced&skin=vector&version=1vebuhd:869)
    at Object.fireWith [as rejectWith] (load.php?debug=false&lang=en&modules=ext.visualEditor.core|jquery%2Coojs-ui-core%2Coojs-ui-widgets|oojs-ui.styles.icons-editing-advanced&skin=vector&version=1vebuhd:871)
    at process (load.php?debug=false&lang=en&modules=ext.visualEditor.core|jquery%2Coojs-ui-core%2Coojs-ui-widgets|oojs-ui.styles.icons-editing-advanced&skin=vector&version=1vebuhd:873)

Interestingly, sometime the following warning is displayed instead of the above stack trace:

Cannot read property 'element' of null TypeError: Cannot read property 'element' of null
    at VeCeCXTransclusionInlineNode.ve.ce.View.initialize (https://ca.wikipedia.org/w/load.php?debug=false&lang=en&modules=ext.visualEditor.core%7Cjquery%2Coojs-ui-core%2Coojs-ui-widgets%7Coojs-ui.styles.icons-editing-advanced&skin=vector&version=1vebuhd:365:559)
    at VeCeCXTransclusionInlineNode.ve.ce.LeafNode.initialize (https://ca.wikipedia.org/w/load.php?debug=false&lang=en&modules=ext.visualEditor.core%7Cjquery%2Coojs-ui-core%2Coojs-ui-widgets%7Coojs-ui.styles.icons-editing-advanced&skin=vector&version=1vebuhd:386:121)
    at VeCeCXTransclusionInlineNode.ve.ce.GeneratedContentNode.render (https://ca.wikipedia.org/w/load.php?debug=false&lang=en&modules=ext.visualEditor.core%7Cjquery%2Coojs-ui-core%2Coojs-ui-widgets%7Coojs-ui.styles.icons-editing-advanced&skin=vector&version=1vebuhd:524:771)
    at VeCeCXTransclusionInlineNode.ve.ce.MWTransclusionNode.render (<anonymous>:302:148)
    at VeCeCXTransclusionInlineNode.ve.ce.GeneratedContentNode.doneGenerating (https://ca.wikipedia.org/w/load.php?debug=false&lang=en&modules=ext.visualEditor.core%7Cjquery%2Coojs-ui-core%2Coojs-ui-widgets%7Coojs-ui.styles.icons-editing-advanced&skin=vector&version=1vebuhd:526:527)
    at https://ca.wikipedia.org/w/load.php?debug=false&lang=en&modules=ext.visualEditor.core%7Cjquery%2Coojs-ui-core%2Coojs-ui-widgets%7Coojs-ui.styles.icons-editing-advanced&skin=vector&version=1vebuhd:525:627
    at fire (https://ca.wikipedia.org/w/load.php?debug=false&lang=en&modules=ext.visualEditor.core%7Cjquery%2Coojs-ui-core%2Coojs-ui-widgets%7Coojs-ui.styles.icons-editing-advanced&skin=vector&version=1vebuhd:869:974)
    at Object.fireWith [as resolveWith] (https://ca.wikipedia.org/w/load.php?debug=false&lang=en&modules=ext.visualEditor.core%7Cjquery%2Coojs-ui-core%2Coojs-ui-widgets%7Coojs-ui.styles.icons-editing-advanced&skin=vector&version=1vebuhd:871:169)
    at Object.deferred.<computed> [as resolve] (https://ca.wikipedia.org/w/load.php?debug=false&lang=en&modules=ext.visualEditor.core%7Cjquery%2Coojs-ui-core%2Coojs-ui-widgets%7Coojs-ui.styles.icons-editing-advanced&skin=vector&version=1vebuhd:874:678)
    at VeCeCXTransclusionInlineNode.ve.ce.MWTransclusionNode.onParseSuccess (<anonymous>:301:968) undefined

thank you @Etonkovidova for the details.
@Petar.petkovic let me know if there's any info missing.

Event Timeline

Jpita created this task.Jun 26 2019, 9:42 AM
Restricted Application added subscribers: Liuxinyu970226, Aklapper. · View Herald TranscriptJun 26 2019, 9:42 AM
Pginer-WMF triaged this task as High priority.Jun 26 2019, 12:57 PM
Pginer-WMF added a project: ContentTranslation.
Pginer-WMF added a subscriber: Pginer-WMF.

From the video it seems that in addition to the console error, the translate content is not added to the document and the source content is added instead because of the failure. We may need to investigate if this is produced because of the tool is having problems with a particular kind of content or it is a more general issue.

Pginer-WMF lowered the priority of this task from High to Normal.Jul 1 2019, 12:14 PM
Pginer-WMF raised the priority of this task from Normal to High.EditedJul 2 2019, 12:57 PM

I found another case of machine translation failing. I tried to translate sushi from English to Spanish and was getting an error when MT was being used showing the "MT Failed" message and falling back to copy source automatically.

This quick link allows to start a new translation for the first paragraph of the Sushi article which illustrates the problem. The presence of the Nihongo template may be the origin of the issue since the rest of the paragraph has no other complex elements.

Pginer-WMF lowered the priority of this task from High to Normal.Jul 2 2019, 1:48 PM

It is a different issue: en->en translation with Google

{"status":500,"type":"internal_error","title":"Error","detail":"Translation with Google failed for en > en. Error: 400 : Bad language pair: en|en","method":"POST","uri":"/v2/translate/en/simple/Google"}

Change 520384 had a related patch set uploaded (by Santhosh; owner: Santhosh):
[mediawiki/services/cxserver@master] MWLink: Add a check for title attribute before attempting MT

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

Change 520384 merged by jenkins-bot:
[mediawiki/services/cxserver@master] MWLink: Add a check for title attribute before attempting MT

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

Neither me nor Santhosh were able to reproduce this error locally. The latest patch avoids this exception but adds a bit of debug logging that hopefully will shed some light on the cause. We have been trying to rule out differences which causes us not to be able to reproduce it locally. We have ruled out anything on the client side (browser, CX version) since we isolated a few payloads that reliably trigger this error in production but not locally. This leaves possible causes: environment (can be ruled out by using the docker images), configuration, state (batched API request cache for example), or differences by external API outputs in production vs. locally.

This error has been happening since 2019-06-18 (likely when my MWLink changes were deployed) and it has happened >200 times in the past 24 hours. There are a few other sources in MWImage and MWGallery that can cause this same error, but those have been there before and happen much more infrequently.

Mentioned in SAL (#wikimedia-operations) [2019-07-03T12:12:59Z] <kart_> Updated cxserver to b447674 (T226611)

It is a different issue: en->en translation with Google

{"status":500,"type":"internal_error","title":"Error","detail":"Translation with Google failed for en > en. Error: 400 : Bad language pair: en|en","method":"POST","uri":"/v2/translate/en/simple/Google"}

I created a new ticket for this issue T227252: Do not provide MT servies option for en->simple or simple->en language pairs

About the missing title attribute for certain links, a debug log was added and monitored the production log.

There are some links with missing title attribute, but not common and harmless. Also they are mostly related to Wikipedia meta links - for example: links to portals and wikipedia: namespaces.

Jpita closed this task as Resolved.Jul 16 2019, 4:02 PM
Jpita moved this task from Needs QA to Done on the Language-Team (Language-2019-July-September) board.

Can't replicate it in prod anymore.
I was able to reproduce once the issue when it changes the MT option used (I switch from apertium to google and it changes back to apertium) but just that one time.
Moving it to done.