MediaWiki content gone, "History" shows DBQueryError

I had a MediaWiki site and sometime recently (last week?) the content disappeared. When I click on History I see the following information:

A database query error has occurred. This may indicate a bug in the software.
… Fatal exception of type “Wikimedia\Rdbms\DBQueryError”`

Note that this was before I updated to v. 21.7 (see Upgrade to Bullseye - #22 by dgj), although it appears to be a very recent issue.

Any help with solving the issue? Also, is there any way to locate and backup the missing content so it is not lost forever?

I don’t think this is a general issue with upgrading to 1.35, since I have a MediaWiki instance on Debian testing which is already at that version.

Usually on upgrade of a MediaWiki version, Debian expects the system administrator to run a maintenance script called update.php. FreedomBox has been doing this for each MediaWiki version by incrementing the version number of the app, thus triggering the app’s setup to run again. We didn’t do this yet for the 1.35 upgrade.

You can always find the files that need to be backed up in the app module’s manifest.py file. In case of MediaWiki, the database is a single SQLite file. (I just noticed that uploaded images are not in the list of directories to backup :open_mouth:)

First check if the package mediawiki has a broken install. If that’s the case, you can try to fix it using apt -f install, otherwise try reinstalling MediaWiki. If you need to purge the package, take a manual backup of /var/lib/mediawiki/images.

Thank you @njoseph! I followed the reinstallation instructions like so:

$ sudo apt remove mediawiki && sudo echo "delete from plinth_module where name='mediawiki';" | sudo sqlite3 /var/lib/plinth/plinth.sqlite3

I then reinstalled in the Plinth interface and everything seems to work again.

Although I did a backup of /var/lib/mediawiki-db/my_wiki.sqlite, it was not needed.

Edited to add: For others who have a similar problem, note that in the Plinth interface MediaWiki was still listed under the installed apps, but when I clicked on the icon the option to (re)install was available.

1 Like