Page MenuHomePhabricator

Special:TranslatorSignup sometimes triggers MWException: CAS update failed on user_touched
Closed, ResolvedPublic

Description

After filling up Special:TranslatorSignup on WM Commons I get:

[f18b7410] 2016-02-27 19:10:50: Fataler Ausnahmefehler des Typs „MWException“

Reporduceable with different options.

Event Timeline

Restricted Application added subscribers: StudiesWorld, Steinsplitter, Aklapper. · View Herald TranscriptFeb 27 2016, 7:14 PM
Aklapper renamed this task from TranslatorSignup: MWException to Special:TranslatorSignup triggered MWException on Commons on 2016-02-27.Apr 27 2016, 8:09 AM
Restricted Application added a subscriber: Poyekhali. · View Herald TranscriptApr 27 2016, 8:09 AM
Aklapper triaged this task as Low priority.May 4 2016, 8:51 AM
Glaisher added a subscriber: Glaisher.

Is the stacktrace for this still available?

krenair@fluorine:/a/mw-log$ zgrep f18b7410 archive/exception.log-20160228.gz -A 20
2016-02-27 19:10:50 mw1255 commonswiki 1.27.0-wmf.14 exception ERROR: [f18b7410] /wiki/Special:TranslatorSignup   MWException from line 3772 of /srv/mediawiki/php-1.27.0-wmf.14/includes/user/User.php: CAS update failed on user_touched for user ID '103998' (read from slave); the version of the user to be saved is older than the current version. {"exception_id":"f18b7410"} 
[Exception MWException] (/srv/mediawiki/php-1.27.0-wmf.14/includes/user/User.php:3772) CAS update failed on user_touched for user ID '103998' (read from slave); the version of the user to be saved is older than the current version.
  #0 /srv/mediawiki/php-1.27.0-wmf.14/extensions/TranslationNotifications/SpecialTranslatorSignup.php(217): User->saveSettings()
  #1 /srv/mediawiki/php-1.27.0-wmf.14/includes/htmlform/HTMLForm.php(607): SpecialTranslatorSignup->formSubmit(array, HTMLForm)
  #2 /srv/mediawiki/php-1.27.0-wmf.14/includes/htmlform/HTMLForm.php(504): HTMLForm->trySubmit()
  #3 /srv/mediawiki/php-1.27.0-wmf.14/includes/htmlform/HTMLForm.php(519): HTMLForm->tryAuthorizedSubmit()
  #4 /srv/mediawiki/php-1.27.0-wmf.14/extensions/TranslationNotifications/SpecialTranslatorSignup.php(59): HTMLForm->show()
  #5 /srv/mediawiki/php-1.27.0-wmf.14/includes/specialpage/SpecialPage.php(407): SpecialTranslatorSignup->execute(NULL)
  #6 /srv/mediawiki/php-1.27.0-wmf.14/includes/specialpage/SpecialPageFactory.php(565): SpecialPage->run(NULL)
  #7 /srv/mediawiki/php-1.27.0-wmf.14/includes/MediaWiki.php(282): SpecialPageFactory::executePath(Title, RequestContext)
  #8 /srv/mediawiki/php-1.27.0-wmf.14/includes/MediaWiki.php(738): MediaWiki->performRequest()
  #9 /srv/mediawiki/php-1.27.0-wmf.14/includes/MediaWiki.php(519): MediaWiki->main()
  #10 /srv/mediawiki/php-1.27.0-wmf.14/index.php(43): MediaWiki->run()
  #11 /srv/mediawiki/w/index.php(3): include(string)
  #12 {main}
Nikerabbit renamed this task from Special:TranslatorSignup triggered MWException on Commons on 2016-02-27 to Special:TranslatorSignup sometimes triggers MWException: CAS update failed on user_touched.Jun 7 2016, 8:46 AM
Nikerabbit raised the priority of this task from Low to High.
Nikerabbit added subscribers: Elitre, I_JethroBT, JeanFred.
Nikerabbit added a subscriber: aaron.

There was a similar issue in Translate which went away after we stopped using preferences for it. I guess that is not doable here unless we create a new table. We can try the delayed updating of preferences to avoid blocking sending the messages.

This isn't a duplicate of T129069. That task is about Special:NotifyTranslators while this is about Special:TranslatorSignup. While it is easier to accept that Special:NotifyTranslators would throw this, it is unclear to me why Special:TranslatorSignup would throw this message (without reading the code). My understanding is that the CAS update error is thrown if the user object created here is modified by something else before it is saved by this page causing the write to fail.

Well the root cause is the same. We are calling User::saveSettings (to update preferences where these selections are stored) and that fails sometimes.

Change 293136 had a related patch set uploaded (by Glaisher):
Use locking read from master for User in SpecialTranslatorSignup::onSubmit()

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

Change 293136 merged by jenkins-bot:
Use locking read from master for User in SpecialTranslatorSignup::onSubmit()

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

Glaisher closed this task as Resolved.Jun 13 2016, 12:26 PM
Glaisher claimed this task.

That should hopefully prevent CAS exceptions from this page but in the long term, I'd like to introduce a new table for this extension. Doing that would help with resolving other bugs as well.