Page MenuHomePhabricator

Logs without a defined title or page_id cause an exception in CheckUser
Closed, ResolvedPublic1 Estimated Story PointsBUG REPORT

Description

In 8ae6f753509f760fd178210105de5140ac9a5f86, the CheckUserLookupUtils::getManualLogEntryFromRow method was added. This method would throw an exception if neither of title and namespace, or page_id was defined.

However, some private CheckUser events inserted to the database before b6759da0882f8960d3de730fb61f4277c93a497e can meet these conditions. As such, the throwing of the exception should be removed and instead no target should be added.

This is more of an issue for the MW-1.42-release, because wikis that follow the stable release will not get the commit b6759da0882f8960d3de730fb61f4277c93a497e until they upgrade to 1.42 which means these entries with no title or page ID will not have expired from the database like has happened (nearly for all entries) on production.

Steps to replicate the issue (include links if applicable):

  1. Checkout d1ec8fc2c21c4ff24cb2f8ec404aadbd5e2c8347
  2. Set $wgCheckUserLogLogins = true; in your LocalSettings.php
  3. Checkout 8ae6f753509f760fd178210105de5140ac9a5f86
  4. Run a check using Special:CheckUser on the IP you used to make the failed login attempt

What happens?:
An exception appears with the following stack trace:

/wiki/Special:CheckUser LogicException: Either title and namespace, or page must be set in the row.

Backtrace:

from /var/www/html/w/extensions/CheckUser/src/Services/CheckUserLookupUtils.php(165)
#0 /var/www/html/w/extensions/CheckUser/src/CheckUser/Pagers/CheckUserGetActionsPager.php(268): MediaWiki\CheckUser\Services\CheckUserLookupUtils->getManualLogEntryFromRow()
#1 /var/www/html/w/extensions/CheckUser/src/CheckUser/Pagers/CheckUserGetActionsPager.php(212): MediaWiki\CheckUser\CheckUser\Pagers\CheckUserGetActionsPager->getActionText()
#2 /var/www/html/w/includes/pager/ReverseChronologicalPager.php(134): MediaWiki\CheckUser\CheckUser\Pagers\CheckUserGetActionsPager->formatRow()
#3 /var/www/html/w/includes/pager/IndexPager.php(594): MediaWiki\Pager\ReverseChronologicalPager->getRow()
#4 /var/www/html/w/extensions/CheckUser/src/CheckUser/SpecialCheckUser.php(363): MediaWiki\Pager\IndexPager->getBody()
#5 /var/www/html/w/includes/specialpage/SpecialPage.php(718): MediaWiki\CheckUser\CheckUser\SpecialCheckUser->execute()
#6 /var/www/html/w/includes/specialpage/SpecialPageFactory.php(1669): MediaWiki\SpecialPage\SpecialPage->run()
#7 /var/www/html/w/includes/actions/ActionEntryPoint.php(504): MediaWiki\SpecialPage\SpecialPageFactory->executePath()
#8 /var/www/html/w/includes/actions/ActionEntryPoint.php(145): MediaWiki\Actions\ActionEntryPoint->performRequest()
#9 /var/www/html/w/includes/MediaWikiEntryPoint.php(199): MediaWiki\Actions\ActionEntryPoint->execute()
#10 /var/www/html/w/index.php(58): MediaWiki\MediaWikiEntryPoint->run()
#11 {main}

What should have happened instead?:
No exception should appear

Event Timeline

Change #1018790 had a related patch set uploaded (by Dreamy Jazz; author: Dreamy Jazz):

[mediawiki/extensions/CheckUser@master] Ignore misisng title/page in CheckUserLookupUtils::getManualLogEntryFromRow

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

Change #1018695 had a related patch set uploaded (by Dreamy Jazz; author: Dreamy Jazz):

[mediawiki/extensions/CheckUser@REL1_42] Ignore misisng title/page in CheckUserLookupUtils::getManualLogEntryFromRow

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

Causing errors on wmf.26. Making a train blocker as this has been reported by CUs when trying to make range checks and makes it impossible to run these checks - Relevant errors are at https://logstash.wikimedia.org/goto/af8db930269e4a62ad5ef4e7e2214186.

The rate of these errors is expected to be much larger if this hits group2 wikis, as range checks are made frequently on enwiki.

Change #1018967 had a related patch set uploaded (by Dreamy Jazz; author: Dreamy Jazz):

[mediawiki/extensions/CheckUser@wmf/1.42.0-wmf.26] Ignore misisng title/page in CheckUserLookupUtils::getManualLogEntryFromRow

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

Change #1018695 merged by jenkins-bot:

[mediawiki/extensions/CheckUser@REL1_42] Ignore missing title/page in CheckUserLookupUtils::getManualLogEntryFromRow

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

Change #1018967 merged by jenkins-bot:

[mediawiki/extensions/CheckUser@wmf/1.42.0-wmf.26] Ignore missing title/page in CheckUserLookupUtils::getManualLogEntryFromRow

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

Mentioned in SAL (#wikimedia-operations) [2024-04-11T13:50:49Z] <dreamyjazz@deploy1002> Started scap: Backport for [[gerrit:1018967|Ignore missing title/page in CheckUserLookupUtils::getManualLogEntryFromRow (T362284)]]

Mentioned in SAL (#wikimedia-operations) [2024-04-11T13:55:47Z] <dreamyjazz@deploy1002> dreamyjazz: Backport for [[gerrit:1018967|Ignore missing title/page in CheckUserLookupUtils::getManualLogEntryFromRow (T362284)]] synced to the testservers (https://wikitech.wikimedia.org/wiki/Mwdebug)

Change #1018790 merged by jenkins-bot:

[mediawiki/extensions/CheckUser@master] Ignore missing title/page in CheckUserLookupUtils::getManualLogEntryFromRow

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

Mentioned in SAL (#wikimedia-operations) [2024-04-11T14:08:31Z] <dreamyjazz@deploy1002> Finished scap: Backport for [[gerrit:1018967|Ignore missing title/page in CheckUserLookupUtils::getManualLogEntryFromRow (T362284)]] (duration: 17m 42s)

Sorry I was processing the backlog of errors that happened today and missed it got fixed an hour or so ago! Thank you.