[MediaWiki-l] CAS update failed on user_touched for user ID # (User.php line 3889)

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

[MediaWiki-l] CAS update failed on user_touched for user ID # (User.php line 3889)

rkevans
Hello.. I'm getting an error when I run the SemanticMediawiki maintenance script "rebuildData.php"

It consistently crashes on the same article ID and generates the following message:

[72bdb30ca5d03c4cd6978192] [no req]   MWException from line 3889 of /var/www/html/mywiki/includes/user/User.php: CAS update failed on user_touched for user ID '18' (read from replica); the version of the user to be saved is older than the current version.

I investigated, and it turns out that User ID '18' is an account I created for my Parsoid service to use. The article is page_id '7108' which corresponds to a Flow talk page that I have edited using the VisualEditor.

Back then (the PageID ~ 7000 era :-) ) .. was when I was installing Echo, Flow, VisualEditor and the Parsoid server.. and I had some messy issues getting them all up and running.. and I think this maintenance script error is a byproduct of that messy phase. Those extensions are all running well and playing nice together I think and so my hope is that if I can "repair" the database, this error with the maintenance script will do away.  

Can anyone help me understand what might be going on? .. and how to debug and fix it?

-Rich
* MW: 1.28.2
* PHP: 5.6.32
* MariaDB: 5.5.56,
* SMW: 2.5.2
* VisualEditor: 0.1.0 (93528b7) 16:23, 25 October 2016
* Parsoid: 0.7.1+git

(P.S. .. SMW folks say this is not a SMW issue)

_______________________________________________
MediaWiki-l mailing list
To unsubscribe, go to:
https://lists.wikimedia.org/mailman/listinfo/mediawiki-l
Reply | Threaded
Open this post in threaded view
|

Re: CAS update failed on user_touched for user ID # (User.php line 3889)

Brian Wolff
So first of all, check what the value of user_touched is for that user
in the database. It should be a timestamp. If its a timestamp for some
time in the future, that would cause the problem.

If this is not a timestamp, then what this means is that there is a
conflict in updating the user object, which would probably indicate a
bug in SemanticMediaWiki (or possibly another extension). It could
happen if:
* Something gets a User object, call it $user1
* something else gets a user object (for same user) call it $user2
* $user2 gets updated (e.g. preference changes, email change, password change)
* $user1 gets updates. But MediaWiki detects that the user was updated
since user1 was fetched, so it errors

Basically what is happening is there is an edit conflict in updated
the user's preferences. Which definitely means a bug somewhere,
depends what extension is trying to update the user (Which raises the
question of why user preferences are being updated at all during
rebuildData.php). Which doesn't really answer your question about how
to fix, but hopefully leads to the right direction of what's wrong.

--
Brian

On Mon, Dec 11, 2017 at 7:15 PM, Evans, Richard K. (GRC-H000)
<[hidden email]> wrote:

> Hello.. I'm getting an error when I run the SemanticMediawiki maintenance script "rebuildData.php"
>
> It consistently crashes on the same article ID and generates the following message:
>
> [72bdb30ca5d03c4cd6978192] [no req]   MWException from line 3889 of /var/www/html/mywiki/includes/user/User.php: CAS update failed on user_touched for user ID '18' (read from replica); the version of the user to be saved is older than the current version.
>
> I investigated, and it turns out that User ID '18' is an account I created for my Parsoid service to use. The article is page_id '7108' which corresponds to a Flow talk page that I have edited using the VisualEditor.
>
> Back then (the PageID ~ 7000 era :-) ) .. was when I was installing Echo, Flow, VisualEditor and the Parsoid server.. and I had some messy issues getting them all up and running.. and I think this maintenance script error is a byproduct of that messy phase. Those extensions are all running well and playing nice together I think and so my hope is that if I can "repair" the database, this error with the maintenance script will do away.
>
> Can anyone help me understand what might be going on? .. and how to debug and fix it?
>
> -Rich
> * MW: 1.28.2
> * PHP: 5.6.32
> * MariaDB: 5.5.56,
> * SMW: 2.5.2
> * VisualEditor: 0.1.0 (93528b7) 16:23, 25 October 2016
> * Parsoid: 0.7.1+git
>
> (P.S. .. SMW folks say this is not a SMW issue)
>
> _______________________________________________
> MediaWiki-l mailing list
> To unsubscribe, go to:
> https://lists.wikimedia.org/mailman/listinfo/mediawiki-l

_______________________________________________
MediaWiki-l mailing list
To unsubscribe, go to:
https://lists.wikimedia.org/mailman/listinfo/mediawiki-l
Reply | Threaded
Open this post in threaded view
|

Re: CAS update failed on user_touched for user ID # (User.php line 3889)

rkevans
Thank you, Brian! .. I figured it out... turns out that it was related to the following code in my localsettings.php file:

require_once "$IP/extensions/NetworkAuth/NetworkAuth.php";
$wgNetworkAuthUsers[] = [ 'iprange' => [ '127.0.0.1' ], 'user'    => 'parsoid' ];

I added this code when I was struggling to get the Parsoid/Visual editor working in my private enterprise site that requires server authentication for access to the site and I read somewhere that this something that someone had done to get the parsoid service access to the site from localhost calls.. I disabled it and not only did the parsoid/visual editor continue to work.. but also my maintenance script issues went away.. yay!

Thank you so much for your response.. your description of the possible scenarios led me to suspect this part of my configuration. Rock on! :-)

-Rich

_______________________________________________
MediaWiki-l mailing list
To unsubscribe, go to:
https://lists.wikimedia.org/mailman/listinfo/mediawiki-l