Last modified: 2014-02-04 17:12:35 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T58911, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 56911 - PHP Warning: strtr(): The second argument is not an array in includes/utils/StringUtils.php
PHP Warning: strtr(): The second argument is not an array in includes/utils/...
Status: RESOLVED FIXED
Product: MediaWiki
Classification: Unclassified
General/Unknown (Other open bugs)
unspecified
All All
: High major (vote)
: 1.22.0 release
Assigned To: Niklas Laxström
https://translatewiki.net//wiki/Wikim...
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2013-11-11 18:35 UTC by Niklas Laxström
Modified: 2014-02-04 17:12 UTC (History)
2 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Niklas Laxström 2013-11-11 18:35:27 UTC
For some reason language converter is breaking stuff on some pages and flooding our logs considerably. Cannot debug properly since this only happens in production.

Cause is likely between 9ef2bf0 and b32d16d in core, or it might be in extensions as well.

#0 /www/translatewiki.net/w/languages/LanguageConverter.php(468): ReplacementArray->replace('?Saqlangan sahi...')
#1 /www/translatewiki.net/w/languages/LanguageConverter.php(436): LanguageConverter->translate('?Saqlangan sahi...', 'uz')
#2 /www/translatewiki.net/w/languages/LanguageConverter.php(654): LanguageConverter->autoConvert('<p>Saqlangan sa...', 'uz')
#3 /www/translatewiki.net/w/languages/LanguageConverter.php(630): LanguageConverter->recursiveConvertTopLevel('<p>Saqlangan sa...', 'uz')
#4 /www/translatewiki.net/w/languages/LanguageConverter.php(613): LanguageConverter->convertTo('<p>Saqlangan sa...', 'uz')
#5 /www/translatewiki.net/w/languages/Language.php(3767): LanguageConverter->convert('<p>Saqlangan sa...')
#6 /www/translatewiki.net/w/includes/parser/Parser.php(429): Language->convert('<p>Saqlangan sa...')
#7 [internal function]: Parser->parse('Saqlangan sahif...', Object(Title), Object(ParserOptions), true, true, 4373942)
#8 /www/translatewiki.net/w/includes/StubObject.php(99): call_user_func_array(Array, Array)
#9 /www/translatewiki.net/w/includes/StubObject.php(119): StubObject->_call('parse', Array)
#10 /www/translatewiki.net/w/includes/content/WikitextContent.php(300): StubObject->__call('parse', Array)
#11 /www/translatewiki.net/w/includes/content/WikitextContent.php(300): StubObject->parse('Saqlangan sahif...', Object(Title), Object(ParserOptions), true, true, 4373942)
#12 /www/translatewiki.net/w/includes/WikiPage.php(3543): WikitextContent->getParserOutput(Object(Title), 4373942, Object(ParserOptions))
#13 /www/translatewiki.net/w/includes/PoolCounter.php(222): PoolWorkArticleView->doWork()
#14 /www/translatewiki.net/w/includes/Article.php(708): PoolCounterWork->execute()
#15 /www/translatewiki.net/w/includes/actions/ViewAction.php(44): Article->view()
#16 /www/translatewiki.net/w/includes/Wiki.php(441): ViewAction->show()
#17 /www/translatewiki.net/w/includes/Wiki.php(305): MediaWiki->performAction(Object(Article), Object(Title))
#18 /www/translatewiki.net/w/includes/Wiki.php(596): MediaWiki->performRequest()
#19 /www/translatewiki.net/w/includes/Wiki.php(460): MediaWiki->main()
#20 /www/translatewiki.net/w/index.php(49): MediaWiki->run()
#21 {main}
[11-Nov-2013 18:19:34 UTC] PHP Warning:  strtr(): The second argument is not an array in /www/translatewiki.net/w/includes/utils/StringUtils.php on line 509
Comment 1 Niklas Laxström 2013-11-11 18:51:45 UTC
$wgDisableLangConversion = true; doesn't help. It does hide the language conversion tabs though (which I haven't seen before).
Comment 2 Niklas Laxström 2013-11-11 19:16:17 UTC
On my development wiki:
object(ReplacementArray)#428 (2) {
  ["data":"ReplacementArray":private]=>
  array(0) {
  }
  ["fss":"ReplacementArray":private]=>
  bool(false)
}

On production:
object(ReplacementArray)#330 (3) {
  ["data":"ReplacementArray":private]=>
  bool(false)
  ["fss":"ReplacementArray":private]=>
  bool(false)
  ["data"]=>
  array(0) {
  }
}

When dumping the conversion table in LanguageConverter.php(468). No idea how can there be two keys with "data".
Comment 3 Gerrit Notification Bot 2013-11-11 19:41:14 UTC
Change 94789 had a related patch set uploaded by Nikerabbit:
Increase LanguageConverter cache version

https://gerrit.wikimedia.org/r/94789
Comment 4 Gerrit Notification Bot 2013-11-11 19:51:12 UTC
Change 94789 merged by jenkins-bot:
Increase LanguageConverter cache version

https://gerrit.wikimedia.org/r/94789
Comment 5 db [inactive,noenotif] 2014-01-11 21:20:28 UTC
Issue was only the wrong version inside the cache and now fixed by invalide the cache?
Comment 6 Kevin Israel (PleaseStand) 2014-02-04 17:07:08 UTC
(In reply to comment #5)
> Issue was only the wrong version inside the cache and now fixed by invalide
> the
> cache?

Yes. The PHP interpreter, and thus the PHP serialize() format, encodes a property's visibility as a property name prefix:

* "" (no prefix) for public properties
* "\0*\0" for protected properties
* "\0$class\0" for private properties

Consequently, when an old ReplacementArray is unserialized, the property's (un)prefixed name does not match, and thus its value is not properly set. Bumping the cache version prevents this from happening.

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links