•  
      request #35485 Deprecations in MediaWiki 1.39
    Infos
    #35485
    Robert Vogel (rvogel)
    2024-04-24 10:37
    2023-12-15 11:40
    37094
    Details
    Deprecations in MediaWiki 1.39

    MediaWiki Standalone log shows several deprecation messages during the login/logout process:

    E.g. MediaWiki REST endpoint for "terminate-sessions"

    2023-12-13 14:26:08 web plugin_mediawiki_standalone_farm: [a944b831a8f3e63c28df52fa] /mediawiki/w/rest.php/tuleap/maintenance/%2A/terminate-sessions   TypeError: MediaWiki\Session\UserInfo::newFromUser(): Argument #1 ($user) must be of type User, null given, called in /usr/share/mediawiki-tuleap-flavor/current-lts/extensions/TuleapWikiFarm/src/PreSharedKeySessionProvider.php on line 82 #0 /usr/share/mediawiki-tuleap-flavor/current-lts/extensions/TuleapWikiFarm/src/PreSharedKeySessionProvider.php(82): MediaWiki\Session\UserInfo::newFromUser()
    #1 /usr/share/mediawiki-tuleap-flavor/current-lts/includes/session/SessionManager.php(537): TuleapWikiFarm\PreSharedKeySessionProvider->provideSessionInfo()
    #2 /usr/share/mediawiki-tuleap-flavor/current-lts/includes/session/SessionManager.php(243): MediaWiki\Session\SessionManager->getSessionInfoForRequest()
    #3 /usr/share/mediawiki-tuleap-flavor/current-lts/includes/WebRequest.php(841): MediaWiki\Session\SessionManager->getSessionForRequest()
    #4 /usr/share/mediawiki-tuleap-flavor/current-lts/includes/session/SessionManager.php(164): WebRequest->getSession()
    #5 /usr/share/mediawiki-tuleap-flavor/current-lts/includes/Setup.php(448): MediaWiki\Session\SessionManager::getGlobalSession()
    #6 /usr/share/mediawiki-tuleap-flavor/current-lts/includes/WebStart.php(86): require_once(string)
    #7 /usr/share/mediawiki-tuleap-flavor/current-lts/rest.php(29): require(string)
    #8 {main}
    2023-12-13 14:26:09 web plugin_mediawiki_standalone_farm: [a944b831a8f3e63c28df52fa] /mediawiki/w/rest.php/tuleap/maintenance/%2A/terminate-sessions   PHP Notice: Uncommitted DB writes (transaction from Wikimedia\Rdbms\Database::beginIfImplied (User::newSystemUser))
    #0 [internal function]: MWExceptionHandler::handleError()
    #1 /usr/share/mediawiki-tuleap-flavor/current-lts/includes/libs/rdbms/database/TransactionManager.php(583): trigger_error()
    #2 /usr/share/mediawiki-tuleap-flavor/current-lts/includes/libs/rdbms/database/Database.php(3754): Wikimedia\Rdbms\TransactionManager->onDestruct()
    #3 [internal function]: Wikimedia\Rdbms\Database->__destruct()
    #4 {main}
    2023-12-13 14:26:09 web plugin_mediawiki_standalone_farm: [a944b831a8f3e63c28df52fa] /mediawiki/w/rest.php/tuleap/maintenance/%2A/terminate-sessions   PHP Notice: DB transaction writes or callbacks still pending (LCStoreDB::finishWrite, LCStoreDB::finishWrite, LCStoreDB::finishWrite, LCStoreDB::finishWrite, LCStoreDB::finishWrite, LCStoreDB::finishWrite, LCStoreDB::finishWrite, LCStoreDB::finishWrite, LCStoreDB::finishWrite, LCStoreDB::finishWrite, LCStoreDB::finishWrite, LCStoreDB::finishWrite, LCStoreDB::finishWrite, LCStoreDB::finishWrite, LCStoreDB::finishWrite, LCStoreDB::finishWrite, LCStoreDB::finishWrite, LCStoreDB::finishWrite, LCStoreDB::finishWrite)
    #0 [internal function]: MWExceptionHandler::handleError()
    #1 /usr/share/mediawiki-tuleap-flavor/current-lts/includes/libs/rdbms/database/Database.php(3760): trigger_error()
    #2 [internal function]: Wikimedia\Rdbms\Database->__destruct()
    #3 {main}
    

    E.g. Login process

    ==> mediawiki_log <==
    2023-12-15 10:21:29 web plugin_mediawiki_101: [9012d500a9a47da1dab2f7ed] /mediawiki/_oauth/Special:TuleapLogin/callback?state=bffe36965a97c4630d07631e303a3c78&code=tlp-oauth2-ac1-2.bc1bd1fb70a7ec46d94c0364e47a6d9edbbee127740ae0317935df1fc4d5ca87   PHP Deprecated: $wgUser reassignment detected [Called from TuleapIntegration\Special\TuleapLogin::callback]
    #0 [internal function]: MWExceptionHandler::handleError()
    #1 /usr/share/mediawiki-tuleap-flavor/current-lts/includes/debug/MWDebug.php(381): trigger_error()
    #2 /usr/share/mediawiki-tuleap-flavor/current-lts/includes/debug/MWDebug.php(352): MWDebug::sendRawDeprecated()
    #3 /usr/share/mediawiki-tuleap-flavor/current-lts/includes/GlobalFunctions.php(790): MWDebug::deprecatedMsg()
    #4 /usr/share/mediawiki-tuleap-flavor/current-lts/includes/StubGlobalUser.php(145): wfDeprecatedMsg()
    #5 /usr/share/mediawiki-tuleap-flavor/current-lts/extensions/TuleapIntegration/src/Special/TuleapLogin.php(171): StubGlobalUser->__destruct()
    #6 /usr/share/mediawiki-tuleap-flavor/current-lts/extensions/TuleapIntegration/src/Special/TuleapLogin.php(119): TuleapIntegration\Special\TuleapLogin->setUser()
    #7 /usr/share/mediawiki-tuleap-flavor/current-lts/extensions/TuleapIntegration/src/Special/TuleapLogin.php(82): TuleapIntegration\Special\TuleapLogin->callback()
    #8 /usr/share/mediawiki-tuleap-flavor/current-lts/includes/specialpage/SpecialPage.php(701): TuleapIntegration\Special\TuleapLogin->execute()
    #9 /usr/share/mediawiki-tuleap-flavor/current-lts/includes/specialpage/SpecialPageFactory.php(1428): SpecialPage->run()
    #10 /usr/share/mediawiki-tuleap-flavor/current-lts/includes/MediaWiki.php(316): MediaWiki\SpecialPage\SpecialPageFactory->executePath()
    #11 /usr/share/mediawiki-tuleap-flavor/current-lts/includes/MediaWiki.php(904): MediaWiki->performRequest()
    #12 /usr/share/mediawiki-tuleap-flavor/current-lts/includes/MediaWiki.php(562): MediaWiki->main()
    #13 /usr/share/mediawiki-tuleap-flavor/current-lts/index.php(50): MediaWiki->run()
    #14 /usr/share/mediawiki-tuleap-flavor/current-lts/index.php(46): wfIndexMain()
    #15 {main}
    2023-12-15 10:21:29 web plugin_mediawiki_101: [9012d500a9a47da1dab2f7ed] /mediawiki/_oauth/Special:TuleapLogin/callback?state=bffe36965a97c4630d07631e303a3c78&code=tlp-oauth2-ac1-2.bc1bd1fb70a7ec46d94c0364e47a6d9edbbee127740ae0317935df1fc4d5ca87   PHP Notice: Uncommitted DB writes (transaction from Wikimedia\Rdbms\Database::beginIfImplied (TuleapWikiFarm\GlobalStorage::getAuthInstanceFromState))
    #0 [internal function]: MWExceptionHandler::handleError()
    #1 /usr/share/mediawiki-tuleap-flavor/current-lts/includes/libs/rdbms/database/TransactionManager.php(583): trigger_error()
    #2 /usr/share/mediawiki-tuleap-flavor/current-lts/includes/libs/rdbms/database/Database.php(3754): Wikimedia\Rdbms\TransactionManager->onDestruct()
    #3 [internal function]: Wikimedia\Rdbms\Database->__destruct()
    #4 {main}
    2023-12-15 10:21:29 web plugin_mediawiki_101: [9012d500a9a47da1dab2f7ed] /mediawiki/_oauth/Special:TuleapLogin/callback?state=bffe36965a97c4630d07631e303a3c78&code=tlp-oauth2-ac1-2.bc1bd1fb70a7ec46d94c0364e47a6d9edbbee127740ae0317935df1fc4d5ca87   PHP Notice: DB transaction writes or callbacks still pending (Wikimedia\Rdbms\Database::delete)
    #0 [internal function]: MWExceptionHandler::handleError()
    #1 /usr/share/mediawiki-tuleap-flavor/current-lts/includes/libs/rdbms/database/Database.php(3760): trigger_error()
    #2 [internal function]: Wikimedia\Rdbms\Database->__destruct()
    #3 {main}
    
    Mediawiki Standalone
    Empty
    Empty
    • [ ] enhancement
    • [ ] internal improvement
    Empty
    Stage
    Dejan Savuljesku (dsavuljesku)
    Closed
    2024-04-24
    Attachments
    Empty
    References
    Referencing request #35485
    Referenced by request #35485

    Artifact Tracker v5

    rel #36797 15.8

    Follow-ups

    User avatar

    With patches below all of the issues listed in the ticket are fixed.

    There are still some bening deprecations left, but as they are unrelated to this topic, i would suggest to create a separate ticket for those

    <pre>2024/04/11 09:27:51 [error] 1650#1650: *185 FastCGI sent in stderr: "PHP message: PHP Deprecated: Premature access to service container [Called from require_once in /usr/share/mediawiki-tuleap-flavor/current-lts/extensions/TuleapWikiFarm/TuleapWikiFarm.Dispatcher.php at line 10] in /usr/share/mediawiki-tuleap-flavor/current-lts/includes/debug/MWDebug.php on line 381; PHP message: PHP Deprecated: Premature access to service 'HookContainer' [Called from MediaWiki\MediaWikiServices::getInstance in /usr/share/mediawiki-tuleap-flavor/current-lts/includes/MediaWikiServices.php at line 289] in /usr/share/mediawiki-tuleap-flavor/current-lts/includes/debug/MWDebug.php on line 381; PHP message: PHP Deprecated: Premature access to service 'ObjectFactory' [Called from Wikimedia\Services\ServiceContainer::{closure} in /usr/share/mediawiki-tuleap-flavor/current-lts/includes/ServiceWiring.php at line 721] in /usr/share/mediawiki-tuleap-flavor/current-lts/includes/debug/MWDebug.php on line 381; PHP message: PHP Deprecated: Premature access to service 'DBLoadBalancer' [Called from require_once in /usr/share/mediawiki-tuleap-flavor/current-lts/extensions/TuleapWikiFarm/TuleapWikiFarm.Dispatcher.php at line 10] in /usr/share/mediawiki-tuleap-flavor/current-lts/includes/debug/MWDebug.php on line 381; PHP message: PHP Deprecated: Premature access to service 'DBLoadBalancerFactory' [Called from Wikimedia\Services\ServiceContainer::{closure} in /usr/share/mediawiki-tuleap-flavor/current-lts/includes/ServiceWiring.php at line 539] in /usr/share/mediawiki-tuleap-flavor/current-lts/includes/debug/MWDebug.php on line 381; PHP message: PHP Deprecated: Premature access to service 'MainConfig' [Called from Wikimedia\Services\ServiceContainer::{closure} in /usr/share/mediawiki-tuleap-flavor/current-lts/includes/ServiceWiring.php at line 544] in /usr/share/mediawiki-tuleap-flavor/current-lts/includes/debug/MWDebug.php on line 381; PHP message: PHP Deprecated: Premature access to service 'ConfigFactory' [Called from Wikimedia\Services\Se…</pre>