[01:13:38] Does MediaWiki have an export API? Something that will let me slurp whole histories of a page at a time instead of 50 revs per api call? [01:19:46] no, the export switch on action=query only does the current revision [01:20:01] Special:Export will do the last 1000 revisions of a page though [01:30:38] Time to file a bug... [12:58:43] Krinkle: I'm not even sure what's running dropTable [12:58:45] For https://phabricator.wikimedia.org/T302115#7727877 [12:59:39] Nor why it would only fail on our CI and not upstream [13:03:49] RhinosF1: #5 /workspace/src/extensions/MirahezeMagic/.github/workflows/globals.php(55): Wikimedia\Rdbms\DBConnRef->insert() [13:04:03] lol [13:05:13] The dropTable is from CloneDatabase trying to remove the temporary db for phpunit [13:05:37] that is failing because the unallowed insert() left the db in an unsafe state [13:05:48] why does inserting into the DB suddenly cause an issue Krinkle [13:05:52] it's a strange cascading error, the first one is what matters [13:05:59] And where can we make that insert safely [13:07:24] RhinosF1: I'm not sure [13:07:31] but removing this catch will likely help you find out the reason [13:07:32] https://github.com/miraheze/MirahezeMagic/blob/master/.github/workflows/globals.php#L58 [13:08:27] It's a miracle that the backtrace made it into the output to so cleanly point to this file as the root cause since it's ignored by try-catch [13:08:40] Krinkle: done, running, not sure why it would only affect the 1 repo yet [13:08:45] They all do that [13:08:54] And Miraheze is often a miracle [13:11:00] * RhinosF1 wonders what's blocking CI [13:16:37] Hm.. so I use php72 locally as mw-docker does by default. We're on 1.38-alpha in master now. But, if i checkout three major versions ago in git, (git co REL1_35) I can't even launch eval.php because: [13:16:38] > MediaWiki 1.35 needs PHP 7.3.19 or higher (and not 7.4.0 - 7.4.2). [13:16:59] Yeah, that's expected [13:17:07] And causes Vagrant to fail too on older branches [13:17:54] That build is running 1.38-alpha that was failing [13:18:27] with php7.4 [13:21:48] https://www.irccloud.com/pastebin/SbSaF1VL [13:21:54] Krinkle: ^ [13:22:02] This feels like a should have never worked [13:23:01] That hasn't changed since November 2021 [13:23:12] https://github.com/miraheze/MirahezeMagic/actions/runs/1881769896 [13:25:55] Something is now making services be initialised twice [13:39:45] Krinkle: how do you make $dbw->insert() do INSERT IGNORE [13:40:47] $dbw->insert( $table, $fields, __METHOD__, [ 'IGNORE' ] ); offhand IIRC (either way the array containing 'IGNORE' should go after __METHOD__ if memory serves me correct) [13:42:45] https://github.com/miraheze/MirahezeMagic/pull/321/commits/6a0ba84aff7e9af5a495af48ae87ba9433396409 [13:43:00] * RhinosF1 crosses fingers CI doesn't complain [13:47:17] Krinkle: did not work to ignore the insert https://github.com/miraheze/MirahezeMagic/runs/5288984740?check_suite_focus=true [13:48:17] Wikimedia\Rdbms\DBTransactionStateError: Cannot execute query from wfOnMediaWikiServices while session state is out of sync. [13:48:17] 1275 [13:52:54] DB code sure has changed recently and it's caused quite a bit of headache in 3rd-party code (been there, done that...) [13:53:12] ashley: yes I'm trying to solve the headache it caused [13:53:17] Fairly unsuccessfully [13:53:35] wild guess, but I take it you've already tried wrapping the query in $dbw->startTransaction() / $dbw->endTransaction()? (or something like that...you know, the stuff that used to be $dbw->begin() and $dbw->commit(), respectively) [13:53:38] I'm blaming something calling the services hook [13:54:10] ashley: I have not, would you expect it to help? [13:54:52] startAtomic() and endAtomic() are the methods; might be worth a shot? if it fails, I'll just assume you're looking at a *very* exotic, esoteric bug that can seem nearly impossible to fix... (I wish I didn't know what I'm talking about, but *sigh*) [13:56:25] ashley: https://bash.toolforge.org/quip/3EWHd3wB8Fs0LHO5i8LD [13:56:57] "technically true" [13:57:30] thcipriani: This is the useful build, the one after the try was removed: https://github.com/miraheze/MirahezeMagic/runs/5288649886?check_suite_focus=true [13:57:34] RhinosF1: ^ [13:57:45] > Error 1062: Duplicate entry 'wikidb' for key 'PRIMARY' (localhost:/tmp/quibble-mysql-1x1vi7ar/socket) [13:57:45] Function: Wikimedia\Rdbms\Database::insert [13:57:45] Query: INSERT INTO `cw_wikis` (wiki_dbname,wiki_dbcluster,wiki_sitename,wiki_language,wiki_private,wiki_creation,wiki_category,wiki_closed,wiki_deleted,wiki_locked,wiki_inactive,wiki_inactive_exempt,wiki_url) VALUES ('wikidb','c1','TestWiki','en',0,'20220222131901','uncategorised',0,0,0,0,0,'http://127.0.0.1:9412') [13:58:13] That's the problem :) [13:58:33] Krinkle: then I added IGNORE [14:00:50] ack, well, I don't know then. Maybe reduce it to a smaller set of extensions and smaller set of test groups [14:13:59] ashley: atomic doesn't work [14:14:23] Krinkle: why is the services hook being called then [14:14:28] has that changed [14:16:59] darn :-/ [14:18:45] RhinosF1: maybe use something like this instead: https://github.com/wikimedia/mediawiki-extensions-WikiLambda/blob/a4200f3f74391de8f5f9f88bc38bf45ab2bea513/includes/Hooks.php#L192 [14:18:56] it looks like the intention is to add some sample data once when the db is installed? [14:19:07] not to run a query every time the services container is initialised [14:19:18] which is what the currently used is named and documentd as doing [14:20:47] Krinkle: trying [14:23:14] Krinkle: nope, that hook is called too late [14:23:38] it needs to be super early in the process as without the hook running you have no DB [14:24:24] when is the table created then (if not in LoadExtensionSchemaUpdates)? [14:25:52] taavi: by install.php [14:26:07] whereas that hook picks up update.php [14:26:39] and how does install.php learn about that table? [14:28:16] taavi: i'd assume https://github.com/miraheze/CreateWiki/blob/69969da762e0da1b7190aaa8cb75ce9c5cab6118/includes/CreateWikiHooks.php#L51 [14:28:42] "LoadExtensionSchemaUpdates": [ [14:28:43] "CreateWikiHooks::fnCreateWikiSchemaUpdates" [14:29:44] https://github.com/miraheze/MirahezeMagic/runs/5289520373?check_suite_focus=true says DB not found which makes me assume the insert never ran