Page MenuHomePhabricator

PHP Catchable fatal error: Argument 2 passed to CLDRPluralRuleEvaluator::evaluateCompiled() must be an array, null given, called in Language.php on line 4608 and defined in CLDRPluralRuleEvaluator.php on line 70
Closed, DeclinedPublic

Description

[06-Jan-2014 15:55:26] Catchable fatal error: Argument 2 passed to CLDRPluralRuleEvaluator::evaluateCompiled() must be an array, null given, called in /usr/local/apache/common-local/php-1.23wmf8/languages/Language.php on line 4608 and defined at /usr/local/apache/common-local/php-1.23wmf8/languages/utils/CLDRPluralRuleEvaluator.php on line 70
Server: mw1071
Method: GET
URL: http://ar.wikipedia.org/wiki/إدين_هازارد
Backtrace:
#0 /usr/local/apache/common-local/php-1.23wmf8/languages/utils/CLDRPluralRuleEvaluator.php(70): CLDRPluralRuleEvaluator::evaluateCompiled()
#1 /usr/local/apache/common-local/php-1.23wmf8/languages/Language.php(4608): CLDRPluralRuleEvaluator::evaluateCompiled(1.724, NULL)
#2 /usr/local/apache/common-local/php-1.23wmf8/languages/Language.php(3643): Language->getPluralRuleIndexNumber(1.724)
#3 /usr/local/apache/common-local/php-1.23wmf8/includes/parser/CoreParserFunctions.php(361): Language->convertPlural(1.724, Array)
#4 [internal function]: CoreParserFunctions::plural(Object(Parser), '1.724', '?????? ???? ???...', '?????????? ????...', '??????????????', '1.724 ????????', '1.724 ?????????...')
#5 /usr/local/apache/common-local/php-1.23wmf8/includes/parser/Parser.php(3616): call_user_func_array(Array, Array)
#6 /usr/local/apache/common-local/php-1.23wmf8/includes/parser/Parser.php(3333): Parser->callParserFunction(Object(PPFrame_DOM), 'PLURAL', Array)
#7 /usr/local/apache/common-local/php-1.23wmf8/includes/parser/Preprocessor_DOM.php(1113): Parser->braceSubstitution(Array, Object(PPFrame_DOM))
#8 /usr/local/apache/common-local/php-1.23wmf8/includes/parser/Parser.php(3150): PPFrame_DOM->expand(Object(PPNode_DOM), 0)
#9 /usr/local/apache/common-local/php-1.23wmf8/includes/parser/Parser.php(620): Parser->replaceVariables('{{PLURAL:1.724|...')
#10 /usr/local/apache/common-local/php-1.23wmf8/includes/parser/Parser.php(4850): Parser->preprocess('{{PLURAL:1.724|...', Object(Title), Object(ParserOptions))
#11 /usr/local/apache/common-local/php-1.23wmf8/includes/cache/MessageCache.php(1002): Parser->transformMsg('{{PLURAL:1.724|...', Object(ParserOptions), NULL)
#12 /usr/local/apache/common-local/php-1.23wmf8/includes/Message.php(855): MessageCache->transform('{{PLURAL:1.724|...', false, Object(Language), NULL)
#13 /usr/local/apache/common-local/php-1.23wmf8/includes/Message.php(592): Message->transformText('{{PLURAL:1.724|...')
#14 /usr/local/apache/common-local/php-1.23wmf8/includes/Message.php(649): Message->toString()
#15 /usr/local/apache/common-local/php-1.23wmf8/includes/parser/Parser.php(554): Message->text()
#16 [internal function]: Parser->parse('{{Infobox footb...', Object(Title), Object(ParserOptions), true, true, 12199180)
#17 /usr/local/apache/common-local/php-1.23wmf8/includes/StubObject.php(99): call_user_func_array(Array, Array)
#18 /usr/local/apache/common-local/php-1.23wmf8/includes/StubObject.php(119): StubObject->_call('parse', Array)
#19 /usr/local/apache/common-local/php-1.23wmf8/includes/content/WikitextContent.php(306): StubObject->__call('parse', Array)
#20 /usr/local/apache/common-local/php-1.23wmf8/includes/content/WikitextContent.php(306): StubObject->parse('{{Infobox footb...', Object(Title), Object(ParserOptions), true, true, 12199180)
#21 /usr/local/apache/common-local/php-1.23wmf8/extensions/FlaggedRevs/backend/FlaggedRevs.class.php(543): WikitextContent->getParserOutput(Object(Title), 12199180, Object(ParserOptions))
#22 /usr/local/apache/common-local/php-1.23wmf8/extensions/FlaggedRevs/frontend/FlaggablePageView.php(701): FlaggedRevs::parseStableRevision(Object(FlaggedRevision), Object(ParserOptions))
#23 /usr/local/apache/common-local/php-1.23wmf8/extensions/FlaggedRevs/frontend/FlaggablePageView.php(354): FlaggablePageView->showStableVersion(Object(FlaggedRevision), '', '')
#24 /usr/local/apache/common-local/php-1.23wmf8/extensions/FlaggedRevs/frontend/FlaggedRevsUI.hooks.php(194): FlaggablePageView->setPageContent(false, true)
#25 [internal function]: FlaggedRevsUIHooks::onArticleViewHeader(Object(Article), false, true)
#26 /usr/local/apache/common-local/php-1.23wmf8/includes/Hooks.php(199): call_user_func_array('FlaggedRevsUIHo...', Array)
#27 /usr/local/apache/common-local/php-1.23wmf8/includes/GlobalFunctions.php(4031): Hooks::run('ArticleViewHead...', Array)
#28 /usr/local/apache/common-local/php-1.23wmf8/includes/Article.php(615): wfRunHooks('ArticleViewHead...', Array)
#29 /usr/local/apache/common-local/php-1.23wmf8/includes/actions/ViewAction.php(44): Article->view()
#30 /usr/local/apache/common-local/php-1.23wmf8/includes/Wiki.php(441): ViewAction->show()
#31 /usr/local/apache/common-local/php-1.23wmf8/includes/Wiki.php(305): MediaWiki->performAction(Object(Article), Object(Title))
#32 /usr/local/apache/common-local/php-1.23wmf8/includes/Wiki.php(596): MediaWiki->performRequest()
#33 /usr/local/apache/common-local/php-1.23wmf8/includes/Wiki.php(460): MediaWiki->main()
#34 /usr/local/apache/common-local/php-1.23wmf8/index.php(49): MediaWiki->run()
#35 /usr/local/apache/common-local/w/index.php(3): require('/usr/local/apac...')
#36 {main}


Version: 1.23rc
Severity: normal

Details

Reference
bz59724

Event Timeline

bzimport raised the priority of this task from to Needs Triage.Nov 22 2014, 2:22 AM
bzimport set Reference to bz59724.
bzimport added a subscriber: Unknown Object (MLST).

Smells like something is not being cached. Language::getCompiledPluralRules(), which is called just before evaluateCompiled(), should always return an array, and that's not the case here.

It's dropped a couple of lines

PHP Catchable fatal error: Argument 2 passed to CLDRPluralRuleEvaluator::evaluateCompiled() must be an array, null given, called in /usr/local/apache/common-local/php-1.23wmf19/languages/Language.php on line 4592 and defined in /usr/local/apache/common-local/php-1.23wmf19/languages/utils/CLDRPluralRuleEvaluator.php on line 72

The only way I can see this happening is by constructing Language object with code which is not invalid, but not valid according to Language::isValidBuiltInCode. This code does not have plural rules, and fallbacks return empty array in that case, which means $pluralRules is null and that is a fatal error.

Still thinking what would be suitable course of action.

I’m seeing this error as well in MediaWiki 1.23.0rc0.

PHP Catchable fatal error: Argument 2 passed to CLDRPluralRuleEvaluator::evaluateCompiled() must be an array, null given, called in /srv/www/mediawiki/public_html/w/languages/Language.php on line 4612 and defined in /srv/www/mediawiki/public_html/w/languages/utils/CLDRPluralRuleEvaluator.php on line 73

Since Niklas mentioned caching, I will also note that I’m occasionally seeing this error from runJobs as well:

PHP Notice: unserialize(): Error at offset 0 of 27 bytes in /srv/www/mediawiki/public_html/w/includes/cache/LocalisationCache.php on line 1298
PHP Notice: unserialize(): Error at offset 0 of 11 bytes in /srv/www/mediawiki/public_html/w/includes/cache/LocalisationCache.php on line 1298

They don't happen in the same runJobs instance though.

That sounds like your localisation cache is outdated. I expect all errors go away if you run: php maintenance/rebuildLocalizationCache.php --force

Jamie, Sam: are you still seeing this or can this be closed?

I am not seeing this in the WMF logs anymore.