Page MenuHomePhabricator

PHP Notice: Use of undefined constant PREG_UNMATCHED_AS_NULL
Closed, ResolvedPublic

Description

I spotted by chance the following on Logstash:

message
PHP Notice: Use of undefined constant PREG_UNMATCHED_AS_NULL - assumed 'PREG_UNMATCHED_AS_NULL'
trace
#0 /srv/mediawiki/php-1.33.0-wmf.19/extensions/Score/includes/LilypondErrorMessageBeautifier.php(65): MWExceptionHandler::handleError(integer, string, string, integer, array, array)
#1 /srv/mediawiki/php-1.33.0-wmf.19/extensions/Score/includes/Score.php(678): LilypondErrorMessageBeautifier->beautifyMessage(string)
#2 /srv/mediawiki/php-1.33.0-wmf.19/extensions/Score/includes/Score.php(466): Score::generatePngAndMidi(string, array, array)
#3 /srv/mediawiki/php-1.33.0-wmf.19/extensions/Score/includes/Score.php(361): Score::generateHTML(Parser, string, array)
#4 /srv/mediawiki/php-1.33.0-wmf.19/extensions/Score/includes/Score.php(222): Score::renderScore(string, array, Parser)
#5 /srv/mediawiki/php-1.33.0-wmf.19/includes/parser/Parser.php(3987): Score::render(string, array, Parser, PPFrame_Hash)
#6 /srv/mediawiki/php-1.33.0-wmf.19/includes/parser/Preprocessor_Hash.php(1188): Parser->extensionSubstitution(array, PPFrame_Hash)
#7 /srv/mediawiki/php-1.33.0-wmf.19/includes/parser/Parser.php(3036): PPFrame_Hash->expand(PPNode_Hash_Tree, integer)
#8 /srv/mediawiki/php-1.33.0-wmf.19/includes/parser/Parser.php(1354): Parser->replaceVariables(string)
#9 /srv/mediawiki/php-1.33.0-wmf.19/includes/parser/Parser.php(482): Parser->internalParse(string)
#10 /srv/mediawiki/php-1.33.0-wmf.19/includes/content/WikitextContent.php(369): Parser->parse(string, Title, ParserOptions, boolean, boolean, NULL)
#11 /srv/mediawiki/php-1.33.0-wmf.19/includes/content/AbstractContent.php(555): WikitextContent->fillParserOutput(Title, NULL, ParserOptions, boolean, ParserOutput)
#12 /srv/mediawiki/php-1.33.0-wmf.19/includes/Revision/RenderedRevision.php(266): AbstractContent->getParserOutput(Title, NULL, ParserOptions, boolean)
#13 /srv/mediawiki/php-1.33.0-wmf.19/includes/Revision/RenderedRevision.php(234): MediaWiki\Revision\RenderedRevision->getSlotParserOutputUncached(WikitextContent, boolean)
#14 /srv/mediawiki/php-1.33.0-wmf.19/includes/Revision/RevisionRenderer.php(193): MediaWiki\Revision\RenderedRevision->getSlotParserOutput(string)
#15 /srv/mediawiki/php-1.33.0-wmf.19/includes/Revision/RevisionRenderer.php(142): MediaWiki\Revision\RevisionRenderer->combineSlotOutput(MediaWiki\Revision\RenderedRevision, array)
#16 [internal function]: Closure$MediaWiki\Revision\RevisionRenderer::getRenderedRevision#2(MediaWiki\Revision\RenderedRevision, array)
#17 /srv/mediawiki/php-1.33.0-wmf.19/includes/Revision/RenderedRevision.php(197): call_user_func(Closure$MediaWiki\Revision\RevisionRenderer::getRenderedRevision#2;2920, MediaWiki\Revision\RenderedRevision, array)
#18 /srv/mediawiki/php-1.33.0-wmf.19/includes/Storage/DerivedPageDataUpdater.php(1275): MediaWiki\Revision\RenderedRevision->getRevisionParserOutput()
#19 /srv/mediawiki/php-1.33.0-wmf.19/includes/Storage/DerivedPageDataUpdater.php(1245): MediaWiki\Storage\DerivedPageDataUpdater->getCanonicalParserOutput()
#20 /srv/mediawiki/php-1.33.0-wmf.19/includes/page/WikiPage.php(2012): MediaWiki\Storage\DerivedPageDataUpdater->getPreparedEdit()
#21 /srv/mediawiki/php-1.33.0-wmf.19/extensions/AbuseFilter/includes/AFComputedVariable.php(216): WikiPage->prepareContentForEdit(WikitextContent)
#22 /srv/mediawiki/php-1.33.0-wmf.19/extensions/AbuseFilter/includes/AbuseFilterVariableHolder.php(55): AFComputedVariable->compute(AbuseFilterVariableHolder)
#23 /srv/mediawiki/php-1.33.0-wmf.19/extensions/AbuseFilter/includes/AFComputedVariable.php(256): AbuseFilterVariableHolder->getVar(string)
#24 /srv/mediawiki/php-1.33.0-wmf.19/extensions/AbuseFilter/includes/AbuseFilterVariableHolder.php(55): AFComputedVariable->compute(AbuseFilterVariableHolder)
#25 /srv/mediawiki/php-1.33.0-wmf.19/extensions/AbuseFilter/includes/parser/AbuseFilterParser.php(854): AbuseFilterVariableHolder->getVar(string)
#26 /srv/mediawiki/php-1.33.0-wmf.19/extensions/AbuseFilter/includes/parser/AbuseFilterParser.php(753): AbuseFilterParser->getVarValue(string)
#27 /srv/mediawiki/php-1.33.0-wmf.19/extensions/AbuseFilter/includes/parser/AbuseFilterParser.php(725): AbuseFilterParser->doLevelAtom(AFPData)
#28 /srv/mediawiki/php-1.33.0-wmf.19/extensions/AbuseFilter/includes/parser/AbuseFilterParser.php(653): AbuseFilterParser->doLevelFunction(AFPData)
#29 /srv/mediawiki/php-1.33.0-wmf.19/extensions/AbuseFilter/includes/parser/AbuseFilterParser.php(609): AbuseFilterParser->doLevelBraces(AFPData)
#30 /srv/mediawiki/php-1.33.0-wmf.19/extensions/AbuseFilter/includes/parser/AbuseFilterParser.php(598): AbuseFilterParser->doLevelArrayElements(AFPData)
#31 /srv/mediawiki/php-1.33.0-wmf.19/extensions/AbuseFilter/includes/parser/AbuseFilterParser.php(559): AbuseFilterParser->doLevelUnarys(AFPData)
#32 /srv/mediawiki/php-1.33.0-wmf.19/extensions/AbuseFilter/includes/parser/AbuseFilterParser.php(549): AbuseFilterParser->doLevelSpecialWords(AFPData)
#33 /srv/mediawiki/php-1.33.0-wmf.19/extensions/AbuseFilter/includes/parser/AbuseFilterParser.php(521): AbuseFilterParser->doLevelBoolInvert(AFPData)
#34 /srv/mediawiki/php-1.33.0-wmf.19/extensions/AbuseFilter/includes/parser/AbuseFilterParser.php(500): AbuseFilterParser->doLevelPow(AFPData)
#35 /srv/mediawiki/php-1.33.0-wmf.19/extensions/AbuseFilter/includes/parser/AbuseFilterParser.php(474): AbuseFilterParser->doLevelMulRels(AFPData)
#36 /srv/mediawiki/php-1.33.0-wmf.19/extensions/AbuseFilter/includes/parser/AbuseFilterParser.php(452): AbuseFilterParser->doLevelSumRels(AFPData)
#37 /srv/mediawiki/php-1.33.0-wmf.19/extensions/AbuseFilter/includes/parser/AbuseFilterParser.php(423): AbuseFilterParser->doLevelCompares(AFPData)
#38 /srv/mediawiki/php-1.33.0-wmf.19/extensions/AbuseFilter/includes/parser/AbuseFilterParser.php(370): AbuseFilterParser->doLevelBoolOps(AFPData)
#39 /srv/mediawiki/php-1.33.0-wmf.19/extensions/AbuseFilter/includes/parser/AbuseFilterParser.php(291): AbuseFilterParser->doLevelConditions(AFPData)
#40 /srv/mediawiki/php-1.33.0-wmf.19/extensions/AbuseFilter/includes/parser/AbuseFilterParser.php(219): AbuseFilterParser->doLevelSet(AFPData)
#41 /srv/mediawiki/php-1.33.0-wmf.19/extensions/AbuseFilter/includes/parser/AbuseFilterParser.php(693): AbuseFilterParser->doLevelSemicolon(AFPData)
#42 /srv/mediawiki/php-1.33.0-wmf.19/extensions/AbuseFilter/includes/parser/AbuseFilterParser.php(653): AbuseFilterParser->doLevelFunction(AFPData)
#43 /srv/mediawiki/php-1.33.0-wmf.19/extensions/AbuseFilter/includes/parser/AbuseFilterParser.php(609): AbuseFilterParser->doLevelBraces(AFPData)
#44 /srv/mediawiki/php-1.33.0-wmf.19/extensions/AbuseFilter/includes/parser/AbuseFilterParser.php(598): AbuseFilterParser->doLevelArrayElements(AFPData)
#45 /srv/mediawiki/php-1.33.0-wmf.19/extensions/AbuseFilter/includes/parser/AbuseFilterParser.php(559): AbuseFilterParser->doLevelUnarys(AFPData)
#46 /srv/mediawiki/php-1.33.0-wmf.19/extensions/AbuseFilter/includes/parser/AbuseFilterParser.php(549): AbuseFilterParser->doLevelSpecialWords(AFPData)
#47 /srv/mediawiki/php-1.33.0-wmf.19/extensions/AbuseFilter/includes/parser/AbuseFilterParser.php(521): AbuseFilterParser->doLevelBoolInvert(AFPData)
#48 /srv/mediawiki/php-1.33.0-wmf.19/extensions/AbuseFilter/includes/parser/AbuseFilterParser.php(500): AbuseFilterParser->doLevelPow(AFPData)
#49 /srv/mediawiki/php-1.33.0-wmf.19/extensions/AbuseFilter/includes/parser/AbuseFilterParser.php(474): AbuseFilterParser->doLevelMulRels(AFPData)
#50 /srv/mediawiki/php-1.33.0-wmf.19/extensions/AbuseFilter/includes/parser/AbuseFilterParser.php(452): AbuseFilterParser->doLevelSumRels(AFPData)
#51 /srv/mediawiki/php-1.33.0-wmf.19/extensions/AbuseFilter/includes/parser/AbuseFilterParser.php(423): AbuseFilterParser->doLevelCompares(AFPData)
#52 /srv/mediawiki/php-1.33.0-wmf.19/extensions/AbuseFilter/includes/parser/AbuseFilterParser.php(370): AbuseFilterParser->doLevelBoolOps(AFPData)
#53 /srv/mediawiki/php-1.33.0-wmf.19/extensions/AbuseFilter/includes/parser/AbuseFilterParser.php(291): AbuseFilterParser->doLevelConditions(AFPData)
#54 /srv/mediawiki/php-1.33.0-wmf.19/extensions/AbuseFilter/includes/parser/AbuseFilterParser.php(219): AbuseFilterParser->doLevelSet(AFPData)
#55 /srv/mediawiki/php-1.33.0-wmf.19/extensions/AbuseFilter/includes/parser/AbuseFilterParser.php(642): AbuseFilterParser->doLevelSemicolon(AFPData)
#56 /srv/mediawiki/php-1.33.0-wmf.19/extensions/AbuseFilter/includes/parser/AbuseFilterParser.php(609): AbuseFilterParser->doLevelBraces(AFPData)
#57 /srv/mediawiki/php-1.33.0-wmf.19/extensions/AbuseFilter/includes/parser/AbuseFilterParser.php(598): AbuseFilterParser->doLevelArrayElements(AFPData)
#58 /srv/mediawiki/php-1.33.0-wmf.19/extensions/AbuseFilter/includes/parser/AbuseFilterParser.php(559): AbuseFilterParser->doLevelUnarys(AFPData)
#59 /srv/mediawiki/php-1.33.0-wmf.19/extensions/AbuseFilter/includes/parser/AbuseFilterParser.php(549): AbuseFilterParser->doLevelSpecialWords(AFPData)
#60 /srv/mediawiki/php-1.33.0-wmf.19/extensions/AbuseFilter/includes/parser/AbuseFilterParser.php(521): AbuseFilterParser->doLevelBoolInvert(AFPData)
#61 /srv/mediawiki/php-1.33.0-wmf.19/extensions/AbuseFilter/includes/parser/AbuseFilterParser.php(500): AbuseFilterParser->doLevelPow(AFPData)
#62 /srv/mediawiki/php-1.33.0-wmf.19/extensions/AbuseFilter/includes/parser/AbuseFilterParser.php(474): AbuseFilterParser->doLevelMulRels(AFPData)
#63 /srv/mediawiki/php-1.33.0-wmf.19/extensions/AbuseFilter/includes/parser/AbuseFilterParser.php(452): AbuseFilterParser->doLevelSumRels(AFPData)
#64 /srv/mediawiki/php-1.33.0-wmf.19/extensions/AbuseFilter/includes/parser/AbuseFilterParser.php(440): AbuseFilterParser->doLevelCompares(AFPData)
#65 /srv/mediawiki/php-1.33.0-wmf.19/extensions/AbuseFilter/includes/parser/AbuseFilterParser.php(370): AbuseFilterParser->doLevelBoolOps(AFPData)
#66 /srv/mediawiki/php-1.33.0-wmf.19/extensions/AbuseFilter/includes/parser/AbuseFilterParser.php(291): AbuseFilterParser->doLevelConditions(AFPData)
#67 /srv/mediawiki/php-1.33.0-wmf.19/extensions/AbuseFilter/includes/parser/AbuseFilterParser.php(219): AbuseFilterParser->doLevelSet(AFPData)
#68 /srv/mediawiki/php-1.33.0-wmf.19/extensions/AbuseFilter/includes/parser/AbuseFilterParser.php(200): AbuseFilterParser->doLevelSemicolon(AFPData)
#69 /srv/mediawiki/php-1.33.0-wmf.19/extensions/AbuseFilter/includes/parser/AbuseFilterParser.php(186): AbuseFilterParser->doLevelEntry(AFPData)
#70 /srv/mediawiki/php-1.33.0-wmf.19/extensions/AbuseFilter/includes/parser/AbuseFilterParser.php(164): AbuseFilterParser->intEval(string)
#71 /srv/mediawiki/php-1.33.0-wmf.19/extensions/AbuseFilter/includes/AbuseFilter.php(527): AbuseFilterParser->parse(string, integer)
#72 /srv/mediawiki/php-1.33.0-wmf.19/extensions/AbuseFilter/includes/AbuseFilter.php(686): AbuseFilter::checkConditions(string, AbuseFilterVariableHolder, boolean, string)
#73 /srv/mediawiki/php-1.33.0-wmf.19/extensions/AbuseFilter/includes/AbuseFilter.php(625): AbuseFilter::checkFilter(stdClass, AbuseFilterVariableHolder, Title, string, string)
#74 /srv/mediawiki/php-1.33.0-wmf.19/extensions/AbuseFilter/includes/AbuseFilter.php(1175): AbuseFilter::checkAllFilters(AbuseFilterVariableHolder, string, Title, string)
#75 /srv/mediawiki/php-1.33.0-wmf.19/extensions/AbuseFilter/includes/AbuseFilterHooks.php(935): AbuseFilter::filterAction(AbuseFilterVariableHolder, Title, string, User, string)
#76 /srv/mediawiki/php-1.33.0-wmf.19/includes/deferred/MWCallableUpdate.php(34): Closure$AbuseFilterHooks::onParserOutputStashForEdit()
#77 /srv/mediawiki/php-1.33.0-wmf.19/includes/deferred/DeferredUpdates.php(270): MWCallableUpdate->doUpdate()
#78 /srv/mediawiki/php-1.33.0-wmf.19/includes/deferred/DeferredUpdates.php(216): DeferredUpdates::runUpdate(MWCallableUpdate, Wikimedia\Rdbms\LBFactoryMulti, string, integer)
#79 /srv/mediawiki/php-1.33.0-wmf.19/includes/deferred/DeferredUpdates.php(136): DeferredUpdates::execute(array, string, integer)
#80 /srv/mediawiki/php-1.33.0-wmf.19/includes/MediaWiki.php(602): DeferredUpdates::doUpdates(string, integer)
#81 /srv/mediawiki/php-1.33.0-wmf.19/includes/api/ApiMain.php(548): MediaWiki::preOutputCommit(DerivativeContext)
#82 /srv/mediawiki/php-1.33.0-wmf.19/includes/api/ApiMain.php(502): ApiMain->executeActionWithErrorHandling()
#83 /srv/mediawiki/php-1.33.0-wmf.19/api.php(87): ApiMain->execute()
#84 /srv/mediawiki/w/api.php(3): include(string)
#85 {main}

The use of PREG_UNMATCHED_AS_NULL was introduced in https://gerrit.wikimedia.org/r/#/c/mediawiki/extensions/Score/+/491261/, however the constant was added in PHP 7.2.0, which currently we do not require.
This is coming with this week's train, so it's only on group 0 for now. Not really a train blocker, but I'm unsure what the impact could be.

Details

Related Gerrit Patches:
mediawiki/extensions/Score : masterRemove PREG_UNMATCHED_AS_NULL constant
mediawiki/extensions/Score : masterRemove unsupported constant
mediawiki/extensions/Score : wmf/1.33.0-wmf.19Revert "beautify lilypond error message output"
mediawiki/extensions/Score : masterRevert "beautify lilypond error message output"

Event Timeline

Daimona created this task.Feb 27 2019, 1:46 PM
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptFeb 27 2019, 1:46 PM
Restricted Application added a project: Wikidata. · View Herald TranscriptFeb 27 2019, 1:48 PM
Addshore triaged this task as High priority.Feb 27 2019, 1:54 PM
hashar added a subscriber: hashar.Feb 27 2019, 4:19 PM

Due to https://gerrit.wikimedia.org/r/#/c/mediawiki/extensions/Score/+/491261/ which I guess we can just revert for now. Note the patch had no tests :/

Change 493265 had a related patch set uploaded (by Hashar; owner: Hashar):
[mediawiki/extensions/Score@master] Revert "beautify lilypond error message output"

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

Change 493267 had a related patch set uploaded (by Hashar; owner: Hashar):
[mediawiki/extensions/Score@wmf/1.33.0-wmf.19] Revert "beautify lilypond error message output"

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

Change 493265 abandoned by Hashar:
Revert "beautify lilypond error message output"

Reason:
Per discussion with Addshore, we can get it patched in master. I will just revert in the deployment branch

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

Change 493268 had a related patch set uploaded (by Daimona Eaytoy; owner: Daimona Eaytoy):
[mediawiki/extensions/Score@master] Remove PREG_UNMATCHED_AS_NULL constant

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

Change 493267 merged by jenkins-bot:
[mediawiki/extensions/Score@wmf/1.33.0-wmf.19] Revert "beautify lilypond error message output"

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

Mentioned in SAL (#wikimedia-operations) [2019-02-27T16:58:36Z] <hashar@deploy1001> Synchronized php-1.33.0-wmf.19/extensions/Score: Revert "beautify lilypond error message output" - T217241 (duration: 00m 56s)

hashar closed this task as Resolved.Feb 27 2019, 4:58 PM
hashar claimed this task.

Fixed on deployment by simply reverting the patch in wmf/1.33.0-wmf.19

alaa_wmde reopened this task as Open.Feb 27 2019, 5:26 PM
alaa_wmde claimed this task.

Fixed on deployment by simply reverting the patch in wmf/1.33.0-wmf.19

This needs to stay open until the master fix is in ;)

Change 493280 had a related patch set uploaded (by Alaa Sarhan; owner: Alaa Sarhan):
[mediawiki/extensions/Score@master] Remove unsupported constant

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

Change 493280 abandoned by Alaa Sarhan:
Remove unsupported constant

Reason:
Duplicate

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

Change 493268 merged by jenkins-bot:
[mediawiki/extensions/Score@master] Remove PREG_UNMATCHED_AS_NULL constant

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

mmodell changed the subtype of this task from "Task" to "Production Error".Aug 28 2019, 11:07 PM