[15:01:37] Hi, I am currently having a rodeo with an MW 1.31 to MW 1.35 upgrade. [15:02:10] This is the database error I am getting: [15:02:11] ``` [15:02:11] Table change_tag contains ct_tag field. Dropping ...Wikimedia\Rdbms\DBQueryError from line 1713 of /.../w/includes/libs/rdbms/database/Database.php: Error 1062: Duplicate entry '58763-0' for key 'change_tag_rc_tag_id' (localhost) [15:02:12] Function: Wikimedia\Rdbms\Database::sourceFile( /.../w/maintenance/archives/patch-drop-ct_tag.sql ) [15:02:12] Query: ALTER TABLE `change_tag` MODIFY ct_tag_id int unsigned NOT NULL [15:02:13] ``` [15:02:59] Can I just drop the duplicate entries and continue or do I need to make the duplicate entries unique somehow? [15:16:25] Hmm, clueless, too? [15:21:36] Marbot: do you know what the duplicate entries are? [15:22:07] MariaDB [DBBUNNY]> SELECT ct_tag_id, COUNT(*) [15:22:07]     -> FROM change_tag [15:22:08]     -> GROUP BY ct_tag_id [15:22:08]     -> HAVING COUNT(*) > 1; [15:22:09] +-----------+----------+ [15:22:09] | ct_tag_id | COUNT(*) | [15:22:10] +-----------+----------+ [15:22:10] |      NULL |      502 | [15:22:11] |         1 |        6 | [15:22:11] |         2 |        6 | [15:22:12] |         3 |        2 | [15:22:12] |         4 |        2 | [15:22:13] |         5 |        2 | [15:22:13] |         7 |        3 | [15:22:14] |         8 |        6 | [15:22:14] |         9 |      557 | [15:22:15] +-----------+----------+ [15:22:15] 9 rows in set (0.001 sec) [15:22:27] Marbot: run maintenance/populateChangeTagDef.php --force [15:23:56] Ok. Done.. This script showed all sorts of tags involved. Will rerun update.php again. [15:23:57] Once you run the script, it should populate the missing tags. And then run update.php. If it fails with "Can't DROP INDEX `change_tag_rc_tag_nonuniq`; check that it exists", edit maintenance/archives/patch-drop-ct_tag.sql and replace "DROP INDEX " with "DROP INDEX IF EXISTS " [15:27:26] Just ran update.php again. No issues now. You are a game changer for me. [15:27:38] I am really thankful. [15:28:11] Will now have a look at the wiki and see if things are cool before upgrading to MW 1.39 [15:31:09] we have encountered the same error recently and I had it documented [15:42:49] Somewhere on MediaWiki.org? [15:52:17] privately [15:54:55] Ah, I see. [15:55:41] Well, now it is at least in the chat log. Is there anything against me adding it to MedaiWiki.org? [16:00:18] Nothing. I though our issue was particular for the origin of the wikis where it happened (it didn't happen to all wikis), which were imported from Fandom, and maybe some scripts were skipped in old upgrades [16:07:17] The first time this happened to me, too. I suspect that previously the webupdater was used to upgrade the wiki. Speculative but I can check. [16:33:45] Now I ran into https://phabricator.wikimedia.org/T212428 tough luck [16:46:38] Tried it again. MW 1.31 looks good.