Page MenuHomePhabricator

TypeError: Return value of User::getEmail() must be of the type string, null returned
Closed, ResolvedPublicPRODUCTION ERROR

Description

Error
normalized_message
[{reqId}] {exception_url}   TypeError: Return value of User::getEmail() must be of the type string, null returned
exception.trace
from /srv/mediawiki/php-1.37.0-wmf.3/includes/user/User.php(2525)
#0 /srv/mediawiki/php-1.37.0-wmf.3/includes/user/User.php(3095): User->getEmail()
#1 /srv/mediawiki/php-1.37.0-wmf.3/extensions/Thanks/includes/Hooks.php(116): User->isSystemUser()
#2 /srv/mediawiki/php-1.37.0-wmf.3/extensions/Thanks/includes/Hooks.php(436): MediaWiki\Extension\Thanks\Hooks::canReceiveThanks(User)
#3 /srv/mediawiki/php-1.37.0-wmf.3/includes/HookContainer/HookContainer.php(330): MediaWiki\Extension\Thanks\Hooks::onLogEventsListLineEnding(LogEventsList, string, DatabaseLogEntry, array, array)
#4 /srv/mediawiki/php-1.37.0-wmf.3/includes/HookContainer/HookContainer.php(137): MediaWiki\HookContainer\HookContainer->callLegacyHook(string, array, array, array)
#5 /srv/mediawiki/php-1.37.0-wmf.3/includes/HookContainer/HookRunner.php(2470): MediaWiki\HookContainer\HookContainer->run(string, array)
#6 /srv/mediawiki/php-1.37.0-wmf.3/includes/logging/LogEventsList.php(420): MediaWiki\HookContainer\HookRunner->onLogEventsListLineEnding(LogEventsList, string, DatabaseLogEntry, array, array)
#7 /srv/mediawiki/php-1.37.0-wmf.3/includes/logging/LogPager.php(441): LogEventsList->logLine(stdClass)
#8 /srv/mediawiki/php-1.37.0-wmf.3/includes/pager/IndexPager.php(611): LogPager->formatRow(stdClass)
#9 /srv/mediawiki/php-1.37.0-wmf.3/includes/specials/SpecialLog.php(274): IndexPager->getBody()
#10 /srv/mediawiki/php-1.37.0-wmf.3/includes/specials/SpecialLog.php(156): SpecialLog->show(FormOptions, array)
#11 /srv/mediawiki/php-1.37.0-wmf.3/includes/specialpage/SpecialPage.php(646): SpecialLog->execute(NULL)
#12 /srv/mediawiki/php-1.37.0-wmf.3/includes/specialpage/SpecialPageFactory.php(1397): SpecialPage->run(NULL)
#13 /srv/mediawiki/php-1.37.0-wmf.3/includes/MediaWiki.php(313): MediaWiki\SpecialPage\SpecialPageFactory->executePath(string, RequestContext)
#14 /srv/mediawiki/php-1.37.0-wmf.3/includes/MediaWiki.php(916): MediaWiki->performRequest()
#15 /srv/mediawiki/php-1.37.0-wmf.3/includes/MediaWiki.php(550): MediaWiki->main()
#16 /srv/mediawiki/php-1.37.0-wmf.3/index.php(53): MediaWiki->run()
#17 /srv/mediawiki/php-1.37.0-wmf.3/index.php(46): wfIndexMain()
#18 /srv/mediawiki/w/index.php(3): require(string)
#19 {main}
Impact
Notes

Details

Request URL
https://arbcom-en.wikipedia.org/w/index.php?title=*&page=*

Event Timeline

jeena changed Request URL from https://jobrunner.discovery.wmnet/rpc/RunSingleJob.php to https://arbcom-en.wikipedia.org/w/index.php?title=*&page=*.

Type hints were added in https://gerrit.wikimedia.org/r/c/mediawiki/core/+/676444

There is one hook usage for the hook from User::getEmail - https://gerrit.wikimedia.org/g/mediawiki/extensions/CentralAuth/+/5132d01f4a57ea40901937700e84eaed302ef053/includes/CentralAuthHooks.php#810

CentralAuthUser::getEmail is not typehinted. The database field is gu_email varchar(255) binary, (in code, not sure if that is true in production)

Change 690275 had a related patch set uploaded (by Ppchelko; author: Ppchelko):

[mediawiki/extensions/CentralAuth@master] Never return null from CentralAuthUser::getEmail

https://gerrit.wikimedia.org/r/690275

Change 690275 merged by jenkins-bot:

[mediawiki/extensions/CentralAuth@master] Never return null from CentralAuthUser::getEmail

https://gerrit.wikimedia.org/r/690275