Page MenuHomePhabricator

Fatal Exception when creating MathML output
Closed, ResolvedPublic0 Story Points

Description

On the English Wikisource, if math display preferences are set to MathML, this revision: https://en.wikisource.org/w/index.php?title=User:Beleg_T%C3%A2l/Sandbox&oldid=6026384 creates "[61c72485] 2015-12-24 14:38:42: Fatal exception of type "MWException"". If math preferences are set to PNG, it displays correctly.

The issue seems to be identical to T121763, however unlike T121763 this issue occurs even if there is no \binom in a subscript.

Event Timeline

beleg_tal raised the priority of this task from to Needs Triage.
beleg_tal updated the task description. (Show Details)
beleg_tal added a project: Wikisource.
beleg_tal added a subscriber: beleg_tal.
Restricted Application added subscribers: StudiesWorld, Aklapper. · View Herald TranscriptDec 24 2015, 2:40 PM
beleg_tal renamed this task from Beleg Tâl to Fatal Exception when creating MathML output.Dec 24 2015, 2:40 PM
beleg_tal set Security to None.
Physikerwelt added a subscriber: Physikerwelt.

That's strange the only math tag I can find is
<math>x</math>

Really strange indeed, I can't reproduce it locally, but on enwiki gives the same result at reported.

@mobrovac: Can you get access to the logs? Maybe wikisource has a special configuration.

Billinghurst added a subscriber: Billinghurst.EditedDec 26 2015, 11:55 AM

Our special:version should show any extension differences (there are a few), and the conf shows config differences.

  • same issue at fr.wikisource
  • NO issue at mul.wikisource

We have a test wikisource somewhere

the same issue on pl ws.

I have no idea how to proceed. Maybe it's related to the visualeditor restbase configuration?

Glaisher triaged this task as High priority.Dec 27 2015, 3:45 AM

I have no idea how to proceed. Maybe it's related to the visualeditor restbase configuration?

Could someone from Wikimedia-production-error provide the stack trace here?

I have no idea how to proceed. Maybe it's related to the visualeditor restbase configuration?

Is there an easy means to compare enWS and mulWS configs to spot difference? Neither should have visualeditor.

I have no idea how to proceed. Maybe it's related to the visualeditor restbase configuration?

Is there an easy means to compare enWS and mulWS configs to spot difference? Neither should have visualeditor.

Understanding multilingual wikisource configuration is a pain because the software considers it to be a wikipedia:

krenair@tin:~$ mwscript eval.php sourceswiki
> var_dump( $site );
string(9) "wikipedia"

> var_dump( $wgServer );
string(16) "//wikisource.org"

Because DB name is 'sourceswiki' instead of ending in 'wikisource' like the others. I really wish we could rename wiki databases sanely. And I'd like to drop the 'wiki' suffix in favour of 'wikipedia' for the wikipedias, but that's a huge deal compared to just fixing wikisource.org.

Now, UseVisualEditor is set like this:

'default' => true,
'nonbetafeatures' => false,

'wikisource' => false,  # Paused until ProofreadPage integration is good to go
'wiktionary' => false,  # Paused until template editing is more tightly integrated
'frwiktionary' => true, # Per community request
'svwiktionary' => true, # Per community request

Which means it has VE enabled.

I have no idea how to proceed. Maybe it's related to the visualeditor restbase configuration?

Could someone from Wikimedia-production-error provide the stack trace here?

I looked up the exception thrown here (61c72485) in fluorine:/a/mw-log/archive/exception.log-20151225.gz:

2015-12-24 14:38:42 mw1070 enwikisource exception ERROR: [61c72485] /w/index.php?title=User:Beleg_T%C3%A2l/Sandbox&oldid=6026384   MWException from line 175 of /srv/mediawiki/php-1.27.0-wmf.9/extensions/Math/MathRestbaseInterface.php: Math extension can not find Restbase URL. Please specify $wgMathFullRestbaseURL. {"exception_id":"61c72485"} 
[Exception MWException] (/srv/mediawiki/php-1.27.0-wmf.9/extensions/Math/MathRestbaseInterface.php:175) Math extension can not find Restbase URL. Please specify $wgMathFullRestbaseURL.
  #0 /srv/mediawiki/php-1.27.0-wmf.9/extensions/Math/MathRestbaseInterface.php(251): MathRestbaseInterface->getUrl(string, boolean)
  #1 /srv/mediawiki/php-1.27.0-wmf.9/extensions/Math/MathMathML.php(102): MathRestbaseInterface->getFullSvgUrl()
  #2 /srv/mediawiki/php-1.27.0-wmf.9/extensions/Math/Math.hooks.php(204): MathMathML->render()
  #3 /srv/mediawiki/php-1.27.0-wmf.9/includes/parser/Parser.php(4249): MathHooks::mathTagHook(string, array, Parser)
  #4 /srv/mediawiki/php-1.27.0-wmf.9/includes/parser/Preprocessor_Hash.php(1134): Parser->extensionSubstitution(array, PPFrame_Hash)
  #5 /srv/mediawiki/php-1.27.0-wmf.9/includes/parser/Parser.php(3353): PPFrame_Hash->expand(PPNode_Hash_Tree, integer)
  #6 /srv/mediawiki/php-1.27.0-wmf.9/includes/parser/Parser.php(1244): Parser->replaceVariables(string)
  #7 /srv/mediawiki/php-1.27.0-wmf.9/includes/parser/Parser.php(441): Parser->internalParse(string)
  #8 /srv/mediawiki/php-1.27.0-wmf.9/includes/content/WikitextContent.php(331): Parser->parse(string, Title, ParserOptions, boolean, boolean, integer)
  #9 /srv/mediawiki/php-1.27.0-wmf.9/includes/content/AbstractContent.php(497): WikitextContent->fillParserOutput(Title, integer, ParserOptions, boolean, ParserOutput)
  #10 /srv/mediawiki/php-1.27.0-wmf.9/includes/poolcounter/PoolWorkArticleView.php(140): AbstractContent->getParserOutput(Title, integer, ParserOptions)
  #11 /srv/mediawiki/php-1.27.0-wmf.9/includes/poolcounter/PoolCounterWork.php(123): PoolWorkArticleView->doWork()
  #12 /srv/mediawiki/php-1.27.0-wmf.9/includes/page/Article.php(676): PoolCounterWork->execute()
  #13 /srv/mediawiki/php-1.27.0-wmf.9/includes/actions/ViewAction.php(44): Article->view()
  #14 /srv/mediawiki/php-1.27.0-wmf.9/includes/MediaWiki.php(489): ViewAction->show()
  #15 /srv/mediawiki/php-1.27.0-wmf.9/includes/MediaWiki.php(286): MediaWiki->performAction(Article, Title)
  #16 /srv/mediawiki/php-1.27.0-wmf.9/includes/MediaWiki.php(731): MediaWiki->performRequest()
  #17 /srv/mediawiki/php-1.27.0-wmf.9/includes/MediaWiki.php(506): MediaWiki->main()
  #18 /srv/mediawiki/php-1.27.0-wmf.9/index.php(43): MediaWiki->run()
  #19 /srv/mediawiki/w/index.php(3): include(string)
  #20 {main}

@Physikerwelt, does the math extension rely on VisualEditor settings? If so, then that would probably fail for wikisource.

Krenair added a comment.EditedDec 28 2015, 10:48 PM

The relevant code (well, mostly a comment) is https://phabricator.wikimedia.org/diffusion/EMAT/browse/master/MathRestbaseInterface.php;5d837f1af391b3386f3bbbb2ecb3dd064d0ea306$141-175
It tries it's own config setting (which I think Wikimedia sites just don't use) and then attempts to fall back through VisualEditor's identical setting, but of course that's not set up either (we don't set it for wikis where either there's no VE or we don't want the VE client accessing RESTBase directly, e.g. private wikis).

GWicke added a comment.EditedDec 28 2015, 10:48 PM

Which means it has VE enabled.

IIRC, the 'wikisource' in this config is a reference to a group rather than a db name. I don't see any VE preferences on wikisource, so am assuming that VE is disabled as intended.

Krenair added a comment.EditedDec 28 2015, 10:52 PM

Which means it has VE enabled.

IIRC, the 'wikisource' in this config is a reference to a group rather than a db name. I don't see any VE preferences on wikisource, so am assuming that VE is disabled as intended.

I should ask you to read the rest of the comment, but really, you have access to this as well:

krenair@tin:~$ mwscript eval.php sourceswiki
> var_dump( $wmgUseVisualEditor );
bool(true)

You'll find it listed at https://wikisource.org/wiki/Special:Preferences#mw-prefsection-betafeatures too.

@Krenair: I guess the question is whether English Wikisource has a dbname of 'enwikisource', or 'sourceswiki'.

@Krenair: I guess the question is whether English Wikisource has a dbname of 'enwikisource', or 'sourceswiki'.

I was discussing sourceswiki, which has VE enabled, and therefore the Math extension works there. The Math extension has issues on other wikisources (yes, including enwikisource) because VE is not enabled and therefore it does not know how to connect to RESTBase.

So we just need to set up RESTBase config for Math? (and probably disable VE at mulWS?)

Change 261321 had a related patch set uploaded (by Glaisher):
Set $wgMathFullRestbaseURL so that MathML works even if VE is disabled

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

Change 261321 merged by jenkins-bot:
Set $wgMathFullRestbaseURL so that MathML works even if VE is disabled

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

@Reedy was kind enough to deploy it today and all seems to be fine after deploying.

Glaisher closed this task as Resolved.Dec 29 2015, 12:26 PM
Glaisher claimed this task.

Now works for me. :-)

works fine, thanks.

Zdzislaw removed a subscriber: Zdzislaw.Dec 29 2015, 8:25 PM

Thank you all!

Jdforrester-WMF set the point value for this task to 0.Jan 14 2017, 3:35 AM
mmodell changed the subtype of this task from "Task" to "Production Error".Aug 28 2019, 11:11 PM
Restricted Application added a project: User-Ryasmeen. · View Herald TranscriptAug 28 2019, 11:11 PM