Page MenuHomePhabricator

Need Math extension for Mediawiki 1.33.4
Closed, InvalidPublic


When trying to install the the download offers MediaWiki 1.31 MediaWiki 1.34 and 1.35 next stable candidate as well as development version.

For my Mediawiki 1.33. i tried the 1.31 and 1.34 version with the LocalSettings.php entry:

wfLoadExtension( 'Math' );
$wgDefaultUserOptions['math'] = 'latexml';
$wgMathLaTeXMLUrl = ''; // Sponsored by

and created a test page:

Try out 
== Cross Entropy ==
taken from
The cross entropy of the distribution <math>q</math>  relative to a distribution <math>p</math> over a given set is defined as follows:

:<math>H(p, q) = -\operatorname{E}_p[\log q]</math>,
The cross entropy of the distribution <math>q</math>  relative to a distribution <math>p</math> over a given set is defined as follows:

:<math>H(p, q) = -\operatorname{E}_p[\log q]</math>,

on save of the testpage i get the error message below which i can't decipher.

What would be a workaround to get the Math extension working while i am waiting for MediaWiki 1.35 LTS to be available?

Migrating to a MW 1.33+ version is unfortunatly not an option since MW 1.34 breaks to many extensions that are essential for my usecases and I can't afford the migration effort multiple times per year.

Error message:

A database query error has occurred. This may indicate a bug in the software.


#0 /var/www/mediawiki/code/includes/libs/rdbms/database/Database.php(1561): Wikimedia\Rdbms\Database->getQueryExceptionAndLog(string, integer, string, string)
#1 /var/www/mediawiki/code/includes/libs/rdbms/database/Database.php(1279): Wikimedia\Rdbms\Database->reportQueryError(string, integer, string, string, boolean)
#2 /var/www/mediawiki/code/includes/libs/rdbms/database/Database.php(1789): Wikimedia\Rdbms\Database->query(string, string)
#3 /var/www/mediawiki/code/includes/libs/rdbms/database/Database.php(1880): Wikimedia\Rdbms\Database->select(string, array, array, string, array, array)
#4 /var/www/mediawiki/code/extensions/Math/src/MathRenderer.php(275): Wikimedia\Rdbms\Database->selectRow(string, array, array, string)
#5 /var/www/mediawiki/code/extensions/Math/src/MathRenderer.php(619): MathRenderer->readFromDatabase()
#6 /var/www/mediawiki/code/extensions/Math/src/MathHooks.php(208): MathRenderer->checkTeX()
#7 /var/www/mediawiki/code/extensions/Math/src/MathHooks.php(195): MathHooks::mathPostTagHook(MathLaTeXML, Parser)
#8 /var/www/mediawiki/code/includes/parser/Parser.php(4000): MathHooks::mathTagHook(string, array, Parser, PPFrame_DOM)
#9 /var/www/mediawiki/code/includes/parser/Preprocessor_DOM.php(1370): Parser->extensionSubstitution(array, PPFrame_DOM)
#10 /var/www/mediawiki/code/includes/parser/Parser.php(3049): PPFrame_DOM->expand(DOMElement, integer)
#11 /var/www/mediawiki/code/includes/parser/Parser.php(1359): Parser->replaceVariables(string)
#12 /var/www/mediawiki/code/includes/parser/Parser.php(491): Parser->internalParse(string)
#13 /var/www/mediawiki/code/includes/content/WikitextContent.php(369): Parser->parse(string, Title, ParserOptions, boolean, boolean, NULL)
#14 /var/www/mediawiki/code/includes/content/AbstractContent.php(555): WikitextContent->fillParserOutput(Title, NULL, ParserOptions, boolean, ParserOutput)
#15 /var/www/mediawiki/code/includes/Revision/RenderedRevision.php(265): AbstractContent->getParserOutput(Title, NULL, ParserOptions, boolean)
#16 /var/www/mediawiki/code/includes/Revision/RenderedRevision.php(234): MediaWiki\Revision\RenderedRevision->getSlotParserOutputUncached(WikitextContent, boolean)
#17 /var/www/mediawiki/code/includes/Revision/RevisionRenderer.php(193): MediaWiki\Revision\RenderedRevision->getSlotParserOutput(string)
#18 /var/www/mediawiki/code/includes/Revision/RevisionRenderer.php(142): MediaWiki\Revision\RevisionRenderer->combineSlotOutput(MediaWiki\Revision\RenderedRevision, array)
#19 [internal function]: MediaWiki\Revision\RevisionRenderer->MediaWiki\Revision\{closure}(MediaWiki\Revision\RenderedRevision, array)
#20 /var/www/mediawiki/code/includes/Revision/RenderedRevision.php(197): call_user_func(Closure, MediaWiki\Revision\RenderedRevision, array)
#21 /var/www/mediawiki/code/includes/Storage/DerivedPageDataUpdater.php(1276): MediaWiki\Revision\RenderedRevision->getRevisionParserOutput()
#22 /var/www/mediawiki/code/includes/Storage/PageUpdater.php(725): MediaWiki\Storage\DerivedPageDataUpdater->getCanonicalParserOutput()
#23 /var/www/mediawiki/code/includes/page/WikiPage.php(1915): MediaWiki\Storage\PageUpdater->saveRevision(CommentStoreComment, integer)
#24 /var/www/mediawiki/code/includes/EditPage.php(2294): WikiPage->doEditContent(WikitextContent, CommentStoreComment, integer, boolean, User, string, array, integer)
#25 /var/www/mediawiki/code/includes/EditPage.php(1586): EditPage->internalAttemptSave(array, boolean)
#26 /var/www/mediawiki/code/includes/EditPage.php(687): EditPage->attemptSave(array)
#27 /var/www/mediawiki/code/includes/actions/EditAction.php(60): EditPage->edit()
#28 /var/www/mediawiki/code/includes/actions/SubmitAction.php(38): EditAction->show()
#29 /var/www/mediawiki/code/includes/MediaWiki.php(499): SubmitAction->show()
#30 /var/www/mediawiki/code/includes/MediaWiki.php(294): MediaWiki->performAction(Article, Title)
#31 /var/www/mediawiki/code/includes/MediaWiki.php(865): MediaWiki->performRequest()
#32 /var/www/mediawiki/code/includes/MediaWiki.php(515): MediaWiki->main()
#33 /var/www/mediawiki/code/index.php(42): MediaWiki->run()
#34 {main}

Related Objects

Event Timeline

Seppl2013 updated the task description. (Show Details)

Suggest declining, MediaWiki 1.33 is no longer supported (T256087: Formally EOL REL1_33) which is why the 1.33 version of the extension was removed from the download options

I am not asking for a solution but a work-around. And it would be good if such situations could be avoided in the future by proper impact analysis which extensions break on API changes and not doing API changes with too much impact.

Seppl2013 claimed this task.
Aklapper changed the task status from Resolved to Invalid.Sep 5 2020, 12:11 PM

I am not asking for a solution but a work-around.

For future reference, please ask in a support forum if this is not a bug report or feature request - thanks!

The issue here is the undecipherable error message. Since the invalid status of this task is only based on the version MW 1.33.4 that i was trying things out on is EOL. It's not clear whether the error message has been improved so that "normal" people would understand what the real problem is in more recent versions of MW. I tried out different git states yesterday and always go the same error message so that i assume there is a "real" issue behind this task. It's just that the rules within MediaWiki foundation are such that the followup will not happen immediately for this task as it's reported based on a MW 1.33.4 experience. So i think it's good to have this task for reference so that other users that might run into a similar situation can reference it. Even the hint for the workaround - was a bit hidden in the documentation.

I therefore changed:

to make hints for alternatives and workarounds more easily accessible.
I'll get back to this issues as soon as MW 1.35 LTS is out and I am going to try to install the Math extension again.

@Seppl2013: Thanks! If the issue is the error message then this was not clear, plus this task unfortunately does not follow and lists no actual outcome and expected outcome. Please follow that scheme if possible.
Need Math extension for Mediawiki 1.33.4 is a different issue compared to a task named Unhelpful error message "A database query error has occurred. This may indicate a bug in the software." or such (which would be a feature request for Wikimedia-Rdbms, to provide more specific error messages if feasible).
That error message above comes from databaseerror-text and is defined in and I'm not sure how much error handling could be improved (info passed from the DB layer).
But that's not what this task is about; this task was about making Math work and not about improving a quite generic error message.