Page MenuHomePhabricator

MediaViewer broken in wmf.20 due to LESS change: Less_Exception_Compiler: error evaluating function `floor` math functions take numbers as parameters index: 1191 in mmv.ui.metadataPanel.less
Closed, ResolvedPublic5 Estimated Story PointsPRODUCTION ERROR

Description

Error
  • [[ Logstash single document URL | Request ID ]]
message
Less_Exception_Compiler: error evaluating function `floor` math functions take numbers as parameters index: 1191 in mmv.ui.metadataPanel.less on line 43, column 3
41| 		margin: 0 0 @horizontal-padding;
42| 		padding: @vertical-padding @horizontal-padding 0 @horizontal-padding;
43| 		line-height: floor( @height / 2 );  // two lines
44| 		font-size: 16px;
45| 	}
46|
trace
Backtrace:
from /srv/mediawiki/php-1.44.0-wmf.20/vendor/wikimedia/less.php/lib/Less/Tree/Call.php(135)
#0 /srv/mediawiki/php-1.44.0-wmf.20/vendor/wikimedia/less.php/lib/Less/Tree/Expression.php(46): Less_Tree_Call->compile(Less_Environment)
#1 /srv/mediawiki/php-1.44.0-wmf.20/vendor/wikimedia/less.php/lib/Less/Tree/Value.php(29): Less_Tree_Expression->compile(Less_Environment)
#2 /srv/mediawiki/php-1.44.0-wmf.20/vendor/wikimedia/less.php/lib/Less/Tree/Declaration.php(100): Less_Tree_Value->compile(Less_Environment)
#3 /srv/mediawiki/php-1.44.0-wmf.20/vendor/wikimedia/less.php/lib/Less/Tree/Ruleset.php(97): Less_Tree_Declaration->compile(Less_Environment)
#4 /srv/mediawiki/php-1.44.0-wmf.20/vendor/wikimedia/less.php/lib/Less/Tree/Ruleset.php(97): Less_Tree_Ruleset->compile(Less_Environment)
#5 /srv/mediawiki/php-1.44.0-wmf.20/vendor/wikimedia/less.php/lib/Less/Tree/Ruleset.php(97): Less_Tree_Ruleset->compile(Less_Environment)
#6 /srv/mediawiki/php-1.44.0-wmf.20/vendor/wikimedia/less.php/lib/Less/Parser.php(225): Less_Tree_Ruleset->compile(Less_Environment)
#7 /srv/mediawiki/php-1.44.0-wmf.20/includes/ResourceLoader/FileModule.php(1115): Less_Parser->getCss()
#8 /srv/mediawiki/php-1.44.0-wmf.20/includes/ResourceLoader/FileModule.php(999): MediaWiki\ResourceLoader\FileModule->compileLessString(string, string, MediaWiki\ResourceLoader\Context)
#9 /srv/mediawiki/php-1.44.0-wmf.20/includes/ResourceLoader/FileModule.php(975): MediaWiki\ResourceLoader\FileModule->processStyle(string, string, string, MediaWiki\ResourceLoader\Context)
#10 /srv/mediawiki/php-1.44.0-wmf.20/includes/ResourceLoader/FileModule.php(953): MediaWiki\ResourceLoader\FileModule->readStyleFile(string, MediaWiki\ResourceLoader\Context)
#11 /srv/mediawiki/php-1.44.0-wmf.20/includes/ResourceLoader/FileModule.php(394): MediaWiki\ResourceLoader\FileModule->readStyleFiles(array, MediaWiki\ResourceLoader\Context)
#12 /srv/mediawiki/php-1.44.0-wmf.20/includes/ResourceLoader/Module.php(768): MediaWiki\ResourceLoader\FileModule->getStyles(MediaWiki\ResourceLoader\Context)
#13 /srv/mediawiki/php-1.44.0-wmf.20/includes/ResourceLoader/Module.php(734): MediaWiki\ResourceLoader\Module->buildContent(MediaWiki\ResourceLoader\Context)
#14 /srv/mediawiki/php-1.44.0-wmf.20/includes/ResourceLoader/ResourceLoader.php(1205): MediaWiki\ResourceLoader\Module->getModuleContent(MediaWiki\ResourceLoader\Context)
#15 /srv/mediawiki/php-1.44.0-wmf.20/includes/ResourceLoader/ResourceLoader.php(1117): MediaWiki\ResourceLoader\ResourceLoader->addOneModuleResponse(MediaWiki\ResourceLoader\Context, MediaWiki\ResourceLoader\ReplayMinifierState, string, MediaWiki\ResourceLoader\FileModule, array)
#16 /srv/mediawiki/php-1.44.0-wmf.20/includes/ResourceLoader/ResourceLoader.php(1035): MediaWiki\ResourceLoader\ResourceLoader->getOneModuleResponse(MediaWiki\ResourceLoader\Context, string, MediaWiki\ResourceLoader\FileModule)
#17 /srv/mediawiki/php-1.44.0-wmf.20/includes/ResourceLoader/ResourceLoader.php(750): MediaWiki\ResourceLoader\ResourceLoader->makeModuleResponse(MediaWiki\ResourceLoader\Context, array, array)
#18 /srv/mediawiki/php-1.44.0-wmf.20/includes/ResourceLoader/ResourceLoaderEntryPoint.php(54): MediaWiki\ResourceLoader\ResourceLoader->respond(MediaWiki\ResourceLoader\Context)
#19 /srv/mediawiki/php-1.44.0-wmf.20/includes/MediaWikiEntryPoint.php(202): MediaWiki\ResourceLoader\ResourceLoaderEntryPoint->execute()
#20 /srv/mediawiki/php-1.44.0-wmf.20/load.php(42): MediaWiki\MediaWikiEntryPoint->run()
#21 /srv/mediawiki/w/load.php(3): require(string)
#22 {main}
Impact
  • RL fatal on page load
  • "Error loading MediaViewer: Failed dependency: mmv" notice shown to all readers
  • Loss of MediaViewer functionality.
Notes

Caused by the change in LESS compilation highlighted in T386215#10616703.

Details

Request URL
https://test.wikipedia.org/wiki/Dog
Related Changes in Gerrit:

Related Objects

Event Timeline

Jdforrester-WMF triaged this task as Medium priority.
Jdforrester-WMF raised the priority of this task from Medium to Unbreak Now!.Mar 11 2025, 1:09 PM

Train blocker -> UBN!.

Change #1126567 had a related patch set uploaded (by Gergő Tisza; author: Jdlrobson):

[mediawiki/core@wmf/1.44.0-wmf.20] Revert "ResourceLoader: Enable Less.php math=parens-division"

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

There are lots of LESS changes in T368921: Migrate bare division math to parens-division in Less stylesheet files (in WMF-deployed extensions) and subtasks, not sure how many of those are not in wmf.20 yet. The change is supposed to be safe in the opposite direction (ie. foo -> (foo) will turn foo into a math expession in math=parens-division mode, but in math=always mode it's a math expression either way and the change is a no-op) so reverting the core change (for wmf.20 only) seems like the simpler fix.

Change #1126567 merged by jenkins-bot:

[mediawiki/core@wmf/1.44.0-wmf.20] Revert "ResourceLoader: Enable Less.php math=parens-division"

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

Mentioned in SAL (#wikimedia-operations) [2025-03-11T15:07:30Z] <lucaswerkmeister-wmde@deploy2002> Started scap sync-world: Backport for [[gerrit:1126567|Revert "ResourceLoader: Enable Less.php math=parens-division" (T388475 T388526)]], [[gerrit:1126546|Enable SUL3 signup for 10% of group 2 users (T384218)]], [[gerrit:1126555|Disable CX unified dashboard on idwiki (T387820)]]

Mentioned in SAL (#wikimedia-operations) [2025-03-11T15:10:31Z] <lucaswerkmeister-wmde@deploy2002> sbisson, tgr, lucaswerkmeister-wmde: Backport for [[gerrit:1126567|Revert "ResourceLoader: Enable Less.php math=parens-division" (T388475 T388526)]], [[gerrit:1126546|Enable SUL3 signup for 10% of group 2 users (T384218)]], [[gerrit:1126555|Disable CX unified dashboard on idwiki (T387820)]] synced to the testservers (https://wikitech.wikimedia.org/wiki/Mwdebug)

Mentioned in SAL (#wikimedia-operations) [2025-03-11T15:24:52Z] <lucaswerkmeister-wmde@deploy2002> Finished scap sync-world: Backport for [[gerrit:1126567|Revert "ResourceLoader: Enable Less.php math=parens-division" (T388475 T388526)]], [[gerrit:1126546|Enable SUL3 signup for 10% of group 2 users (T384218)]], [[gerrit:1126555|Disable CX unified dashboard on idwiki (T387820)]] (duration: 17m 22s)

Tgr claimed this task.

Tested this and T388475 (just to make sure we are not creating a problem in the opposite direction with the revert), both seem fine. The revert is wmf.20 only, but since the MediaViewer patch is already in place (just missed the branch cut narrowly), there should be no issues next week.

There are lots of LESS changes in T368921: Migrate bare division math to parens-division in Less stylesheet files (in WMF-deployed extensions) and subtasks, not sure how many of those are not in wmf.20 yet. [..]

My bad. The last two changes missed the branch cut, and by mere minutes. They were approved an hour earlier but CI was backlogged. Given a backport was ruled out (no branch to backport to, and test wiki/group0 confirmed unaffected).

CI was held up for an hour due to someone +2ing a failing mediawiki/vendor change which took Zuul quite a while to churn through and retry with the backlog of other approved changes. I was watching it on the Zuul Status page and it kept restarting as other changes ahead in the pipeline got virtually rebased off that chain and retried (these failed attempts and false starts are not reported to Gerrit fortunately).

I believe it re-ran the same CI jobs 7 times by the time it merged (each with fewer changes ahead in the pipeline until eventually the patch on its own passed fine and merged).

By the end of it, I forgot that by now the branches are created.

The good news is that these are all trivial to test in beta and we know it's clear there now so we'll see this rollout next week instead.