Page MenuHomePhabricator

update.php fails on MigrateActors::addActorsForRows
Closed, DuplicatePublic

Description

I try to update from 1.25 to 1.35 and update.php fails on the actor table

Beginning migration of logging.log_user and logging.log_user_text to logging.log_actor
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}

Related support desk thread: https://www.mediawiki.org/wiki/Topic:Vx24eca9xu10ixj6