•  
      request #27512 `mathoid` table is missing after instance initialization
    Infos
    #27512
    Thomas Gerbet (tgerbet)
    2022-09-06 10:51
    2022-06-24 14:39
    29057
    Details
    `mathoid` table is missing after instance initialization

    The table is missing and is only created after the maintenance/update.php script is called.

    Mediawiki Standalone
    Empty
    Empty
    • [ ] enhancement
    • [ ] internal improvement
    Robert Vogel (rvogel), Dejan Savuljesku (dsavuljesku)
    Stage
    Robert Vogel (rvogel)
    Closed
    2022-09-06
    Attachments
    Empty
    References

    Follow-ups

    User avatar
    Thomas Gerbet (tgerbet)2022-07-25 14:52

    Hello,

    The workaround might not work when creating the wiki instance. If we call POST .../mediawiki/w/rest.php/tuleap/maintenance/:projectname/update after the PUT call there is a lot of chances the installation is not yet done so the update request will fail.

    See the following trace showing the issue when chaining the calls:

    2022-07-25 12:36:52 web plugin_mediawiki_118: config-install-database
    2022-07-25 12:36:52 web plugin_mediawiki_118: array (
    )
    2022-07-25 12:36:52 web plugin_mediawiki_118: config-install-step-done
    2022-07-25 12:36:52 web plugin_mediawiki_118: array (
    )
    2022-07-25 12:36:52 web plugin_mediawiki_118: config-install-tables
    2022-07-25 12:36:52 web plugin_mediawiki_118: array (
    )
    2022-07-25 12:36:52 web plugin_mediawiki_118: config-install-step-done
    2022-07-25 12:36:52 web plugin_mediawiki_118: array (
    )
    2022-07-25 12:36:52 web plugin_mediawiki_118: config-install-user
    2022-07-25 12:36:52 web plugin_mediawiki_118: array (
    )
    2022-07-25 12:36:52 web plugin_mediawiki_118: config-install-step-done
    2022-07-25 12:36:52 web plugin_mediawiki_118: array (
    )
    2022-07-25 12:36:52 web plugin_mediawiki_118: config-install-tables-manual
    2022-07-25 12:36:52 web plugin_mediawiki_118: array (
    )
    2022-07-25 12:36:56 web plugin_mediawiki_118: config-install-step-done
    2022-07-25 12:36:56 web plugin_mediawiki_118: array (
    )
    2022-07-25 12:36:56 web plugin_mediawiki_118: config-install-interwiki
    2022-07-25 12:36:56 web plugin_mediawiki_118: array (
    )
    2022-07-25 12:36:56 web plugin_mediawiki_118: config-install-step-done
    2022-07-25 12:36:56 web plugin_mediawiki_118: array (
    )
    2022-07-25 12:36:56 web plugin_mediawiki_118: config-install-stats
    2022-07-25 12:36:56 web plugin_mediawiki_118: array (
    )
    2022-07-25 12:36:56 web plugin_mediawiki_118: config-install-step-done
    2022-07-25 12:36:56 web plugin_mediawiki_118: array (
    )
    2022-07-25 12:36:56 web plugin_mediawiki_118: config-install-keys
    2022-07-25 12:36:56 web plugin_mediawiki_118: array (
    )
    2022-07-25 12:36:56 web plugin_mediawiki_118: config-install-step-done
    2022-07-25 12:36:56 web plugin_mediawiki_118: array (
    )
    2022-07-25 12:36:56 web plugin_mediawiki_118: config-install-updates
    2022-07-25 12:36:56 web plugin_mediawiki_118: array (
    )
    2022-07-25 12:36:56 web plugin_mediawiki_118: config-install-step-done
    2022-07-25 12:36:56 web plugin_mediawiki_118: array (
    )
    2022-07-25 12:36:56 web plugin_mediawiki_118: config-install-restore-services
    2022-07-25 12:36:56 web plugin_mediawiki_118: array (
    )
    2022-07-25 12:36:56 web plugin_mediawiki_118: config-install-step-done
    2022-07-25 12:36:56 web plugin_mediawiki_118: array (
    )
    2022-07-25 12:36:56 web plugin_mediawiki_118: config-install-sysop
    2022-07-25 12:36:56 web plugin_mediawiki_118: array (
    )
    2022-07-25 12:36:56 web plugin_mediawiki_118: config-install-step-done
    2022-07-25 12:36:56 web plugin_mediawiki_118: array (
    )
    2022-07-25 12:36:56 web plugin_mediawiki_118: config-install-mainpage
    2022-07-25 12:36:56 web plugin_mediawiki_118: array (
    )
    2022-07-25 12:36:56 web plugin_mediawiki_118: [db10edfbccc253859aed8b75] [no req]   Wikimedia\Rdbms\DBUnexpectedError from line 378 of /usr/share/mediawiki-tuleap-flavor/includes/libs/rdbms/loadbalancer/LoadBalancer.php: Handle requested with CONN_TRX_AUTOCOMMIT yet it has a transaction #0 /usr/share/mediawiki-tuleap-flavor/includes/libs/rdbms/loadbalancer/LoadBalancer.php(961): Wikimedia\Rdbms\LoadBalancer->enforceConnectionFlags()
    #1 /usr/share/mediawiki-tuleap-flavor/includes/libs/rdbms/loadbalancer/LoadBalancer.php(904): Wikimedia\Rdbms\LoadBalancer->getServerConnection()
    #2 /usr/share/mediawiki-tuleap-flavor/includes/libs/rdbms/loadbalancer/LoadBalancer.php(1049): Wikimedia\Rdbms\LoadBalancer->getConnection()
    #3 /usr/share/mediawiki-tuleap-flavor/includes/jobqueue/JobQueueDB.php(830): Wikimedia\Rdbms\LoadBalancer->getMaintenanceConnectionRef()
    #4 /usr/share/mediawiki-tuleap-flavor/includes/jobqueue/JobQueueDB.php(789): JobQueueDB->getDB()
    #5 /usr/share/mediawiki-tuleap-flavor/includes/jobqueue/JobQueueDB.php(202): JobQueueDB->getMasterDB()
    #6 /usr/share/mediawiki-tuleap-flavor/includes/jobqueue/JobQueue.php(374): JobQueueDB->doBatchPush()
    #7 /usr/share/mediawiki-tuleap-flavor/includes/jobqueue/JobQueue.php(344): JobQueue->batchPush()
    #8 /usr/share/mediawiki-tuleap-flavor/includes/jobqueue/JobQueueGroup.php(171): JobQueue->push()
    #9 /usr/share/mediawiki-tuleap-flavor/includes/jobqueue/JobQueueGroup.php(210): JobQueueGroup->push()
    #10 /usr/share/mediawiki-tuleap-flavor/includes/Title.php(4234): JobQueueGroup->lazyPush()
    #11 /usr/share/mediawiki-tuleap-flavor/includes/page/WikiPage.php(3596): Title->touchLinks()
    #12 /usr/share/mediawiki-tuleap-flavor/includes/Storage/DerivedPageDataUpdater.php(1585): WikiPage::onArticleCreate()
    #13 /usr/share/mediawiki-tuleap-flavor/includes/Storage/PageUpdater.php(1343): MediaWiki\Storage\DerivedPageDataUpdater->doUpdates()
    #14 /usr/share/mediawiki-tuleap-flavor/includes/libs/rdbms/database/Database.php(4460): MediaWiki\Storage\PageUpdater->MediaWiki\Storage\{closure}()
    #15 /usr/share/mediawiki-tuleap-flavor/includes/libs/rdbms/database/DBConnRef.php(68): Wikimedia\Rdbms\Database->doAtomicSection()
    #16 /usr/share/mediawiki-tuleap-flavor/includes/libs/rdbms/database/DBConnRef.php(641): Wikimedia\Rdbms\DBConnRef->__call()
    #17 /usr/share/mediawiki-tuleap-flavor/includes/deferred/AtomicSectionUpdate.php(39): Wikimedia\Rdbms\DBConnRef->doAtomicSection()
    #18 /usr/share/mediawiki-tuleap-flavor/includes/deferred/DeferredUpdates.php(467): AtomicSectionUpdate->doUpdate()
    #19 /usr/share/mediawiki-tuleap-flavor/includes/deferred/DeferredUpdates.php(344): DeferredUpdates::attemptUpdate()
    #20 /usr/share/mediawiki-tuleap-flavor/includes/deferred/DeferredUpdates.php(278): DeferredUpdates::run()
    #21 /usr/share/mediawiki-tuleap-flavor/includes/deferred/DeferredUpdates.php(190): DeferredUpdates::handleUpdateQueue()
    #22 /usr/share/mediawiki-tuleap-flavor/includes/deferred/DeferredUpdates.php(491): DeferredUpdates::doUpdates()
    #23 /usr/share/mediawiki-tuleap-flavor/includes/deferred/DeferredUpdates.php(131): DeferredUpdates::tryOpportunisticExecute()
    #24 /usr/share/mediawiki-tuleap-flavor/includes/Storage/PageUpdater.php(1311): DeferredUpdates::addUpdate()
    #25 /usr/share/mediawiki-tuleap-flavor/includes/Storage/PageUpdater.php(796): MediaWiki\Storage\PageUpdater->doCreate()
    #26 /usr/share/mediawiki-tuleap-flavor/includes/page/WikiPage.php(2015): MediaWiki\Storage\PageUpdater->saveRevision()
    #27 /usr/share/mediawiki-tuleap-flavor/includes/installer/Installer.php(1926): WikiPage->doEditContent()
    #28 /usr/share/mediawiki-tuleap-flavor/includes/installer/Installer.php(1736): Installer->createMainpage()
    #29 /usr/share/mediawiki-tuleap-flavor/extensions/TuleapWikiFarm/src/InstanceCliInstaller.php(35): Installer->performInstallation()
    #30 /usr/share/mediawiki-tuleap-flavor/extensions/TuleapWikiFarm/maintenance/installInstance.php(44): TuleapWikiFarm\InstanceCliInstaller->execute()
    #31 /usr/share/mediawiki-tuleap-flavor/maintenance/doMaintenance.php(107): InstallInstance->execute()
    #32 /usr/share/mediawiki-tuleap-flavor/extensions/TuleapWikiFarm/maintenance/installInstance.php(54): require_once(string)
    #33 {main}
    2022-07-25 12:36:56 web plugin_mediawiki_118: config-install-step-done
    2022-07-25 12:36:56 web plugin_mediawiki_118: array (
    )
    2022-07-25 12:36:56 web plugin_mediawiki_118: config-install-db-success
    2022-07-25 12:36:56 web plugin_mediawiki_118: array (
    )
    

    We could probably wait for a bit until the instance is fully available while checking its status before executing the update but it seems a bit brittle and I would prefer to avoid this approach if we can.

    User avatar
    Robert Vogel (rvogel)2022-07-18 17:04

    You are right. I misunderstood the issue. I have now created a patchset at https://gerrit.wikimedia.org/r/c/mediawiki/extensions/TuleapWikiFarm/+/814831 but in my test environment this didn't catch. I am still investigating why.

    As a workaround you could add a second API call when creating the wiki instance. So basically after PUT .../mediawiki/w/rest.php/tuleap/instance/:projectname, a call to POST .../mediawiki/w/rest.php/tuleap/maintenance/:projectname/update

    User avatar

    I recommend to just add the update.php --quick step to the install procedure of the Tuleap plugin

    It's already done. So I think that what you suggest is to run update.php --quick when the MediaWiki service is activated in a project (after the call to PUT .../mediawiki/w/rest.php/tuleap/instance/:projectname ?

    User avatar
    Robert Vogel (rvogel)2022-07-13 16:43

    I have investigated the issue and it seems, like this would require a change in the CLI installer. While this could be done to the code located in /plugins/mediawiki_standalone/additional-packages/mediawiki-tuleap-config/mw-config/overrides/overrides.php I recommend to just add the update.php --quick step to the install procedure of the Tuleap plugin. This will be more safe in the future, in case further extensions may be added to the mediawiki-tuleap-flavor.