Page MenuHomePhabricator

Critical error: Content translation failed to load due to internal error
Closed, ResolvedPublic2 Estimated Story Points

Description

The error

XML Parsing Error: syntax error
Location: https://cxserver.wikimedia.org/v2/page/en/pt/Circle%E2%80%93ellipse_problem
Line Number 1, Column 1:

appears in the console when I access
https://pt.wikipedia.org/wiki/Special:ContentTranslation?page=Circle%E2%80%93ellipse+problem&from=en&to=pt&targettitle&campaign=interlanguagelink
from the English Wikipedia sidebar link, and the special page shows "Critical error: Content translation failed to load due to internal error", followed by blank spaces where the source and target language texts would be.

The page https://cxserver.wikimedia.org/v2/page/en/pt/Circle%E2%80%93ellipse_problem shows the following:

Page en:Circle–ellipse_problem could not be found. Error: Sectionwrap: Attempting to remove a non-section tag: undefined

Event Timeline

This article has a section(as in cx terminology) with tag <span>. In section wrapping logic, we are trying to add the <pre> tag to a section, but we see an inline tag <span> instead and code throws error

image.png (352×1 px, 148 KB)

I think the solution would be to properly identify this special <span> as equivalent to a paragraph.

Nikerabbit set the point value for this task to 2.Feb 9 2022, 2:14 PM

This nesting of pre and span was quite complex for cxserver to properly handle in section wrapping. Pre tag is considered as block tag in CX. But here it is inside a span, which is part of a template defined by <link>. I tried different solutions but everything caused many others things to fail. Then I gave up and edited the problematic article to use the Pre template alone and avoided mono template wrapper since mono is redundant here.

Etonkovidova claimed this task.
Etonkovidova subscribed.

Checked on ptwiki wmf.24.
The translation of Pre template silently failed without displaying an error but without disrupting the overall translation (and unfinished translation can be loaded again):

{{Pre|
1=Circle::stretchX(x) { xSize = ySize = x; }
Circle::stretchY(y) { xSize = ySize = y; }
}}

Checking https://cxserver.wikimedia.org/v2/page/en/pt/Circle%E2%80%93ellipse_problem shows translation before Pre template and after:

<h4 id=\"1d1d0f377a550cec48b64f88dad4ee\"><span class=\"cx-segment\" data-segmentid=\"67\">Allow for a weaker contract on Ellipse</span></h4>\n</section><section data-mw-section-number=\"2\" id=\"cxSourceSection19\" rel=\"cx:Section\"><p id=\"mwXA\"><span class=\"cx-segment\" data-segmentid=\"68\">If the interface contract for <link about=\"#mwt68\" data-mw=\"{&#34;parts&#34;:[{&#34;template&#34;:{&#34;target&#34;:{&#34;wt&#34;:&#34;mono&#34;,&#34;href&#34;:&#34;./Template:Mono&#34;},&#34;params&#34;:{&#34;1&#34;:{&#34;wt&#34;:&#34;Ellipse&#34;}},&#34;i&#34;:0}}]}\" href=\"mw-data:TemplateStyles:r886049734\" id=\"mwXQ\" rel=\"mw-deduplicated-inline-style\" typeof=\"mw:Extension/templatestyles mw:Transclusion\" /><span about=\"#mwt68\" class=\"monospaced\" id=\"mwXg\">Ellipse</span> states only that \"stretchX modifies the X axis\", and does not state \"and nothing else will change\", then <link about=\"#mwt71\" data-mw=\"{&#34;parts&#34;:[{&#34;template&#34;:{&#34;target&#34;:{&#34;wt&#34;:&#34;mono&#34;,&#34;href&#34;:&#34;./Template:Mono&#34;},&#34;params&#34;:{&#34;1&#34;:{&#34;wt&#34;:&#34;Circle&#34;}},&#34;i&#34;:0}}]}\" href=\"mw-data:TemplateStyles:r886049734\" id=\"mwXw\" rel=\"mw-deduplicated-inline-style\" typeof=\"mw:Extension/templatestyles mw:Transclusion\" /><span about=\"#mwt71\" class=\"monospaced\" id=\"mwYA\">Circle</span> could simply force the X and Y dimensions to be the same. <link about=\"#mwt74\" data-mw=\"{&#34;parts&#34;:[{&#34;template&#34;:{&#34;target&#34;:{&#34;wt&#34;:&#34;mono&#34;,&#34;href&#34;:&#34;./Template:Mono&#34;},&#34;params&#34;:{&#34;1&#34;:{&#34;wt&#34;:&#34;Circle.stretchX&#34;}},&#34;i&#34;:0}}]}\" href=\"mw-data:TemplateStyles:r886049734\" id=\"mwYQ\" rel=\"mw-deduplicated-inline-style\" typeof=\"mw:Extension/templatestyles mw:Transclusion\" /></span><span class=\"cx-segment\" data-segmentid=\"69\"><span about=\"#mwt74\" class=\"monospaced\" id=\"mwYg\">Circle.stretchX</span> and <link about=\"#mwt77\" data-mw=\"{&#34;parts&#34;:[{&#34;template&#34;:{&#34;target&#34;:{&#34;wt&#34;:&#34;mono&#34;,&#34;href&#34;:&#34;./Template:Mono&#34;},&#34;params&#34;:{&#34;1&#34;:{&#34;wt&#34;:&#34;Circle.stretchY&#34;}},&#34;i&#34;:0}}]}\" href=\"mw-data:TemplateStyles:r886049734\" id=\"mwYw\" rel=\"mw-deduplicated-inline-style\" typeof=\"mw:Extension/templatestyles mw:Transclusion\" /><span about=\"#mwt77\" class=\"monospaced\" id=\"mwZA\">Circle.stretchY</span> both modify both the X and Y size. </span></p></section><section data-mw-section-number=\"2\" id=\"cxSourceSection20\" rel=\"cx:Section\">\n\n<style about=\"#mwt80\" data-mw=\"{&#34;parts&#34;:[{&#34;template&#34;:{&#34;target&#34;:{&#34;wt&#34;:&#34;Pre&#34;,&#34;href&#34;:&#34;./Template:Pre&#34;},&#34;params&#34;:{&#34;1&#34;:{&#34;wt&#34;:&#34;Circle::stretchX(x) { xSize = ySize = x; }\\nCircle::stretchY(y) { xSize = ySize = y; }&#34;}},&#34;i&#34;:0}}]}\" data-mw-deduplicate=\"TemplateStyles:r1057110237\" id=\"mwZQ\" typeof=\"mw:Extension/templatestyles mw:Transclusion\">.mw-parser-output .pre-borderless{border:none}</style><pre about=\"#mwt80\" class=\"pre\" data-mw=\"{&#34;name&#34;:&#34;pre&#34;,&#34;attrs&#34;:{&#34;class&#34;:&#34;pre&#34;},&#34;body&#34;:{&#34;extsrc&#34;:&#34;Circle::stretchX(x) { xSize = ySize = x; }\\nCircle::stretchY(y) { xSize = ySize = y; }&#34;}}\" id=\"mwZg\" typeof=\"mw:Extension/pre\">Circle::stretchX(x) { xSize = ySize = x; }\nCircle::stretchY(y) { xSize = ySize = y; }</pre>\n\n</section><section data-mw-section-number=\"2\" id=\"cxSourceSection21\" rel=\"cx:Section\"><h4 id=\"84b4e4c973d885eb4445cf468dc1d1\"><span class=\"cx-segment\" data-segmentid=\"70\">Convert the Circle into an Ellipse</span></h4>

Also checked ContentTranslation client errors for ptwiki last 30 days -and, although, the error in the issue might be recorded with different wording, it seems to me that the error was not present.