Page MenuHomePhabricator

CXServer fails with HTTP 500: "MT processing error: undefined"
Closed, ResolvedPublic

Description

The following input breaks when translated using cxserver:

Produced on https://dev.translatewiki.net/w/i.php?title=Special:ContentTranslation&page=Vantaa&from=en&to=es&targettitle=Vantaa&version=2 (first section after infobox).

<section id="cxTargetSection1" data-mw-cx-source="undefined"><p id="mwBQ"><span data-segmentid="218" class="cx-segment"><b id="mwBg">Vantaa</b> (<small about="#mwt7" data-mw="{&quot;parts&quot;:[{&quot;template&quot;:{&quot;target&quot;:{&quot;wt&quot;:&quot;IPA-fi&quot;,&quot;href&quot;:&quot;./Template:IPA-fi&quot;},&quot;params&quot;:{&quot;1&quot;:{&quot;wt&quot;:&quot;ˈʋɑntɑː&quot;}},&quot;i&quot;:0}}]}" id="mwBw" typeof="mw:Transclusion" data-ve-no-generated-contents="true">Finnish pronunciation:<span typeof="mw:Entity">&nbsp;</span></small><span about="#mwt7" class="IPA" id="mwCA" title="Representation in the International Phonetic Alphabet (IPA)" data-ve-ignore="true"><a class="cx-link" data-linkid="219" href="./Help:IPA/Estonian_and_Finnish" rel="mw:WikiLink" title="Help:IPA/Estonian and Finnish">[ˈʋɑntɑː]</a></span>; <a about="#mwt8" class="cx-link" data-linkid="220" data-mw="{&quot;parts&quot;:[{&quot;template&quot;:{&quot;target&quot;:{&quot;wt&quot;:&quot;lang-sv&quot;,&quot;href&quot;:&quot;./Template:Lang-sv&quot;},&quot;params&quot;:{&quot;1&quot;:{&quot;wt&quot;:&quot;Vanda&quot;}},&quot;i&quot;:0}}]}" href="./Swedish_language" id="mwCQ" rel="mw:WikiLink" title="Swedish language" typeof="mw:Transclusion" data-ve-no-generated-contents="true">Swedish</a><span about="#mwt8" data-ve-ignore="true">: </span><i about="#mwt8" lang="sv" data-ve-ignore="true">Vanda</i><link about="#mwt8" href="./Category:Articles_containing_Swedish-language_text" id="mwCg" rel="mw:PageProp/Category" data-ve-ignore="true">) is a city and <a href="./Municipalities_of_Finland" rel="mw:WikiLink" data-linkid="221" class="cx-link" id="mwCw" title="Municipalities of Finland">municipality</a> in <a href="./Finland" rel="mw:WikiLink" data-linkid="222" class="cx-link" id="mwDA" title="Finland">Finland</a>. </span><span data-segmentid="223" class="cx-segment">It is part of the inner core of the <a href="./Greater_Helsinki" rel="mw:WikiLink" data-linkid="224" class="cx-link" id="mwDQ" title="Greater Helsinki">Finnish Capital Region</a> along with <a href="./Helsinki" rel="mw:WikiLink" data-linkid="225" class="cx-link" id="mwDg" title="Helsinki">Helsinki</a>, <a href="./Espoo" rel="mw:WikiLink" data-linkid="226" class="cx-link" id="mwDw" title="Espoo">Espoo</a>, and <a href="./Kauniainen" rel="mw:WikiLink" data-linkid="227" class="cx-link" id="mwEA" title="Kauniainen">Kauniainen</a>. </span><span data-segmentid="228" class="cx-segment">With a population of <span about="#mwt181" data-mw="{&quot;parts&quot;:[{&quot;template&quot;:{&quot;target&quot;:{&quot;wt&quot;:&quot;formatnum: {{Infobox Finnish Municipality/population count|Vantaa}}&quot;,&quot;function&quot;:&quot;formatnum&quot;},&quot;params&quot;:{},&quot;i&quot;:0}}]}" id="mwEQ" typeof="mw:Transclusion" data-ve-no-generated-contents="true">221,821</span> (<span about="#mwt10" data-mw="{&quot;parts&quot;:[{&quot;template&quot;:{&quot;target&quot;:{&quot;wt&quot;:&quot;#time: j F Y&quot;,&quot;function&quot;:&quot;time&quot;},&quot;params&quot;:{&quot;1&quot;:{&quot;wt&quot;:&quot;{{Infobox Finnish Municipality/population count|sourcedate}}&quot;}},&quot;i&quot;:0}}]}" id="mwEg" typeof="mw:Transclusion" data-ve-no-generated-contents="true">31 August 2017</span><sup typeof="mw:Extension/ref" data-ve-ignore="true" data-mw="{&quot;name&quot;:&quot;ref&quot;,&quot;attrs&quot;:{&quot;name&quot;:&quot;population_count&quot;},&quot;body&quot;:{&quot;html&quot;:&quot;&quot;}}" class="mw-ref" about="#mwt12" id="cite_ref-population_count_3-1" rel="dc:references"><a href="./Vantaa#cite_note-population_count-3" style="counter-reset: mw-Ref 1;"><span class="mw-reflink-text">[1]</span></a></sup>), Vantaa is the fourth most populated city of Finland.</span></p>

</section>

As a side effect, this causes

jQuery.Deferred exception: model.getSectionNumber is not a function TypeError: model.getSectionNumber is not a function
    at VeInitMwCXTarget.<anonymous> (https://dev.translatewiki.net/w/extensions/ContentTranslation/modules/ve-cx/init/ve.init.mw.CXTarget.js?3496c:678:46)
    at fire (https://dev.translatewiki.net/w/resources/lib/jquery/jquery.js?6a07d:3268:31)
    at Object.fireWith [as rejectWith] (https://dev.translatewiki.net/w/resources/lib/jquery/jquery.js?6a07d:3398:7)
    at process (https://dev.translatewiki.net/w/resources/lib/jquery/jquery.js?6a07d:3622:22)
    at Object.<anonymous> (https://dev.translatewiki.net/w/resources/lib/jquery/jquery.js?6a07d:3632:9)
    at mightThrow (https://dev.translatewiki.net/w/resources/lib/jquery/jquery.js?6a07d:3534:29)
    at process (https://dev.translatewiki.net/w/resources/lib/jquery/jquery.js?6a07d:3602:12) undefined

This is because model is VeDmCXPlaceholderNode and it is that because translation failed, tries to fallback to the source text, but that one fails too, and placeholder is not replaced with new content.


Related ticket: T205616: CX2: Section alignment broken when translating "Fleming: The Man Who Would Be Bond" from Hebrew

Event Timeline

Pginer-WMF triaged this task as Medium priority.Sep 26 2018, 7:11 AM
Pginer-WMF moved this task from Backlog to Page contents issues on the CX-cxserver board.

This has a template with data-mw like this. The wt param value is causing "Invalid title" error from BatchedAPIRequest.prototype.get method

{
    "parts": [
        {
            "template": {
                "target": {
                    "wt": "formatnum: {{Infobox Finnish Municipality/population count|Vantaa}}",
                    "function": "formatnum"
                },
                "params": {},
                "i": 0
            }
        }
    ]
}

How to adapt this template?!

Change 462880 had a related patch set uploaded (by Santhosh; owner: Santhosh):
[mediawiki/services/cxserver@master] Template adaptation: Fix unhandled promise rejection error

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

Change 462886 had a related patch set uploaded (by Santhosh; owner: Santhosh):
[mediawiki/extensions/ContentTranslation@master] Introduce getSectionNumber and getSectionId for CXPlaceholderNode

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

Change 462886 merged by Petar.petkovic:
[mediawiki/extensions/ContentTranslation@master] Introduce getSectionNumber and getSectionId for CXPlaceholderNode

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

Change 462880 merged by jenkins-bot:
[mediawiki/services/cxserver@master] Template adaptation: Fix unhandled promise rejection error

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

@Nikerabbit - Since I am not 100% sure that this fix has addressed what it's supposed to fix, please review my comment below. It could be that what I've observed is unrelated to the scope of this fix.

I checked the article's translation - fi:Vantaa to English on cx2 and wmf.23 (with cx2 enabled).
There still is one strange issue - when the first paragraph after the infobox is clicked, 'Automation translation failed' message repeatedly appears. However, there is no MT option is present at all.

I checked another translation for similarly structured article - fi:Sipoo to English.

<section data-mw-cx-source="undefined" id="cxTargetSection1"><figure data-cx="{&#34;adapted&#34;:true,&#34;imageSource&#34;:&#34;//upload.wikimedia.org/wikipedia/commons/thumb/d/db/Kayakers-in-Sipoo-archipelago_FI-EU_2007-Aug-10_by-RAM.jpg/300px-Kayakers-in-Sipoo-archipelago_FI-EU_2007-Aug-10_by-RAM.jpg&#34;,&#34;resource&#34;:&#34;./Tiedosto:Kayakers-in-Sipoo-archipelago_FI-EU_2007-Aug-10_by-RAM.jpg&#34;}" id="mwBA" rel="cx:Figure" typeof="mw:Image/Thumb"><a href="./File:Kayakers-in-Sipoo-archipelago_FI-EU…et="//upload.wikimedia.org/wikipedia/commons/thumb/d/db/Kayakers-in-Sipoo-archipelago_FI-EU_2007-Aug-10_by-RAM.jpg/600px-Kayakers-in-Sipoo-archipelago_FI-EU_2007-Aug-10_by-RAM.jpg 2x, //upload.wikimedia.org/wikipedia/commons/thumb/d/db/Kayakers-in-Sipoo-archipelago_FI-EU_2007-Aug-10_by-RAM.jpg/450px-Kayakers-in-Sipoo-archipelago_FI-EU_2007-Aug-10_by-RAM.jpg 1.5x" width="300"></img></a><figcaption id="mwBw"><span class="cx-segment" data-segmentid="172">Sipoon saaristoa</span></figcaption></figure></section>

The first paragraph (under the first picture with the caption "Sipoon saaristoa") will produce the same false "Automation translation failed" and not translating the paragraph with the 'Source text' option. Only the paragpah that has the following text "Vuoden 2009 alussa Sipoosta siirrettiin noin 30 neliökilometrin laajuinen alue Helsinkiin. Siirrettyyn alueeseen kuuluvat muun muassa Östersundom, Karhusaari ja Landbo." is translatable with "Use source text" option.

It looks like the CXServer patch has not yet been deployed to production. Kartik is planning to do that soon and I can recheck then.

It looks like the CXServer patch has not yet been deployed to production. Kartik is planning to do that soon and I can recheck then.

Yes. Waiting for cxserver deployment.

Mentioned in SAL (#wikimedia-operations) [2018-10-15T03:14:02Z] <kartik@deploy1001> Started deploy [cxserver/deploy@5a70ef1]: Update cxserver to 47a864b (T205420, T203077, T205700, T205616)

Mentioned in SAL (#wikimedia-operations) [2018-10-15T03:18:46Z] <kartik@deploy1001> Finished deploy [cxserver/deploy@5a70ef1]: Update cxserver to 47a864b (T205420, T203077, T205700, T205616) (duration: 04m 44s)

Re-checked in production(wmf.26) - translating en:Vantaa (to es) , fi:Vantaa, fi:Sipoo to en look fine.