Page MenuHomePhabricator

MWException: CAS update failed on user_touched (from SpecialEmailInvalidate)
Closed, DeclinedPublicPRODUCTION ERROR

Description

Error
normalized_message
[{reqId}] {exception_url}   MWException: CAS update failed on user_touched. The version of the user to be saved is older than the current version.
exception.trace
from /srv/mediawiki/php-1.39.0-wmf.7/includes/user/User.php(2821)
#0 /srv/mediawiki/php-1.39.0-wmf.7/includes/libs/rdbms/database/Database.php(4461): User->{closure}(Wikimedia\Rdbms\DatabaseMysqli, string)
#1 /srv/mediawiki/php-1.39.0-wmf.7/includes/libs/rdbms/database/DBConnRef.php(68): Wikimedia\Rdbms\Database->doAtomicSection(string, Closure)
#2 /srv/mediawiki/php-1.39.0-wmf.7/includes/libs/rdbms/database/DBConnRef.php(605): Wikimedia\Rdbms\DBConnRef->__call(string, array)
#3 /srv/mediawiki/php-1.39.0-wmf.7/includes/user/User.php(2833): Wikimedia\Rdbms\DBConnRef->doAtomicSection(string, Closure)
#4 /srv/mediawiki/php-1.39.0-wmf.7/includes/specials/SpecialEmailInvalidate.php(84): User->saveSettings()
#5 /srv/mediawiki/php-1.39.0-wmf.7/includes/specials/SpecialEmailInvalidate.php(61): SpecialEmailInvalidate->attemptInvalidate(string)
#6 /srv/mediawiki/php-1.39.0-wmf.7/includes/specialpage/SpecialPage.php(672): SpecialEmailInvalidate->execute(string)
#7 /srv/mediawiki/php-1.39.0-wmf.7/includes/specialpage/SpecialPageFactory.php(1383): SpecialPage->run(string)
#8 /srv/mediawiki/php-1.39.0-wmf.7/includes/MediaWiki.php(316): MediaWiki\SpecialPage\SpecialPageFactory->executePath(string, RequestContext)
#9 /srv/mediawiki/php-1.39.0-wmf.7/includes/MediaWiki.php(912): MediaWiki->performRequest()
#10 /srv/mediawiki/php-1.39.0-wmf.7/includes/MediaWiki.php(566): MediaWiki->main()
#11 /srv/mediawiki/php-1.39.0-wmf.7/index.php(50): MediaWiki->run()
#12 /srv/mediawiki/php-1.39.0-wmf.7/index.php(46): wfIndexMain()
#13 /srv/mediawiki/w/index.php(3): require(string)
#14 {main}
Impact
Notes

Noticed one of these in 1.39.0-wmf.8 (T305214), a quick search did not find an exact match for this, despite quite a few similar "CAS update failed" errors.

Details

Request URL
https://es.wikipedia.org/wiki/Especial:Invalidar_correo_electr%C3%B3nico

Event Timeline

Krinkle renamed this task from MWException: CAS update failed on user_touched. The version of the user to be saved is older than the current version. to MWException: CAS update failed on user_touched (from SpecialEmailInvalidate).Apr 21 2022, 5:07 PM
Krinkle changed Request URL from https://es.wikipedia.org/wiki/Especial:Invalidar_correo_electr%C3%B3nico/863a62970f2d02c74748e00bdfd56b40 to https://es.wikipedia.org/wiki/Especial:Invalidar_correo_electr%C3%B3nico.
Krinkle moved this task from Untriaged to Apr 2022 on the Wikimedia-production-error board.
Tgr subscribed.

CAS errors are race conditions (we are trying to update a user record but someone else updated it already). They would be extremely hard (and probably on the net harmful) to 100% eliminate, and they can be triggered by any code that updates user record. If they are happening frequently, that indicates a problem in the code. Rare CAS errors can be ignored.