Topic on Project:Support desk

Jump to navigation Jump to search

Upgrade error MigrateActors::addActorsForRows

12
Subfader (talkcontribs)

I try to upgrade from a very old MW to 1.35.0 and got this error running update.php

I guess it's not finished?

... log_id=6700
... log_id=6800
Wikimedia\Rdbms\DBQueryError from line 1699 of /.../includes/libs/rdbms/database/Database.php: Error 1062: Duplicate entry '' for key 'actor_name' (localhost)''
Function: MigrateActors::addActorsForRows
Query: INSERT INTO `actor` (actor_name) VALUES ('')''
#0 /.../includes/libs/rdbms/database/Database.php(1683): Wikimedia\Rdbms\Database->getQueryException('Duplicate entry...', 1062, 'INSERT INTO `ac...', 'MigrateActors::...')
#1 /.../includes/libs/rdbms/database/Database.php(1658): Wikimedia\Rdbms\Database->getQueryExceptionAndLog('Duplicate entry...', 1062, 'INSERT INTO `ac...', 'MigrateActors::...')
#2 /.../includes/libs/rdbms/database/Database.php(1227): Wikimedia\Rdbms\Database->reportQueryError('Duplicate entry...', 1062, 'INSERT INTO `ac...', 'MigrateActors::...', false)
#3 /.../includes/libs/rdbms/database/Database.php(2343): Wikimedia\Rdbms\Database->query('INSERT INTO `ac...', 'MigrateActors::...', 128)
#4 /.../includes/libs/rdbms/database/Database.php(2323): Wikimedia\Rdbms\Database->doInsert('actor', Array, 'MigrateActors::...')
#5 /.../includes/libs/rdbms/database/DBConnRef.php(68): Wikimedia\Rdbms\Database->insert('actor', Array, 'MigrateActors::...')
#6 /.../includes/libs/rdbms/database/DBConnRef.php(369): Wikimedia\Rdbms\DBConnRef->__call('insert', Array)
#7 /.../maintenance/includes/MigrateActors.php(219): Wikimedia\Rdbms\DBConnRef->insert('actor', Array, 'MigrateActors::...')
#8 /.../maintenance/includes/MigrateActors.php(305): MigrateActors->addActorsForRows(Object(Wikimedia\Rdbms\MaintainableDBConnRef), 'log_user_text', Array, Array, 0)
#9 /.../maintenance/includes/MigrateActors.php(115): MigrateActors->migrate('logging', Array, 'log_user', 'log_user_text', 'log_actor')
#10 /.../maintenance/includes/LoggedUpdateMaintenance.php(45): MigrateActors->doDBUpdates()
#11 /.../includes/installer/DatabaseUpdater.php(1343): LoggedUpdateMaintenance->execute()
#12 /.../includes/installer/DatabaseUpdater.php(512): DatabaseUpdater->migrateActors()
#13 /.../includes/installer/DatabaseUpdater.php(475): DatabaseUpdater->runUpdates(Array, false)
#14 /.../maintenance/update.php(181): DatabaseUpdater->doUpdates(Array)
#15 /.../maintenance/doMaintenance.php(107): UpdateMediaWiki->execute()
#16 /.../maintenance/update.php(253): require_once('/var/www/vhosts...')
#17 {main}

Calling the Main Page gives me

Original exception: [ac40f81cfe9ab555bd3426e6] /db/index.php?title=Main_Page MediaWiki\Revision\RevisionAccessException from line 1296 of /.../includes/Revision/RevisionStore.php: Main slot of revision not found in database. See T212428.
Backtrace:
#0 /.../includes/Revision/RevisionStore.php(1224): MediaWiki\Revision\RevisionStore->constructSlotRecords(string, Wikimedia\Rdbms\ResultWrapper, integer, Title)
#1 /.../includes/Revision/RevisionStore.php(1220): MediaWiki\Revision\RevisionStore->loadSlotRecords(string, integer, Title)
#2 /.../includes/Revision/RevisionStore.php(1335): MediaWiki\Revision\RevisionStore->loadSlotRecords(string, integer, Title)
#3 [internal function]: MediaWiki\Revision\RevisionStore->MediaWiki\Revision\{closure}()
#4 /.../includes/Revision/RevisionSlots.php(175): call_user_func(Closure)
#5 /.../includes/Revision/RevisionSlots.php(117): MediaWiki\Revision\RevisionSlots->getSlots()
#6 /.../includes/Revision/RevisionRecord.php(192): MediaWiki\Revision\RevisionSlots->getSlot(string)
#7 /.../includes/page/WikiPage.php(643): MediaWiki\Revision\RevisionRecord->getSlot(string, integer)
#8 /.../includes/libs/objectcache/wancache/WANObjectCache.php(1529): WikiPage->{closure}(boolean, integer, array, NULL, array)
#9 /.../includes/libs/objectcache/wancache/WANObjectCache.php(1376): WANObjectCache->fetchOrRegenerate(string, integer, Closure, array, array)
#10 /.../includes/page/WikiPage.php(651): WANObjectCache->getWithSetCallback(string, integer, Closure)
#11 /.../includes/page/WikiPage.php(311): WikiPage->getContentModel()
#12 /.../includes/page/WikiPage.php(297): WikiPage->getContentHandler()
#13 /.../includes/page/Article.php(2539): WikiPage->getActionOverrides()
#14 /.../includes/actions/Action.php(130): Article->getActionOverrides()
#15 /.../includes/actions/Action.php(189): Action::factory(string, Article, RequestContext)
#16 /.../includes/MediaWiki.php(166): Action::getActionName(RequestContext)
#17 /.../includes/MediaWiki.php(903): MediaWiki->getAction()
#18 /.../includes/MediaWiki.php(543): MediaWiki->main()
#19 /.../index.php(53): MediaWiki->run()
#20 /.../index.php(46): wfIndexMain()
#21 {main}
Subfader (talkcontribs)

Could someone please help me out here? This stops me from ugrading for which I took holidays :(

MarkAHershberger (talkcontribs)

The first error refers to an attempt to create duplicate actor entries. I've heard of similar errors when people have manually modified their user tables. Does that help any?

The second error refer to phabricator task T212428 -- did you look at it yet?

Ammarpad (talkcontribs)
Subfader (talkcontribs)

I indeed modified my user table with a new column. So did I with the pages table but that went through.

Should I search the user table for a duplicate name with empty values and delete that?

Second error: After the update was cancelled I just called the Main Page as it may give some indications. But I ran populateContentTables.php and it also failed:

Done populating revision table. Processed 2825170 rows in 189.07010388374 seconds
Populating archive...
... archive processed up to revision id 501 of 2937910 (491 rows in 0.041456937789917 seconds)
... archive processed up to revision id 1001 of 2937910 (973 rows in 0.062320947647095 seconds)
... archive processed up to revision id 1501 of 2937910 (1454 rows in 0.082330942153931 seconds)
... archive processed up to revision id 2001 of 2937910 (1552 rows in 0.089991807937622 seconds)
Failed to populate content table archive row batch starting at 2002 due to exception: MediaWiki\Storage\BlobAccessException: Unable to fetch blob at tt:2275 in /.../includes/Storage/SqlBlobStore.php:295
Stack trace:
#0 /.../maintenance/populateContentTables.php(374): MediaWiki\Storage\SqlBlobStore->getBlob('tt:2275')
#1 /.../maintenance/populateContentTables.php(276): PopulateContentTables->fillMissingFields(Object(stdClass), 'wikitext', 'tt:2275')
#2 /.../maintenance/populateContentTables.php(230): PopulateContentTables->populateContentTablesForRowBatch(Object(Wikimedia\Rdbms\ResultWrapper), 2002, 'archive')
#3 /.../maintenance/populateContentTables.php(97): PopulateContentTables->populateTable('archive')
#4 /.../maintenance/doMaintenance.php(107): PopulateContentTables->execute()
#5 /.../maintenance/populateContentTables.php(388): require_once('/var/www/vhosts...')
#6 {main}

Will search Phabricator first next time 👍

MarkAHershberger (talkcontribs)

Should I search the user table for a duplicate name with empty values and delete that?

That's what I think I would do, yes. Remember to backup first!


Does the populateContentTables.php fail each time you run it? If so, you should probably file a new task in Phabricator.

Subfader (talkcontribs)

user table (19916 entries): no duplicate user_name or user_id. Removed my custom column, same error on update.php

actor table (44987 entries): The last entry has indeed an empty name. The entries after the 19916 user entries are IPs(?). If these are anon visitors then of course there will be duplicates??

Ran populateContentTables.php a second time, same error.

Edit: I grepped the last IP of the actor table to find out where they are coming from: Tables archive and comment had that IP. Comment is from an extension, so I doubt update.php runs through this. I don't know what archive does tho.

Subfader (talkcontribs)

At the beginning of update.php output I found multiple lines like

   User name "Ellybett" is usable, cannot create an anonymous actor for it. Run maintenance/cleanupUsersWithNoId.php to fix this situation.

I ran it with --force --prefix=* and it fixed issues on various tables.

Running update.php again still brings these "cannot create an anonymous actor" lines on the revision table.

populateContentTables.php: Same error as before.

cleanupUsersWithNoId.php doesn't need to be ran again.

But maybe the "cannot create an anonymous actor" problem is not a problem at all. Then the problem remains with the empty user name in the actor table. I removed that but no luck on update.php

Subfader (talkcontribs)
Subfader (talkcontribs)

Imported the dump again and filled the empty log_user_text rows with log_user and log_user_text as described in phab:T229092. Update.php finished actor migration (with errors tho) and still fails because of T212428. That ticket is from March and has no solution.

populateContentTables.php still fails with

   MediaWiki\Storage\BlobAccessException: Unable to fetch blob at tt:2275

Since this seems unfixable and nobopdy replies here I consider installing PHP 5 on my new server to keep 1.25 running :(

Subfader (talkcontribs)

1.34 failed for the same reason. At least I could update to 1.31.10 now (with log_user_text fix).

Subfader (talkcontribs)

1.31 got me into even more trouble with unmaintained extensions.

My holidays are over and I was forced to install PHP5 on my new server to run my old wiki without an update.

MediaWiki is dead for me 😢

Reply to "Upgrade error MigrateActors::addActorsForRows"