Page MenuHomePhabricator

Exception "Invalid marker" on edit with unbalanced </translate> tag count
Closed, ResolvedPublic

Description

A user got an exception while trying to edit Wikidata:Glossary on wikidata.org:
Invalid marker: UNIQ6f0f58bb63b1f5f7-languages-0000002F-QIN

Trace: http://p.defau.lt/?dS2GliYRZLbirRpME8TWDA
Text he tried to submit: https://www.wikidata.org/w/index.php?title=User:PinkAmpersand/sandbox&oldid=5661038 (without the <nowiki>)

He had to submit the change to his sandbox with <nowiki> to not trigger the exception while I'm not able to reproduce it at all (I only receive a "Unbalanced </translate> tag." warning).


Version: unspecified
Severity: normal
See Also:
https://bugzilla.wikimedia.org/show_bug.cgi?id=41844
https://bugzilla.wikimedia.org/show_bug.cgi?id=50973
https://bugzilla.wikimedia.org/show_bug.cgi?id=55803

Details

Reference
bz44608

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 22 2014, 1:30 AM
bzimport set Reference to bz44608.
bzimport added a subscriber: Unknown Object (MLST).
hoo created this task.Feb 2 2013, 10:15 PM

Why is this poor Wikidata:Glossary page so unlucky? :/
This was already fixed once...

Pasting stack trace for search purposes.


2013-02-02 21:17:35 mw1066 wikidatawiki: [783f4401] /w/index.php?title=Wikidata:Glossary&action=submit Exception from line 77 of /usr/local/apache/common-local/php-1.21wmf8/includes/parser/StripState.php: Invalid marker:UNIQ6f0f58bb63b1f5f7-languages-0000002F-QIN
#0 /usr/local/apache/common-local/php-1.21wmf8/includes/parser/StripState.php(66): StripState->addItem('general', '^?UNIQ6f0f58bb63...', '<div class="mw-...')
#1 /usr/local/apache/common-local/php-1.21wmf8/includes/parser/Parser.php(3899): StripState->addGeneral('^?UNIQ6f0f58bb63...', '<div class="mw-...')
#2 /usr/local/apache/common-local/php-1.21wmf8/includes/parser/Preprocessor_DOM.php(1151): Parser->extensionSubstitution(Array, Object(PPFrame_DOM))
#3 /usr/local/apache/common-local/php-1.21wmf8/includes/parser/Parser.php(3079): PPFrame_DOM->expand(Object(PPNode_DOM), 0)
#4 /usr/local/apache/common-local/php-1.21wmf8/includes/parser/Parser.php(1150): Parser->replaceVariables('<languages/>?{{...')
#5 /usr/local/apache/common-local/php-1.21wmf8/includes/parser/Parser.php(385): Parser->internalParse('<languages/>?{{...')
#6 /usr/local/apache/common-local/php-1.21wmf8/includes/content/WikitextContent.php(299): Parser->parse('<languages/>?{{...', Object(Title), Object(ParserOptions), true, true, NULL)
#7 /usr/local/apache/common-local/php-1.21wmf8/includes/WikiPage.php(1993): WikitextContent->getParserOutput(Object(Title), NULL, Object(ParserOptions))
#8 /usr/local/apache/common-local/php-1.21wmf8/includes/WikiPage.php(1951): WikiPage->prepareContentForEdit(Object(WikitextContent), NULL, NULL)
#9 [internal function]: WikiPage->prepareTextForEdit('<languages/>?{{...')
#10 /usr/local/apache/common-local/php-1.21wmf8/includes/Article.php(1946): call_user_func_array(Array, Array)
#11 /usr/local/apache/common-local/php-1.21wmf8/extensions/SpamBlacklist/SpamBlacklist_body.php(50): Article->__call('prepareTextForE...', Array)
#12 /usr/local/apache/common-local/php-1.21wmf8/extensions/SpamBlacklist/SpamBlacklist_body.php(50): Article->prepareTextForEdit('<languages/>?{{...')
#13 /usr/local/apache/common-local/php-1.21wmf8/extensions/SpamBlacklist/SpamBlacklistHooks.php(26): SpamBlacklist->filter(Object(Title), '<languages/>?{{...', '', 'c/e', Object(EditPage))
#14 [internal function]: SpamBlacklistHooks::filterMerged(Object(EditPage), '<languages/>?{{...', '', 'c/e')
#15 /usr/local/apache/common-local/php-1.21wmf8/includes/Hooks.php(255): call_user_func_array('SpamBlacklistHo...', Array)
#16 /usr/local/apache/common-local/php-1.21wmf8/includes/GlobalFunctions.php(3871): Hooks::run('EditFilterMerge...', Array)
#17 /usr/local/apache/common-local/php-1.21wmf8/includes/content/ContentHandler.php(1097): wfRunHooks('EditFilterMerge...', Array)
#18 /usr/local/apache/common-local/php-1.21wmf8/includes/EditPage.php(1240): ContentHandler::runLegacyHooks('EditFilterMerge...', Array)
#19 /usr/local/apache/common-local/php-1.21wmf8/includes/EditPage.php(1559): EditPage->runPostMergeFilters(Object(WikitextContent), Object(Status), Object(User))
#20 /usr/local/apache/common-local/php-1.21wmf8/includes/EditPage.php(1141): EditPage->internalAttemptSave(false, false)
#21 /usr/local/apache/common-local/php-1.21wmf8/includes/EditPage.php(396): EditPage->attemptSave()
#22 /usr/local/apache/common-local/php-1.21wmf8/includes/actions/EditAction.php(51): EditPage->edit()
#23 /usr/local/apache/common-local/php-1.21wmf8/includes/actions/EditAction.php(71): EditAction->show()
#24 /usr/local/apache/common-local/php-1.21wmf8/includes/Wiki.php(439): SubmitAction->show()
#25 /usr/local/apache/common-local/php-1.21wmf8/includes/Wiki.php(305): MediaWiki->performAction(Object(Article), Object(Title))
#26 /usr/local/apache/common-local/php-1.21wmf8/includes/Wiki.php(565): MediaWiki->performRequest()
#27 /usr/local/apache/common-local/php-1.21wmf8/includes/Wiki.php(458): MediaWiki->main()
#28 /usr/local/apache/common-local/php-1.21wmf8/index.php(59): MediaWiki->run()
#29 /usr/local/apache/common-local/live-1.5/index.php(3): require('/usr/local/apac...')
#30 {main}

I have no idea what is causing this, so I'm afraid I can't help. It might not be caused by the Translate extension.

pinkampersand.wikimedia wrote:

Well, I just got this error again. Once again I was editing a page that uses the Translate extension, and once again the apparent cause involved the <translate> tags. In this case, I attempted to add anchors to Wikidata:Introduction, but apparently anchors are supposed to go before the tag, not after. The original text I tried to submit can be seen here: https://www.wikidata.org/w/index.php?title=User:PinkAmpersand/sandbox&oldid=6667532. (Like last time, I had to use <nowiki> since it gave me an exception error even in my sandbox - even just previewing it.)

I get the error:"[5d46904e] 2013-02-16 07:06:26: Fatal exception of type MWException", under an "Internal error" header. When I put the {{Anchor}}s on the outside of the tags instead (as shown here: https://www.wikidata.org/w/index.php?title=Wikidata:Introduction&diff=6668008&oldid=6617917) it worked just fine.

(In reply to comment #3)

When I put the {{Anchor}}s on
the outside of the tags instead
it worked just fine.

As the docs say, the Translate extension has a limited tolerance of templates, but this is a simple one. One could also think that it just yells at you (admittedly too loud) to help you avoid very bad ideas like making anchors translatable. (By the way, the marking on that page was not done according to best practice as per docs.)

However, looking at the wikitext I see this:

  • <translate><!--T:16--> {{Anchor|Phase 2}}

Docs say that «The markers are always on the line before the unit», [[mw:Help:Extension:Translate/Page_translation_administration#changes]].
I'm just guessing, but I think you'd need a newline after that <!--T:16-->.

pinkampersand.wikimedia wrote:

(In reply to comment #4)

Yeah in both cases I definitely did make markup mistakes. But I was under the impression that exception errors are basically never supposed to happen, even when you're doing something wrong. Last time there was also the issue that Marius didn't get the same error - I'd be curious to know if this is the case this time too. (IIRC, he tried it on IP as well, and it worked, implying that I'm the exception, rather than the rule.)

Comment 0 is about a different markup error.
I'm not saying that fatals are not a bug, I'm only trying to confirm that it's actually a Translate bug: I think we've established it is for your case, while for hoo's error comment 2 stays for now. Maybe they're related, maybe not: Niklas will tell us if he has more ideas.

Reedy added a comment.Apr 1 2013, 6:59 PM
  • Bug 46758 has been marked as a duplicate of this bug. ***
  • Bug 48697 has been marked as a duplicate of this bug. ***

I cannot reproduce this on my development wiki. Could it have something to do with SpamBlacklist?

  • Bug 50460 has been marked as a duplicate of this bug. ***

I tried with SpamBlacklist locally and still can't reproduce.

Rillke added a comment.Sep 3 2013, 3:16 PM

What Removed Added
Ever confirmed 1

Why was this never confirmed? 3 users are "ever confirmed 0". Nice to learn.

Rillke, that "ever confirmed" is confusing but the status is about the current situation, not the past. And unconfirmed is the bug report i.e. its description (including steps to reproduce), not the existence of a problem.

In short, it only means we need more testing...

  • Bug 54693 has been marked as a duplicate of this bug. ***

I am getting the following error message:

Internal error
[cb5e28e2] 2013-10-06 08:12:04: Fatal exception of type MWException

when saving this edit to https://meta.wikimedia.org/w/index.php?oldid=5952830 :

old text:

[[File:Student contributions to Arabic Wikipedia, 2012-13.png|thumb|420px|Students contributions to the Arabic Wikipedia, 2012-13]]

new text:

</translate>
[[File:Student contributions to Arabic Wikipedia, 2012-13.png|thumb|420px|</translate>Students contributions to the Arabic Wikipedia, 2012-13</translate>]]<translate>

Didn't realize this bug existed.

I think I've managed to figure out/track down this bug. It has to do with cloning the parser in MessageCache, but not updating the parser reference in the preprocesser. See bug 56226

I'm duping this to the newer bug (even though that's not normally done), as there is more technical details on that bug.

  • This bug has been marked as a duplicate of bug 56226 ***

Very nice work, Brian!

  • Bug 55803 has been marked as a duplicate of this bug. ***