Various User.php: PHP Notice: Object of class User could not be converted to int
Closed, ResolvedPublic

Description

Error

Requests ID:

W--4OQpAIDEAAFRJITsAAABU (line 411 and 467)
W--37ApAIDAAAERL69gAAAAV (line 1442)

User.php reported several PHP Notice: Object of class User could not be converted to int from three different lines. The first two are related, the third is independent. Count of each messages is shown below.

message
830 ErrorException from line 411 of /srv/mediawiki/php-1.33.0-wmf.6/includes/user/User.php: PHP Notice: Object of class User could not be converted to int
830 ErrorException from line 467 of /srv/mediawiki/php-1.33.0-wmf.6/includes/user/User.php: PHP Notice: Object of class User could not be converted to int

Apparently each of those two lines are emitted 16 times per request?

message
293 ErrorException from line 1442 of /srv/mediawiki/php-1.33.0-wmf.6/includes/user/User.php: PHP Notice: Object of class User could not be converted to int
trace User.php:467
#0 /srv/mediawiki/php-1.33.0-wmf.6/includes/user/User.php(467): MWExceptionHandler::handleError(integer, string, string, integer, array, array)
#1 /srv/mediawiki/php-1.33.0-wmf.6/includes/user/User.php(419): User->loadFromId(integer)
#2 /srv/mediawiki/php-1.33.0-wmf.6/includes/user/User.php(2480): User->load()
#3 /srv/mediawiki/php-1.33.0-wmf.6/extensions/MobileFrontend/includes/models/MobilePage.php(90): User->getName()
#4 /srv/mediawiki/php-1.33.0-wmf.6/extensions/MobileFrontend/includes/specials/SpecialMobileEditWatchlist.php(50): MobilePage->getLatestEdit()
#5 /srv/mediawiki/php-1.33.0-wmf.6/extensions/MobileFrontend/includes/specials/SpecialMobileEditWatchlist.php(237): SpecialMobileEditWatchlist->getLineHtml(MobilePage)
#6 /srv/mediawiki/php-1.33.0-wmf.6/extensions/MobileFrontend/includes/specials/SpecialMobileEditWatchlist.php(206): SpecialMobileEditWatchlist->getViewHtml(MobileCollection)
#7 /srv/mediawiki/php-1.33.0-wmf.6/includes/specials/SpecialEditWatchlist.php(130): SpecialMobileEditWatchlist->executeViewEditWatchlist()
#8 /srv/mediawiki/php-1.33.0-wmf.6/extensions/MobileFrontend/includes/specials/SpecialMobileEditWatchlist.php(99): SpecialEditWatchlist->execute(boolean)
#9 /srv/mediawiki/php-1.33.0-wmf.6/includes/specialpage/SpecialPage.php(569): SpecialMobileEditWatchlist->execute(NULL)
#10 /srv/mediawiki/php-1.33.0-wmf.6/includes/specialpage/SpecialPageFactory.php(558): SpecialPage->run(NULL)
#11 /srv/mediawiki/php-1.33.0-wmf.6/includes/MediaWiki.php(288): MediaWiki\Special\SpecialPageFactory->executePath(Title, RequestContext)
#12 /srv/mediawiki/php-1.33.0-wmf.6/includes/MediaWiki.php(862): MediaWiki->performRequest()
#13 /srv/mediawiki/php-1.33.0-wmf.6/includes/MediaWiki.php(517): MediaWiki->main()
#14 /srv/mediawiki/php-1.33.0-wmf.6/index.php(42): MediaWiki->run()
#15 /srv/mediawiki/w/index.php(3): include(string)
#16 {main}
trace User.php:1442
#0 /srv/mediawiki/php-1.33.0-wmf.6/includes/user/User.php(1442): MWExceptionHandler::handleError(integer, string, string, integer, array, array)
#1 /srv/mediawiki/php-1.33.0-wmf.6/includes/user/User.php(540): User->loadFromDatabase(integer)
#2 /srv/mediawiki/php-1.33.0-wmf.6/includes/libs/objectcache/WANObjectCache.php(1128): Closure$User::loadFromCache(boolean, integer, array, NULL)
#3 /srv/mediawiki/php-1.33.0-wmf.6/includes/libs/objectcache/WANObjectCache.php(1277): Closure$WANObjectCache::getWithSetCallback(boolean, integer, array, NULL)
#4 /srv/mediawiki/php-1.33.0-wmf.6/includes/libs/objectcache/WANObjectCache.php(1134): WANObjectCache->doGetWithSetCallback(string, integer, Closure$WANObjectCache::getWithSetCallback;1466, array, NULL)
#5 /srv/mediawiki/php-1.33.0-wmf.6/includes/user/User.php(565): WANObjectCache->getWithSetCallback(string, integer, Closure$User::loadFromCache;4441, array)
#6 /srv/mediawiki/php-1.33.0-wmf.6/includes/user/User.php(482): User->loadFromCache()
#7 /srv/mediawiki/php-1.33.0-wmf.6/includes/user/User.php(419): User->loadFromId(integer)
#8 /srv/mediawiki/php-1.33.0-wmf.6/includes/user/User.php(2480): User->load()
#9 /srv/mediawiki/php-1.33.0-wmf.6/extensions/MobileFrontend/includes/models/MobilePage.php(90): User->getName()
#10 /srv/mediawiki/php-1.33.0-wmf.6/extensions/MobileFrontend/includes/specials/SpecialMobileEditWatchlist.php(50): MobilePage->getLatestEdit()
#11 /srv/mediawiki/php-1.33.0-wmf.6/extensions/MobileFrontend/includes/specials/SpecialMobileEditWatchlist.php(237): SpecialMobileEditWatchlist->getLineHtml(MobilePage)
#12 /srv/mediawiki/php-1.33.0-wmf.6/extensions/MobileFrontend/includes/specials/SpecialMobileEditWatchlist.php(206): SpecialMobileEditWatchlist->getViewHtml(MobileCollection)
#13 /srv/mediawiki/php-1.33.0-wmf.6/includes/specials/SpecialEditWatchlist.php(130): SpecialMobileEditWatchlist->executeViewEditWatchlist()
#14 /srv/mediawiki/php-1.33.0-wmf.6/extensions/MobileFrontend/includes/specials/SpecialMobileEditWatchlist.php(99): SpecialEditWatchlist->execute(boolean)
#15 /srv/mediawiki/php-1.33.0-wmf.6/includes/specialpage/SpecialPage.php(569): SpecialMobileEditWatchlist->execute(NULL)
#16 /srv/mediawiki/php-1.33.0-wmf.6/includes/specialpage/SpecialPageFactory.php(558): SpecialPage->run(NULL)
#17 /srv/mediawiki/php-1.33.0-wmf.6/includes/MediaWiki.php(288): MediaWiki\Special\SpecialPageFactory->executePath(Title, RequestContext)
#18 /srv/mediawiki/php-1.33.0-wmf.6/includes/MediaWiki.php(862): MediaWiki->performRequest()
#19 /srv/mediawiki/php-1.33.0-wmf.6/includes/MediaWiki.php(517): MediaWiki->main()
#20 /srv/mediawiki/php-1.33.0-wmf.6/index.php(42): MediaWiki->run()
#21 /srv/mediawiki/w/index.php(3): include(string)
#22 {main}

Impact

Notes

hashar created this task.Thu, Nov 29, 3:04 PM
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptThu, Nov 29, 3:04 PM
hashar triaged this task as Unbreak Now! priority.Thu, Nov 29, 3:04 PM
Restricted Application added subscribers: Liuxinyu970226, TerraCodes. · View Herald TranscriptThu, Nov 29, 3:04 PM
hashar updated the task description. (Show Details)Thu, Nov 29, 3:08 PM

I think it is related to MobileFrontend the few stacktraces I have looked at all comes from it. And apparently from the watchlist edit.

Change 476537 had a related patch set uploaded (by Pmiazga; owner: Pmiazga):
[mediawiki/extensions/MobileFrontend@master] RecordRevision::getUser() returns UserIdentity not int

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

Change 476537 merged by jenkins-bot:
[mediawiki/extensions/MobileFrontend@master] RecordRevision::getUser() returns UserIdentity not int

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

greg added a subscriber: greg.Thu, Nov 29, 6:40 PM

If that patch fixes the issue (as far as you can tell) please backport to wmf.6 asap. :)

Change 476596 had a related patch set uploaded (by Pmiazga; owner: Pmiazga):
[mediawiki/extensions/MobileFrontend@wmf/1.33.0-wmf.6] RecordRevision::getUser() returns UserIdentity not int

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

Change 476596 merged by jenkins-bot:
[mediawiki/extensions/MobileFrontend@wmf/1.33.0-wmf.6] RecordRevision::getUser() returns UserIdentity not int

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

Mentioned in SAL (#wikimedia-operations) [2018-11-29T19:16:19Z] <hashar@deploy1001> Synchronized php-1.33.0-wmf.6/extensions/MobileFrontend/: RecordRevision::getUser() returns UserIdentity not int - T210737 (duration: 00m 55s)

hashar closed this task as Resolved.Thu, Nov 29, 7:40 PM
hashar assigned this task to pmiazga.

Should be good now