Topic on Project:Support desk

update.php failing 1.31 > 1.34

8
Summary by T0lk

Database fix to resolve problem.

T0lk (talkcontribs)

When trying to upgrade from 1.31 to 1.34 update.php is failing with the following information


Migrating revision data to the MCR 'slot' and 'content' tables, printing progress markers.

For large databases, you may want to hit Ctrl-C and do this manually with

maintenance/populateContentTables.php.

Populating revision...

... revision processed up to revision id 500 of 79590 (383 rows in 0.17646288871765 seconds)

...

... revision processed up to revision id 27500 of 79590 (25540 rows in 6.0020930767059 seconds)

Failed to populate content table revision row batch starting at 27501 due to exception: MediaWiki\Storage\BlobAccessException: Unable to fetch blob at tt:27622 in /home/public_html/live/public/includes/Storage/SqlBlobStore.php:295

Stack trace:

#0 /home/public_html/live/public/maintenance/populateContentTables.php(385): MediaWiki\Storage\SqlBlobStore->getBlob('tt:27622')

#1 /home/public_html/live/public/maintenance/populateContentTables.php(287): PopulateContentTables->fillMissingFields(Object(stdClass), 'wikitext', 'tt:27622')

#2 /home/public_html/live/public/maintenance/populateContentTables.php(241): PopulateContentTables->populateContentTablesForRowBatch(Object(Wikimedia\Rdbms\ResultWrapper), 27501, 'revision')

#3 /home/public_html/live/public/maintenance/populateContentTables.php(108): PopulateContentTables->populateTable('revision')

#4 /home/public_html/live/public/includes/installer/DatabaseUpdater.php(1394): PopulateContentTables->execute()

#5 /home/public_html/live/public/includes/installer/DatabaseUpdater.php(490): DatabaseUpdater->populateContentTables()

#6 /home/public_html/live/public/includes/installer/DatabaseUpdater.php(454): DatabaseUpdater->runUpdates(Array, false)

#7 /home/public_html/live/public/maintenance/update.php(205): DatabaseUpdater->doUpdates(Array)

#8 /home/public_html/live/public/maintenance/doMaintenance.php(99): UpdateMediaWiki->execute()

#9 /home/public_html/live/public/maintenance/update.php(277): require_once('/home/public_ht...')

#10 /home/public_html/live/public/update_domain.php(12): include('/home/public_ht...')

#11 {main}


As far as I can tell, this is the revision it's having a problem with: https://bahaipedia.org/index.php?oldid=27622


I am not sure how to go about troubleshooting this issue. I did try and run populateContentTables.php separately but got the same error. As an experiment I switched to the master branch but the update still failed.

Bawolff (talkcontribs)

Well that's weird, given the revision is clearly being shown on your wiki. Just to check, do you have external storage setup, revision compression, or any other non-common configuration related to storing of revision text?

Can you tell me the results if you do the SQL query SELECT * from text where old_id = 27622; as well as the query SELECT * from revision left join text on old_id = rev_text_id where rev_id = 27622;.

As far as I can tell, the error is complaining about missing row in text table with old_id of 27622

T0lk (talkcontribs)

Thanks for your reply, I do use s3 to host images which is a new change, it's managed by Extension:AWS. There are no other options enabled that you asked about.

SELECT * from text where old_id = 27622; returned

Empty set (0.00 sec)


The second query returned

+--------+----------+-------------+---------------------------------------+----- -----+---------------+----------------+----------------+-------------+---------+ ---------------+---------------------------------+--------------------+--------- ----------+--------+------------------------------------------------------------ -------------------------------------------------------------------------------- -------------------------------------------------------------------------------- -------------------------------------------------------------------------------- -------------------------------------------------------------------------------- -------------------------------------------------------------------------------- -------------------------------------------------------------------------------- -------------------------------------------------------------------------------- -------------------------------------------------------------------------------- -------------------------------------------------------------------------------- -------+-----------+ | rev_id | rev_page | rev_text_id | rev_comment | rev_ user | rev_user_text | rev_timestamp | rev_minor_edit | rev_deleted | rev_len | rev_parent_id | rev_sha1 | rev_content_format | rev_cont ent_model | old_id | old_text | old_flags | +--------+----------+-------------+---------------------------------------+----- -----+---------------+----------------+----------------+-------------+---------+ ---------------+---------------------------------+--------------------+--------- ----------+--------+------------------------------------------------------------ -------------------------------------------------------------------------------- -------------------------------------------------------------------------------- -------------------------------------------------------------------------------- -------------------------------------------------------------------------------- -------------------------------------------------------------------------------- -------------------------------------------------------------------------------- -------------------------------------------------------------------------------- -------------------------------------------------------------------------------- -------------------------------------------------------------------------------- -------+-----------+ | 27622 | 4402 | 27366 | Robot changing Bahá'í to Bahá’í | 143 | Bot | 20081021175725 | 1 | 0 | 785 | 24382 | mw8rt27cwsw1gyeksqvgm0hm2i5xi1i | NULL | NULL | 27366 | A fundamental principle of the [[Bahá’í Faith]] is the harm ony of religion and '''[[science]]'''. The Bahá’í Faith teaches that properly a ppreciated, science and religion will never conflict, as each are complementary ways of explaining truth, which on any issue must necessarily be singular. The t eachings state that whenever conflict arises between religion and science it is due to human error; either through misinterpretation of religious scriptures or the lack of a more complete understanding of science. [[‘Abdu’l-Bahá]] explained that religious teachings which are at variance with science should not be accep ted; he explained that religion has to be reasonable since God endowed humankind with reason so that they can discover truth. ('''[[Science|more...]]''') | utf-8 | +--------+----------+-------------+---------------------------------------+----- -----+---------------+----------------+----------------+-------------+---------+ ---------------+---------------------------------+--------------------+--------- ----------+--------+------------------------------------------------------------ -------------------------------------------------------------------------------- -------------------------------------------------------------------------------- -------------------------------------------------------------------------------- -------------------------------------------------------------------------------- -------------------------------------------------------------------------------- -------------------------------------------------------------------------------- -------------------------------------------------------------------------------- -------------------------------------------------------------------------------- -------------------------------------------------------------------------------- -------+-----------+

Bawolff (talkcontribs)

Sorry, could you also check what SELECT * from revision where rev_text_id = 27622; is?

The error seems to indicate that something in revision.rev_text_id references a text.old_id that is missing. Which is weird, I'm not sure what would cause that.

T0lk (talkcontribs)

Sure, here it is:

mysql> SELECT * from revision where rev_text_id = 27622;

+--------+----------+-------------+---------------------------------------+----------+---------------+----------------+----------------+-------------+---------+---------------+----------+--------------------+-------------------+ | rev_id | rev_page | rev_text_id | rev_comment | rev_user | rev_user_text | rev_timestamp | rev_minor_edit | rev_deleted | rev_len | rev_parent_id | rev_sha1 | rev_content_format | rev_content_model | +--------+----------+-------------+---------------------------------------+----------+---------------+----------------+----------------+-------------+---------+---------------+----------+--------------------+-------------------+ | 27878 | 7261 | 27622 | Robot changing Bahá'í to Baháâí | 143 | Bot | 20081021191300 | 1 | 0 | 497 | 19803 | | NULL | NULL | +--------+----------+-------------+---------------------------------------+----------+---------------+----------------+----------------+-------------+---------+---------------+----------+--------------------+-------------------+ 1 row in set (0.02 sec)

Here as an image if it's easier to read: https://i.imgur.com/1hX6HQ4.png

Bawolff (talkcontribs)

Ok, so its https://bahaipedia.org/index.php?oldid=27878 causing the problem and indeed that revision looks broken.

I'm honestly not sure what the best solution is here. You could put a dummy entry into text table i guess with the old_id of 27622, just so the script runs.

T0lk (talkcontribs)

Awesome, thanks for your help. I ran the following command and then the updater completed successfully:


INSERT INTO text(old_id,old_text,old_flags) VALUES (27622,'Dummy','utf-8');

ByBunni (talkcontribs)

I ran into this issue migrating from 1.19 to 1.34 except it wasn't individual old_ids, it was 2 blocks of several hundred continuous old_ids that were corrupt in the database. The above fix of inserting 'dummy' values allowed the updater to finish successfully. This simple bash script quickly fixed the range of old_ids I needed to patch:

for id in {111..1111}; do echo "INSERT INTO text(old_id,old_text,old_flags) VALUES ($id,'dummy','utf-8');" | sudo mysql my_database; done