Page MenuHomePhabricator

Error running `extensions/Wikibase/lib/maintenance/populateSitesTable.php --force-protocol https` on jbowiki
Open, MediumPublic

Description

jbowiki:  A database error has occurred. Did you forget to run maintenance/update.php after upgrading?  See: https://www.mediawiki.org/wiki/Manual:Upgrading#Run_the_update_script
jbowiki:  Query: INSERT  INTO `site_identifiers` (si_site,si_type,si_key) VALUES ('203','equivalent','fa')
jbowiki:  Function: DBSiteStore::saveSites
jbowiki:  Error: 1062 Duplicate entry 'equivalent-fa' for key 'site_ids_type' (10.64.16.27)
jbowiki:  done.
[bbcd38dd] [no req]   DBUnexpectedError from line 3534 of /srv/mediawiki/php-1.27.0-wmf.9/includes/db/Database.php: Got COMMIT while atomic sections DBSiteStore::saveSites are still open
Backtrace:
#0 /srv/mediawiki/php-1.27.0-wmf.9/includes/db/loadbalancer/LoadBalancer.php(1050): DatabaseBase->commit(string, string)
#1 [internal function]: LoadBalancer->commitMasterChanges()
#2 /srv/mediawiki/php-1.27.0-wmf.9/includes/db/loadbalancer/LBFactory.php(194): call_user_func_array(array, array)
#3 [internal function]: {closure}(LoadBalancer, string, array)
#4 /srv/mediawiki/php-1.27.0-wmf.9/includes/db/loadbalancer/LBFactoryMulti.php(394): call_user_func_array(Closure, array)
#5 /srv/mediawiki/php-1.27.0-wmf.9/includes/db/loadbalancer/LBFactory.php(195): LBFactoryMulti->forEachLB(Closure, array)
#6 /srv/mediawiki/php-1.27.0-wmf.9/includes/db/loadbalancer/LBFactory.php(212): LBFactory->forEachLBCallMethod(string)
#7 /srv/mediawiki/php-1.27.0-wmf.9/maintenance/doMaintenance.php(116): LBFactory->commitMasterChanges()
#8 /srv/mediawiki/php-1.27.0-wmf.9/extensions/Wikidata/extensions/Wikibase/lib/maintenance/populateSitesTable.php(125): require_once(string)
#9 /srv/mediawiki/multiversion/MWScript.php(97): require_once(string)
#10 {main}

Event Timeline

Krenair created this task.Dec 28 2015, 5:24 PM
Krenair raised the priority of this task from to Needs Triage.
Krenair updated the task description. (Show Details)
Krenair added a project: Wikidata.
Krenair added a subscriber: Krenair.
Restricted Application added subscribers: StudiesWorld, Aklapper. · View Herald TranscriptDec 28 2015, 5:24 PM
hoo added a subscriber: hoo.Oct 7 2016, 5:41 PM
Krinkle triaged this task as High priority.Apr 10 2018, 3:17 PM
hoo added a subscriber: Reedy.Apr 24 2018, 7:47 AM

Maybe this is actually a addWiki.php bug?

I just found the following on the (freshly setup) inhwiki:

wikiadmin@db1077(inhwiki)>SELECT * FROM sites;
+---------+-----------------+-----------+------------+-------------+---------------+---------------+-------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------+--------------+-------------+
| site_id | site_global_key | site_type | site_group | site_source | site_language | site_protocol | site_domain             | site_data                                                                                                                                         | site_forward | site_config |
+---------+-----------------+-----------+------------+-------------+---------------+---------------+-------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------+--------------+-------------+
|       1 | advisorswiki    | mediawiki | advisors   | local       | en            | https         | gro.aidemikiw.srosivda. | a:1:{s:5:"paths";a:2:{s:9:"file_path";s:35:"https://advisors.wikimedia.org/w/$1";s:9:"page_path";s:38:"https://advisors.wikimedia.org/wiki/$1";}} |            0 | a:0:{}      |
+---------+-----------------+-----------+------------+-------------+---------------+---------------+-------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------+--------------+-------------+
1 row in set (0.00 sec)

wikiadmin@db1077(inhwiki)>SELECT COUNT(*) FROM site_identifiers;
+----------+
| COUNT(*) |
+----------+
|      697 |
+----------+
1 row in set (0.00 sec)

So the populateSitesTable.php call in addWiki is not working as expected, it seems…

hoo added a comment.Apr 24 2018, 7:52 AM

I saw similar things on all the newly-created wikis. For example on euwikisource:

wikiadmin@db1075(euwikisource)>SELECT COUNT(*) FROM site_identifiers;
+----------+
| COUNT(*) |
+----------+
|      233 |
+----------+
1 row in set (0.01 sec)

wikiadmin@db1075(euwikisource)>SELECT * FROM sites;
+---------+-----------------+-----------+------------+-------------+---------------+---------------+-------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------+--------------+-------------+
| site_id | site_global_key | site_type | site_group | site_source | site_language | site_protocol | site_domain             | site_data                                                                                                                                         | site_forward | site_config |
+---------+-----------------+-----------+------------+-------------+---------------+---------------+-------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------+--------------+-------------+
|       1 | advisorswiki    | mediawiki | advisors   | local       | en            | https         | gro.aidemikiw.srosivda. | a:1:{s:5:"paths";a:2:{s:9:"file_path";s:35:"https://advisors.wikimedia.org/w/$1";s:9:"page_path";s:38:"https://advisors.wikimedia.org/wiki/$1";}} |            0 | a:0:{}      |                                                                                                
+---------+-----------------+-----------+------------+-------------+---------------+---------------+-------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------+--------------+-------------+                                                                                                
1 row in set (0.00 sec)

Mentioned in SAL (#wikimedia-operations) [2018-06-07T15:23:59Z] <hoo> Emptied out the sites and site_identifiers tables on pswikivoyage, pmswikisource, bnwikivoyage and sahwikiquote for T122520,

Addshore lowered the priority of this task from High to Medium.Nov 13 2018, 1:52 PM
Addshore moved this task from incoming to needs discussion or investigation on the Wikidata board.
mmodell changed the subtype of this task from "Task" to "Production Error".Aug 28 2019, 11:11 PM