Page MenuHomePhabricator

MathRestbaseInterface.php: TeX input is invalid.
Open, Needs TriagePublic

Description

Tried getting a nice math-visualization working in MediaWiki and been at it for quite some time now, but I can't get it to work. I have a completely fresh MediaWiki-install with downloaded math-extension, rerun the config to get the math-database-tables recreated and and am stuck with the below error on the "Special-pages: Math status".

Also, when adding following entries to the LocalSettings.php and then having a wiki-page with a <math>x^2</math> block the page remains empty on saving (and isn't saved).

LocalSettings.php
$wgDefaultUserOptions['math'] = 'mathml';
$wgMathFullRestbaseURL= 'https://api.formulasearchengine.com/';

Any ideas on how to get this working? Thanks for any hints !

MediaWiki internal error. Exception caught inside exception handler.
Set $wgShowDBErrorBacktrace = true; at the bottom of LocalSettings.php to show detailed debugging information

When setting $wgShowDBErrorBacktrace the page just gets stuck and doesn't report anything else (remains blank)

[7279738c839cdf960741c4f5] /index.php?title=Special:MathStatus MWException from line 104 of /volume1/web/wiki-dev2/extensions/Math/MathRestbaseInterface.php: TeX input is invalid.

Backtrace:

#0 /volume1/web/wiki-dev2/extensions/Math/MathRestbaseInterface.php(395): MathRestbaseInterface->calculateHash()
#1 /volume1/web/wiki-dev2/extensions/Math/MathRestbaseInterface.php(95): MathRestbaseInterface->getContentRequest(string)
#2 /volume1/web/wiki-dev2/extensions/Math/MathRestbaseInterface.php(224): MathRestbaseInterface->getContent(string)
#3 /volume1/web/wiki-dev2/extensions/Math/MathRenderer.php(657): MathRestbaseInterface->getSvg()
#4 /volume1/web/wiki-dev2/extensions/Math/MathMathML.php(357): MathRenderer->getSvg()
#5 /volume1/web/wiki-dev2/extensions/Math/MathMathML.php(398): MathMathML->correctSvgStyle(NULL)
#6 /volume1/web/wiki-dev2/extensions/Math/MathMathML.php(466): MathMathML->getFallbackImage()
#7 /volume1/web/wiki-dev2/extensions/Math/SpecialMathStatus.php(70): MathMathML->getHtmlOutput()
#8 /volume1/web/wiki-dev2/extensions/Math/SpecialMathStatus.php(52): SpecialMathStatus->testSpecialCaseText()
#9 /volume1/web/wiki-dev2/extensions/Math/SpecialMathStatus.php(42): SpecialMathStatus->runMathMLTest(string)
#10 /volume1/web/wiki-dev2/includes/specialpage/SpecialPage.php(522): SpecialMathStatus->execute(NULL)
#11 /volume1/web/wiki-dev2/includes/specialpage/SpecialPageFactory.php(577): SpecialPage->run(NULL)
#12 /volume1/web/wiki-dev2/includes/MediaWiki.php(283): SpecialPageFactory::executePath(Title, RequestContext)
#13 /volume1/web/wiki-dev2/includes/MediaWiki.php(851): MediaWiki->performRequest()
#14 /volume1/web/wiki-dev2/includes/MediaWiki.php(512): MediaWiki->main()
#15 /volume1/web/wiki-dev2/index.php(43): MediaWiki->run()
#16 {main}

Event Timeline

thcipriani added a subscriber: thcipriani.

This also happens in Wikimedia production today. Should this raise an exception on bad user input (if I'm reading this right)?

This also happens in Wikimedia production today. Should this raise an exception on bad user input (if I'm reading this right)?

Where can one see this. To me https://en.wikipedia.org/wiki/Special:MathStatus looks ok despite the known problem of:
Test Comparing the generated SVG with the reference failed.

Still seen in production in Logstash, on several wikis, same as before.

I am working on a rendering method without restbase T255808. This would allow for a more fine grained error reporting so, that we can find the root cause of the issue. Now we only know that some invalid tex code was not filtered by texvcjs, but we don't know which input it was.

Still appearing in our logs for 1.37.0-wmf.12 (cc T281153).