Page MenuHomePhabricator

Auth_remoteuser extension causes TypeError when running maintenance tasks
Closed, ResolvedPublic

Description

After upgrading to Media Wiki 1.33.1 I get the following exception when invoking

php maintenance/cleanupUploadStash.php

removing 53 file(s)...
[caabcde1387e81a2db0712da] [no req] TypeError from line 111 of /srv/www/exv/htdocs/mw/vendor/psr/log/Psr/Log/AbstractLogger.php: Argument 2 passed to Psr\Log\AbstractLogger::info() must be of the type array, null given, called in /srv/www/exv/htdocs/mw/extensions/Auth_remoteuser/src/UserNameSessionProvider.php on line 473
Backtrace:
#0 /srv/www/exv/htdocs/mw/extensions/Auth_remoteuser/src/UserNameSessionProvider.php(473): Psr\Log\AbstractLogger->info(string, NULL)
#1 /srv/www/exv/htdocs/mw/includes/session/SessionManager.php(782): MediaWiki\Extension\Auth_remoteuser\UserNameSessionProvider->refreshSessionInfo(MediaWiki\Session\SessionInfo, FauxRequest, NULL)
#2 /srv/www/exv/htdocs/mw/includes/session/SessionManager.php(221): MediaWiki\Session\SessionManager->loadSessionInfoFromStore(MediaWiki\Session\SessionInfo, FauxRequest)
#3 /srv/www/exv/htdocs/mw/includes/WebRequest.php(742): MediaWiki\Session\SessionManager->getSessionById(string, boolean, FauxRequest)
#4 /srv/www/exv/htdocs/mw/includes/user/User.php(1320): WebRequest->getSession()
#5 /srv/www/exv/htdocs/mw/includes/user/User.php(443): User->loadDefaults()
#6 /srv/www/exv/htdocs/mw/includes/user/User.php(2433): User->load()
#7 /srv/www/exv/htdocs/mw/includes/upload/UploadStash.php(100): User->getId()
#8 /srv/www/exv/htdocs/mw/maintenance/cleanupUploadStash.php(77): UploadStash->__construct(LocalRepo)
#9 /srv/www/exv/htdocs/mw/maintenance/doMaintenance.php(96): CleanupUploadStash->execute()
#10 /srv/www/exv/htdocs/mw/maintenance/cleanupUploadStash.php(156): require_once(string)
#11 {main}

The problem seems to be caused in Auth_remoteuser/src/UserNameSessionProvider.php(473), where a NULL argument is not handled appropriately. The same error occurs with

php maintenance/update.php

A possible workaround is to disable Auth_remoteuser before performing the maintenance task and subsequently reactivating the extension.

Here are some details about the system causing the error:
OS: OpenSuse Leap 15.1
MediaWiki: 1.33.1
PHP: 7.2.5
MariaDB: 10.2.25
Auth_remoteuser: 2.1.0

Disclaimer: This is my first bug report in phabricator. In case it does not meet the requirements, please let me know.

Event Timeline

That bug was fixed by in April 2019: https://gerrit.wikimedia.org/r/plugins/gitiles/mediawiki/extensions/Auth_remoteuser/+/1436b981d6ff721cb7e0072cf32779d56ce03f45%5E%21/

A new version should probably be tagged and published, but I'm not 100% sure how to do that. Since it's just a bugfix, I would imagine 2.1.1 would make sense.

jrchamp claimed this task.
jrchamp changed the subtype of this task from "Task" to "Release".

Thank you @Claashk - this was just the push I needed to learn more about the gerrit workflow.

I've tagged and released version 2.1.1 that contains the fix and applied the fix to all of the supported release branches. Hopefully this should resolve the issue. If not, feel free to reopen. :)

Restricted Application changed the subtype of this task from "Release" to "Task". · View Herald TranscriptNov 11 2019, 10:52 PM

Thanks for the quick reply. The patch fixes the issue. I should add, that I changed the code manually, because the fix is sufficiently trivial and did not attempt to download the current version. Sorry I did not spot the associated issue before opening the ticket.

I would also like to thank you for providing and maintaining this excellent extension to Mediawiki.