Page MenuHomePhabricator

Subst'ing a template that introduces nested translate tags causes an unhandled TPException
Closed, DeclinedPublicPRODUCTION ERROR

Event Timeline

Here's the full error message from the Logstash index:

exception.message
[WYVHWgpAMEoAALD5yGsAAAAE] /w/index.php?title=**&target=**&do=mark   TPException from line 314 of /srv/mediawiki/php-1.30.0-wmf.12/extensions/Translate/tag/TranslatablePage.php: Nested <translate> translation units are not allowed.
Tag text: <pre>
== Further reading == 

...

* ''[<tvar|<translate>

== Overview == 
</pre>
exception.trace
#0 /srv/mediawiki/php-1.30.0-wmf.12/extensions/Translate/tag/SpecialPageTranslation.php(583): TranslatablePage->getParse()
#1 /srv/mediawiki/php-1.30.0-wmf.12/extensions/Translate/tag/SpecialPageTranslation.php(217): SpecialPageTranslation->checkInput(TranslatablePage, boolean)
#2 /srv/mediawiki/php-1.30.0-wmf.12/extensions/Translate/tag/SpecialPageTranslation.php(75): SpecialPageTranslation->onActionMark(Title, integer)
#3 /srv/mediawiki/php-1.30.0-wmf.12/includes/specialpage/SpecialPage.php(522): SpecialPageTranslation->execute(NULL)
#4 /srv/mediawiki/php-1.30.0-wmf.12/includes/specialpage/SpecialPageFactory.php(578): SpecialPage->run(NULL)
#5 /srv/mediawiki/php-1.30.0-wmf.12/includes/MediaWiki.php(287): SpecialPageFactory::executePath(Title, RequestContext)
#6 /srv/mediawiki/php-1.30.0-wmf.12/includes/MediaWiki.php(868): MediaWiki->performRequest()
#7 /srv/mediawiki/php-1.30.0-wmf.12/includes/MediaWiki.php(523): MediaWiki->main()
#8 /srv/mediawiki/php-1.30.0-wmf.12/index.php(43): MediaWiki->run()
#9 /srv/mediawiki/w/index.php(3): include(string)
#10 {main}
Reedy subscribed.

So the page on meta needs fixing... And this really needs better handling in Translate

Generally, when you try to save a page with nested translate tags, the fail saves and it tells you not to do that. However, if you subst a template with translate tags, and have that template substitution take place between another set of translate tags, somehow this check is bypassed and the page save happens, but nested translate tags are nonetheless not allowed, so it triggers this exception. So we just need to add another check for nested translate tags.

It's possible to catch the exception when marking page for translation. But how would I detected the nested tags before the page is saved?

Nikerabbit renamed this task from Translate extension on Meta: Fatal exception of type TPException to Substing a template that introduces nested translate tags causes an unhandled TPException.Jun 26 2018, 2:57 PM
Krinkle renamed this task from Substing a template that introduces nested translate tags causes an unhandled TPException to Subst'ing a template that introduces nested translate tags causes an unhandled TPException.Aug 14 2018, 5:27 PM

This open issue about a PHP error in production did not have a team attached yet. I've tagged it based on Maintainers. Feel free to forward elsewhere if needed.

Closing for now as there are zero occurrences of this in the last 30 days in Logstash, and I also could not reproduce it myself on mediawiki.org.

mmodell changed the subtype of this task from "Task" to "Production Error".Aug 28 2019, 11:10 PM