Page MenuHomePhabricator

DivisionByZeroError: Division by zero (in ChangesListQuery.php)
Closed, ResolvedPublicPRODUCTION ERROR

Description

Error
  • service.version: 1.46.0-wmf.1
  • timestamp: 2025-11-11T15:08:13.949Z
  • labels.phpversion: 8.1.33
  • trace.id: a7549193-970c-4bf1-97aa-da9d48211c38
  • Find trace.id in Logstash
labels.normalized_message
[{reqId}] {exception_url}   DivisionByZeroError: Division by zero
FrameLocationCall
from/srv/mediawiki/php-1.46.0-wmf.1/includes/RecentChanges/ChangesListQuery/ChangesListQuery.php(1519)
#0/srv/mediawiki/php-1.46.0-wmf.1/includes/RecentChanges/ChangesListQuery/ChangesListQuery.php(1443)MediaWiki\RecentChanges\ChangesListQuery\ChangesListQuery->doPartitionQuery(Wikimedia\Rdbms\SelectQueryBuilder, array)
#1/srv/mediawiki/php-1.46.0-wmf.1/includes/RecentChanges/ChangesListQuery/ChangesListQuery.php(1023)MediaWiki\RecentChanges\ChangesListQuery\ChangesListQuery->doPartitionUnion(array)
#2/srv/mediawiki/php-1.46.0-wmf.1/includes/SpecialPage/ChangesListSpecialPage.php(807)MediaWiki\RecentChanges\ChangesListQuery\ChangesListQuery->fetchResult()
#3/srv/mediawiki/php-1.46.0-wmf.1/includes/SpecialPage/ChangesListSpecialPage.php(483)MediaWiki\SpecialPage\ChangesListSpecialPage->getQueryResult()
#4/srv/mediawiki/php-1.46.0-wmf.1/includes/specials/SpecialWatchlist.php(151)MediaWiki\SpecialPage\ChangesListSpecialPage->execute(null)
#5/srv/mediawiki/php-1.46.0-wmf.1/includes/SpecialPage/SpecialPage.php(711)MediaWiki\Specials\SpecialWatchlist->execute(null)
#6/srv/mediawiki/php-1.46.0-wmf.1/includes/SpecialPage/SpecialPageFactory.php(1736)MediaWiki\SpecialPage\SpecialPage->run(null)
#7/srv/mediawiki/php-1.46.0-wmf.1/includes/actions/ActionEntryPoint.php(499)MediaWiki\SpecialPage\SpecialPageFactory->executePath(string, MediaWiki\Context\RequestContext)
#8/srv/mediawiki/php-1.46.0-wmf.1/includes/actions/ActionEntryPoint.php(143)MediaWiki\Actions\ActionEntryPoint->performRequest()
#9/srv/mediawiki/php-1.46.0-wmf.1/includes/MediaWikiEntryPoint.php(184)MediaWiki\Actions\ActionEntryPoint->execute()
#10/srv/mediawiki/php-1.46.0-wmf.1/index.php(44)MediaWiki\MediaWikiEntryPoint->run()
#11/srv/mediawiki/w/index.php(3)require(string)
#12{main}
Impact

Low.

Notes

Looks like a small regression related to T403798.

While this comes from old 1.46.0-wmf.1, I'd assume this can still happen in the current code as there seems to be no guardrail against the cornercase $m['queryPeriod'] / $m['actualPeriod'] = 1 when calling
->incrementBy( $m['actualRows'] * ( $m['queryPeriod'] / $m['actualPeriod'] - 1 ) );
in
https://gerrit.wikimedia.org/r/plugins/gitiles/mediawiki/core/+blame/refs/heads/wmf/1.46.0-wmf.1/includes/RecentChanges/ChangesListQuery/ChangesListQuery.php#1519

Details

Request URL
https://he.wikipedia.org/wiki/%D7%9E%D7%99%D7%95%D7%97%D7%93:%D7%A8%D7%A9%D7%99%D7%9E%D7%AA_%D7%94%D7%9E%D7%A2%D7%A7%D7%91?action=render&damaging__likelybad_color=*&damaging__verylikelybad_color=*&days=*&enhanced=*&from=*&hideWikibase=*&hidebots=*&isAnon=*&limit=*&peek=*&urlversion=*
Related Changes in Gerrit:

Event Timeline

Change #1204104 had a related patch set uploaded (by Tim Starling; author: Tim Starling):

[mediawiki/core@master] recentchanges: Avoid division by zero in doPartitionQuery

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

Change #1204104 merged by jenkins-bot:

[mediawiki/core@master] recentchanges: Avoid division by zero in doPartitionQuery

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

tstarling claimed this task.