All,
I have an issue with the pagelinks table in a MW 1.44.2 install. When performing an upgrade to MW 1.46 (or indeed just to 1.44.3!) and running the update maintenance script, it bombs out:
Table pagelinks contains pl_title field. Dropping...Wikimedia\Rdbms\DBQueryError from line 1230 of /opt/mediawiki/includes/libs/Rdbms/Database/Database.php: Error 1062: Duplicate entry '1-32' for key 'PRIMARY' Function: Wikimedia\Rdbms\Database::sourceFile( /opt/mediawiki/sql/mysql/patch-pagelinks-drop-pl_title.sql ) Query: ALTER TABLE `pagelinks` ADD PRIMARY KEY (pl_from, pl_target_id)
Prior to running the 'update' maintenance script using 'run.php', there is only one row with pl_from=1 and pl_target_id=32, so the migration scripts are creating duplicate entries.
Although running the 'update' script a second time causes it to succeed, I don't want to do this in a production environment and risk problems later down the line.
According to https://www.mediawiki.org/wiki/Manual:Pagelinks_table, 'Regenerating the pagelinks table is always possible using the rebuildall.php maintenance script', but if I run this on the database prior to migration, it doesn't appear to delete anything from the pagelinks table.
I am at a loss. Can anyone help me work out what's going on?
Best wishes,
Peter
Hi, My suggestion is to get rid of the rows and reparse, pagelinks rows are derivative data and self-heals with reparse. Just delete the rows for that specific error and reparse the page. That's what I did when I had the same problem.
HTH.
Am So., 26. Juli 2026 um 20:27 Uhr schrieb Peter Hicks via MediaWiki-l < mediawiki-l@lists.wikimedia.org>:
All,
I have an issue with the pagelinks table in a MW 1.44.2 install. When performing an upgrade to MW 1.46 (or indeed just to 1.44.3!) and running the update maintenance script, it bombs out:
Table pagelinks contains pl_title field. Dropping...Wikimedia\Rdbms\DBQueryError from line 1230 of /opt/mediawiki/includes/libs/Rdbms/Database/Database.php: Error 1062: Duplicate entry '1-32' for key 'PRIMARY' Function: Wikimedia\Rdbms\Database::sourceFile( /opt/mediawiki/sql/mysql/patch-pagelinks-drop-pl_title.sql ) Query: ALTER TABLE `pagelinks` ADD PRIMARY KEY (pl_from, pl_target_id)
Prior to running the 'update' maintenance script using 'run.php', there is only one row with pl_from=1 and pl_target_id=32, so the migration scripts are creating duplicate entries.
Although running the 'update' script a second time causes it to succeed, I don't want to do this in a production environment and risk problems later down the line.
According to https://www.mediawiki.org/wiki/Manual:Pagelinks_table, 'Regenerating the pagelinks table is always possible using the rebuildall.php maintenance script', but if I run this on the database prior to migration, it doesn't appear to delete anything from the pagelinks table.
I am at a loss. Can anyone help me work out what's going on?
Best wishes,
Peter
MediaWiki-l mailing list -- mediawiki-l@lists.wikimedia.org To unsubscribe send an email to mediawiki-l-leave@lists.wikimedia.org
https://lists.wikimedia.org/postorius/lists/mediawiki-l.lists.wikimedia.org/
mediawiki-l@lists.wikimedia.org