Flow has some error handling code that looks like this:
try { // stuff } catch ( \Exception $e ) { $state->rollback(); \MWExceptionHandler::logException( $e ); }
When //stuff fails I get (on labs-vagrant, when using Special:EnableStructuredDiscussions to convert an existing page)
2018-06-14 12:05:53 mcr-full wiki: [0d80dda1d86880078da1e67b] /wiki/Special:EnableStructuredDiscussions Wikimedia\Rdbms\DBUnexpectedError from line 3884 of /vagrant/mediawiki/includes/libs/rdbms/database/Database.php: Flow\Import\PageImportState::rollback: Expected mass rollback of all peer transactions (DBO_TRX set). #0 /vagrant/mediawiki/extensions/Flow/includes/Import/Importer.php(416): Wikimedia\Rdbms\Database->rollback(string) #1 /vagrant/mediawiki/extensions/Flow/includes/Import/Importer.php(598): Flow\Import\PageImportState->rollback() #2 /vagrant/mediawiki/extensions/Flow/includes/Import/Importer.php(126): Flow\Import\TalkpageImportOperation->import(Flow\Import\PageImportState) #3 /vagrant/mediawiki/extensions/Flow/includes/Import/Converter.php(187): Flow\Import\Importer->import(Flow\Import\Wikitext\ImportSource, Title, User, Flow\Import\SourceStore\NullImportSourceStore) #4 /vagrant/mediawiki/extensions/Flow/includes/Import/Converter.php(138): Flow\Import\Converter->doConversion(Title, NULL) #5 /vagrant/mediawiki/extensions/Flow/includes/Specials/SpecialEnableStructuredDiscussions.php(120): Flow\Import\Converter->convert(Title) #6 /vagrant/mediawiki/includes/htmlform/HTMLForm.php(662): Flow\Specials\SpecialEnableStructuredDiscussions->onSubmit(array, OOUIHTMLForm) #7 /vagrant/mediawiki/includes/htmlform/HTMLForm.php(554): HTMLForm->trySubmit() #8 /vagrant/mediawiki/includes/htmlform/HTMLForm.php(569): HTMLForm->tryAuthorizedSubmit() #9 /vagrant/mediawiki/includes/specialpage/FormSpecialPage.php(184): HTMLForm->show() #10 /vagrant/mediawiki/extensions/Flow/includes/Specials/SpecialEnableStructuredDiscussions.php(49): FormSpecialPage->execute(NULL) #11 /vagrant/mediawiki/includes/specialpage/SpecialPage.php(565): Flow\Specials\SpecialEnableStructuredDiscussions->execute(NULL) #12 /vagrant/mediawiki/includes/specialpage/SpecialPageFactory.php(569): SpecialPage->run(NULL) #13 /vagrant/mediawiki/includes/MediaWiki.php(288): SpecialPageFactory::executePath(Title, RequestContext) #14 /vagrant/mediawiki/includes/MediaWiki.php(867): MediaWiki->performRequest() #15 /vagrant/mediawiki/includes/MediaWiki.php(524): MediaWiki->main() #16 /vagrant/mediawiki/index.php(42): MediaWiki->run() #17 /var/www/w/index.php(5): include(string)
which is not so helpful.
Not sure if this is a problem with Flow or the DB abstraction layer; ideally, though, logging would happen before rollback, and Database::rollback would be very conservative about throwing exceptions as they are likely to mess up error logging / recovery.