Exception for logged-in wiki users on pages containing MathML

wiki
math
Tags: #<Tag:0x00007fb87a78da90> #<Tag:0x00007fb87a78d950>

#1

This issue was discussed previously on Gitter, but I now encountered it again on the Ridge Detection page.

That page (and any page containing some MathML) renders fine when you’re not logged in to the wiki. But once you log in and want to access the page, the following exception is thrown:

MediaWiki internal error.

Original exception: [82ea6cbd745a30969e125802] /Ridge_Detection MWException from line 200 of /var/www/vhosts/imagej.net/httpdocs/extensions/Math/MathRestbaseInterface.php: Math extension can not find Restbase URL. Please specify $wgMathFullRestbaseURL.
Backtrace:
#0 /var/www/vhosts/imagej.net/httpdocs/extensions/Math/MathRestbaseInterface.php(339): MathRestbaseInterface->getUrl(string)
#1 /var/www/vhosts/imagej.net/httpdocs/extensions/Math/MathRestbaseInterface.php(138): MathRestbaseInterface->getCheckRequest()
#2 /var/www/vhosts/imagej.net/httpdocs/extensions/Math/Math.hooks.php(385): MathRestbaseInterface::batchEvaluate(array)
#3 /var/www/vhosts/imagej.net/httpdocs/includes/Hooks.php(195): MathHooks::onParserAfterTidy(Parser, string)
#4 /var/www/vhosts/imagej.net/httpdocs/includes/parser/Parser.php(1363): Hooks::run(string, array)
#5 /var/www/vhosts/imagej.net/httpdocs/includes/parser/Parser.php(435): Parser->internalParseHalfParsed(string, boolean, boolean)
#6 /var/www/vhosts/imagej.net/httpdocs/includes/content/WikitextContent.php(331): Parser->parse(string, Title, ParserOptions, boolean, boolean, integer)
#7 /var/www/vhosts/imagej.net/httpdocs/includes/content/AbstractContent.php(497): WikitextContent->fillParserOutput(Title, integer, ParserOptions, boolean, ParserOutput)
#8 /var/www/vhosts/imagej.net/httpdocs/includes/poolcounter/PoolWorkArticleView.php(139): AbstractContent->getParserOutput(Title, integer, ParserOptions)
#9 /var/www/vhosts/imagej.net/httpdocs/includes/poolcounter/PoolCounterWork.php(123): PoolWorkArticleView->doWork()
#10 /var/www/vhosts/imagej.net/httpdocs/includes/page/Article.php(666): PoolCounterWork->execute()
#11 /var/www/vhosts/imagej.net/httpdocs/includes/actions/ViewAction.php(44): Article->view()
#12 /var/www/vhosts/imagej.net/httpdocs/includes/MediaWiki.php(504): ViewAction->show()
#13 /var/www/vhosts/imagej.net/httpdocs/includes/MediaWiki.php(288): MediaWiki->performAction(Article, Title)
#14 /var/www/vhosts/imagej.net/httpdocs/includes/MediaWiki.php(746): MediaWiki->performRequest()
#15 /var/www/vhosts/imagej.net/httpdocs/includes/MediaWiki.php(520): MediaWiki->main()
#16 /var/www/vhosts/imagej.net/httpdocs/index.php(43): MediaWiki->run()
#17 {main}

Exception caught inside exception handler: [82ea6cbd745a30969e125802] /Ridge_Detection MWException from line 200 of /var/www/vhosts/imagej.net/httpdocs/extensions/Math/MathRestbaseInterface.php: Math extension can not find Restbase URL. Please specify $wgMathFullRestbaseURL.
Backtrace:
#0 /var/www/vhosts/imagej.net/httpdocs/extensions/Math/MathRestbaseInterface.php(339): MathRestbaseInterface->getUrl(string)
#1 /var/www/vhosts/imagej.net/httpdocs/extensions/Math/MathRestbaseInterface.php(138): MathRestbaseInterface->getCheckRequest()
#2 /var/www/vhosts/imagej.net/httpdocs/extensions/Math/Math.hooks.php(385): MathRestbaseInterface::batchEvaluate(array)
#3 /var/www/vhosts/imagej.net/httpdocs/includes/Hooks.php(195): MathHooks::onParserAfterTidy(Parser, string)
#4 /var/www/vhosts/imagej.net/httpdocs/includes/parser/Parser.php(1363): Hooks::run(string, array)
#5 /var/www/vhosts/imagej.net/httpdocs/includes/parser/Parser.php(435): Parser->internalParseHalfParsed(string, boolean, boolean)
#6 /var/www/vhosts/imagej.net/httpdocs/includes/cache/MessageCache.php(1103): Parser->parse(string, Title, ParserOptions, boolean)
#7 /var/www/vhosts/imagej.net/httpdocs/includes/Message.php(1134): MessageCache->parse(string, Title, boolean, boolean, Language)
#8 /var/www/vhosts/imagej.net/httpdocs/includes/Message.php(817): Message->parseText(string)
#9 /var/www/vhosts/imagej.net/httpdocs/includes/Message.php(873): Message->toString()
#10 /var/www/vhosts/imagej.net/httpdocs/includes/skins/Skin.php(620): Message->parse()
#11 /var/www/vhosts/imagej.net/httpdocs/includes/skins/SkinTemplate.php(459): Skin->printSource()
#12 /var/www/vhosts/imagej.net/httpdocs/includes/skins/SkinTemplate.php(246): SkinTemplate->prepareQuickTemplate(OutputPage)
#13 /var/www/vhosts/imagej.net/httpdocs/includes/OutputPage.php(2324): SkinTemplate->outputPage()
#14 /var/www/vhosts/imagej.net/httpdocs/includes/exception/MWException.php(204): OutputPage->output()
#15 /var/www/vhosts/imagej.net/httpdocs/includes/exception/MWException.php(244): MWException->reportHTML()
#16 /var/www/vhosts/imagej.net/httpdocs/includes/exception/MWExceptionHandler.php(69): MWException->report()
#17 /var/www/vhosts/imagej.net/httpdocs/includes/exception/MWExceptionHandler.php(180): MWExceptionHandler::report(MWException)
#18 /var/www/vhosts/imagej.net/httpdocs/includes/MediaWiki.php(529): MWExceptionHandler::handleException(MWException)
#19 /var/www/vhosts/imagej.net/httpdocs/index.php(43): MediaWiki->run()
#20 {main}

This is independent of the browser, I tested with Firefox and Chrome (on Windows).

Can anyone reproduce? @aneevel did you get any more insights since we last discussed this?


#2

I am unable to reproduce today on the Ridge Detection page.

Is this still happening on your end, @imagejan?


#3

Yes, I just reproduced it: fine when logged off, exception when logged on with my account ‘Eglinger’ on the wiki, and Firefox on Mac OSX.

EDIT: it seems to be account-specific, as it works well with the other account I tried, ‘Angiogenesis’.


#4

Several others here at the hackathon (@haesleinhuepf, @tpietzsch, @skalarproduktraum) also report that it works for them. Strange.


#5

Thanks all for testing. Now that I knew that the issue was account-related, I tried to reset my preferences in the wiki account, and indeed that seems to have solved the issue :slight_smile:

After investigating a bit further, I found that the default setting for Math rendering is PNG images, and switching it to use MathML with SVG or PNG fallback reliably triggers the issue again (in case someone cares to try to reproduce).


#6

Thanks for the detective work, @imagejan. Looking at the Math extension page, I am sad to see that they had a client-side MathJax renderer, but it is now deprecated. It seems that using the MathML option requires a mathoid server.

I tried adding the following to LocalSettings.php:

$wgMathFullRestbaseURL= 'https://api.formulasearchengine.com/';

But it did not work; the MathML setting then produces blank pages with no error in the Apache log.

I tried adding this instead:

$wgMathValidModes = array( 'png' );

But it did not work; the MathML option is still available.

I tried hiding the MathML option via edits to MediaWiki:Common.css, but it did not work: the MathML option does not disappear.

So for now I give up—please simply avoid choosing that option.