Page MenuHomePhabricator

en-rtl l10n cache not being rebuilt, eventually resulting in fatal exceptions when magic words are not dealt with properly
Closed, ResolvedPublic

Description

http://en-rtl.wikipedia.beta.wmflabs.org/

[6be7c757] / MWException from line 337 of /srv/mediawiki/php-master/includes/MagicWord.php: Error: invalid magic word 'bidi'

Backtrace:

#0 /srv/mediawiki/php-master/includes/MagicWord.php(262): MagicWord->load(string)
#1 /srv/mediawiki/php-master/includes/parser/Parser.php(5197): MagicWord::get(string)
#2 /srv/mediawiki/php-master/includes/parser/CoreParserFunctions.php(60): Parser->setFunctionHook(string, array, integer)
#3 /srv/mediawiki/php-master/includes/parser/Parser.php(319): CoreParserFunctions::register(Parser)
#4 /srv/mediawiki/php-master/includes/StubObject.php(105): Parser->firstCallInit()
#5 /srv/mediawiki/php-master/includes/StubObject.php(129): StubObject->_call(string, array)
#6 /srv/mediawiki/php-master/includes/cache/MessageCache.php(1092): StubObject->__call(string, array)
#7 /srv/mediawiki/php-master/includes/cache/MessageCache.php(1069): MessageCache->getParser()
#8 /srv/mediawiki/php-master/includes/Message.php(1119): MessageCache->transform(string, boolean, Language, NULL)
#9 /srv/mediawiki/php-master/includes/Message.php(786): Message->transformText(string)
#10 /srv/mediawiki/php-master/includes/Message.php(849): Message->toString()
#11 /srv/mediawiki/php-master/includes/User.php(745): Message->text()
#12 /srv/mediawiki/php-master/includes/User.php(787): User::isUsableName(string)
#13 /srv/mediawiki/php-master/extensions/CentralAuth/includes/CentralAuthHooks.php(1107): User::isCreatableName(string)
#14 /srv/mediawiki/php-master/extensions/CentralAuth/includes/CentralAuthHooks.php(860): CentralAuthHooks::attemptAddUser(User)
#15 /srv/mediawiki/php-master/includes/Hooks.php(204): CentralAuthHooks::onUserLoadFromSession(User, NULL)
#16 /srv/mediawiki/php-master/includes/User.php(1110): Hooks::run(string, array)
#17 /srv/mediawiki/php-master/includes/User.php(365): User->loadFromSession()
#18 /srv/mediawiki/php-master/includes/User.php(2022): User->load()
#19 /srv/mediawiki/php-master/includes/User.php(3192): User->getId()
#20 /srv/mediawiki/php-master/includes/MediaWiki.php(623): User->isLoggedIn()
#21 /srv/mediawiki/php-master/includes/MediaWiki.php(475): MediaWiki->main()
#22 /srv/mediawiki/php-master/index.php(41): MediaWiki->run()
#23 /srv/mediawiki/w/index.php(3): include(string)
#24 {main}

Also, sort of off-topic but another thing I noticed: Shouldn't this wiki be in wikipedia.dblist?

Event Timeline

Krenair raised the priority of this task from to Needs Triage.
Krenair updated the task description. (Show Details)
Krenair subscribed.

That seems to be a localization cache issue which happened from time to time ages ago. I can't remember how it works though.

The en_rtlwiki was created via T52335 during the 2014 european hackathon.

@Amire80 and @Ladsgroup is there still a use case for the beta cluster en_rtlwiki or can we get rid of it ?

hashar triaged this task as Medium priority.Jul 20 2015, 7:30 PM
hashar moved this task from To Triage to Next: Maintenance on the Beta-Cluster-Infrastructure board.

I think keeping it would be beneficial but If you think it doesn't worth the headache, I'm okay :)

Mainly I think of a revival by enabling beta features in that wiki (including flow, etc.) Can help us a lot but first let's fix this bug.

It seems to throw this exception when you try to use messages with things like {{SITENAME}} (which is used on every page view to set the title)
I wonder what's special about these:

global $wgLocalisationCacheConf;
$conf = array( 'directory' => $wgLocalisationCacheConf['storeDirectory'] ) + $wgLocalisationCacheConf;
$store = new LCStoreCDB( $conf );
$en = $store->get( 'en', 'magicWords' );
$en_rtl = $store->get( 'en-rtl', 'magicWords' );
var_dump( count( array_keys( $en ) ) );
var_dump( count( array_keys( $en_rtl ) ) );
var_dump( array_keys( array_diff_assoc( $en, $en_rtl ) ) );
var_dump( array_keys( array_diff_assoc( $en_rtl, $en ) ) );

int(229)

int(217)

array(13) {
  [0]=>
  string(10) "PAGEBANNER"
  [1]=>
  string(8) "Eul/Ruel"
  [2]=>
  string(8) "Eun/Neun"
  [3]=>
  string(4) "E/Ga"
  [4]=>
  string(6) "Gwa/Wa"
  [5]=>
  string(4) "A/Ya"
  [6]=>
  string(7) "Euro/Ro"
  [7]=>
  string(2) "E/"
  [8]=>
  string(11) "translation"
  [9]=>
  string(1) "!"
  [10]=>
  string(4) "bidi"
  [11]=>
  string(20) "displaytitle_noerror"
  [12]=>
  string(22) "displaytitle_noreplace"
}

array(1) {
  [0]=>
  string(13) "numberofviews"
}

Given that numberofviews was removed in https://gerrit.wikimedia.org/r/#/c/150699/ I suspect that we're getting outdated data from some cache. But how to purge it?

I just unbroke (and manually ran) l10nupdate on deployment-prep to see if it rebuilds en-rtl, looks like it does not.

But the error message has now only 21 lines, not 24 like at the task description.

I don't think that really matters. Before it was because my account was being unified, now it's just from normal page views.

I basically ran l10nupdate for this but manually, it works now.

Need to figure out how to get this included in l10nupdate though.

I think the process looked a bit like this:

sudo -u l10nupdate -i

/usr/local/bin/mwscript rebuildLocalisationCache.php --wiki=en_rtlwiki --outdir=/var/lib/l10nupdate/caches/cache-master --lang=en_rtl
cp --preserve=timestamps --force /var/lib/l10nupdate/caches/cache-master/l10n_cache-* /srv/mediawiki-staging/php-master/cache/l10n
refreshCdbJsonFiles --directory=/srv/mediawiki-staging/php-master/cache/l10n

exit
sudo -u jenkins-deploy -i

sync-dir php-master/cache/l10n
SSH_AUTH_SOCK=/run/keyholder/proxy.sock dsh -g mediawiki-installation -M -F 40 -r ssh -o -oUser=mwdeploy -- "/srv/deployment/scap/scap/bin/scap-rebuild-cdbs"
Krenair renamed this task from Viewing beta's en_rtlwiki just throws a fatal exception to en-rtl l10n cache not being rebuilt, eventually resulting in fatal exceptions when magic words are not dealt with properly.Oct 8 2015, 12:40 AM
Nikerabbit subscribed.

I'd guess this is no longer an issue, but someone should confirm.

And after five years we can just close it.

Sorry replied too fast. What I meant is the cache is properly generated:

-rwxrwxrwx 1 l10nupdate l10nupdate 4529891 Feb  4 19:09 /srv/mediawiki-staging/php-master/cache/l10n/l10n_cache-en-rtl.cdb*