Topic on Project:Support desk

Jump to navigation Jump to search

Error showing "history" and saving edits.

11
Cesarinik (talkcontribs)

Due to necessity to move it, I exported and restored the db via PMA. Now the public side of the website works, but on every page when I click on "history/view-source" a red Error page is shown. Same thing when I edit a page: the edit page with the page text is showed but error occur when I try to save.

If I try to run update.php this is what I get:


MediaWiki 1.33.0 Updater

Your composer.lock file is up to date with current dependencies!

Going to run database updates for wikidonca-wiki_

Depending on the size of your database this may take a while!

Abort with control-c in the next five seconds (skip this countdown with --quick) ... 5�4�3�2�1�0

Turning off Content Handler DB fields for this part of upgrade.

...have ipb_id field in ipblocks table.

...have ipb_expiry field in ipblocks table.

...already have interwiki table

Updating indexes to 20031107 ...[549f3c93e7aed9a85c8f1ecc] [no req] RuntimeException from line 4356 of /home/wikidonca/public_html/includes/libs/rdbms/database/Database.php: Could not open "patch-indexes.sql".

Backtrace:

#0 /home/wikidonca/public_html/includes/installer/DatabaseUpdater.php(690): Wikimedia\Rdbms\Database->sourceFile(string)

#1 /home/wikidonca/public_html/includes/installer/MysqlUpdater.php(471): DatabaseUpdater->applyPatch(string, boolean, string)

#2 /home/wikidonca/public_html/includes/installer/DatabaseUpdater.php(489): MysqlUpdater->doIndexUpdate()

#3 /home/wikidonca/public_html/includes/installer/DatabaseUpdater.php(453): DatabaseUpdater->runUpdates(array, boolean)

#4 /home/wikidonca/public_html/maintenance/update.php(203): DatabaseUpdater->doUpdates(array)

#5 /home/wikidonca/public_html/maintenance/doMaintenance.php(96): UpdateMediaWiki->execute()

#6 /home/wikidonca/public_html/maintenance/update.php(266): require_once(string)

#7 {main}


About 40 days ago I encounter a similiar error when I upgraded to 1.33 that I solved with a little of work running several times "update.php" meanwhile I was cleaning user/actor tables from deleted users (spam accounts registered and blocked in 2016) that were generating errors in migration between tables.

How can I solve now? If can be useful to know, I ran deleteoldrevisions.php before to get this error.

Hope someone can help me, inside this website there are 11 years of "work", please.

MarkAHershberger (talkcontribs)

This error: Could not open "patch-indexes.sql". makes it look like a file is missing. What happens if you copy this file to your MediaWiki installation under maintenance/archives/patch-indexes.sql?

Cesarinik (talkcontribs)

File is already there...

Cesarinik (talkcontribs)

I don't know, but is it possible that the problems depends from some lack of data or data corruption in the revisions tables after the mass purge?

Is there any way to "rebuild" the tables? (also deleting the whole revisions informations, I don't care. What is really important is not to loss the current version of the wiki and make it editable again)

MarkAHershberger (talkcontribs)

The error is Could not open "patch-indexes.sql" and, as you can see from the code around it, happens because the code fopen( $filename, 'r' ); (where $filename is "patch-indexes.sql") returns false.

There are a number of reasons that could be, but this looks like a bug in MediaWiki. If you look at MysqlUpdater.php where applyPatch is called, you can see that the second aragument is true when it should be false to indicate that "patch-indexes.sql" is not a full pathname.

Try changing the true to false here and see if that fixes your problem.

This post was hidden by 185.110.118.2 (history)
Cesarinik (talkcontribs)

Seems like the db lost all the "primary", "unique" keys in tables after te restore.

I tried to reconfigure it and update.php now work without problem.

The problem with the error in "history" still remains.

Ciencia Al Poder (talkcontribs)
Cesarinik (talkcontribs)

I worked on the db restoring al the keys (very weird how they were not imported) and now history is showed, I found also duplicates entry in a couple of tables.

Remains the error when trying to modify and save.

Ciencia Al Poder (talkcontribs)

My request to put detailed error messages also remains

Cesarinik (talkcontribs)

I re-runned update.php and now seems to work (edits too) after the "manual maintenance" of the db.

Very weird.