!mduWVRtKzYinVAelXP:matrix.org

MWStake General

129 Members
MediaWIki Stakeholders' Group general discussion25 Servers

Load older messages


SenderMessageTime
18 Sep 2020
@freephile:matrix.orgrundgand that key is only used in includes/jobqueue/jobs/DoubleRedirectJob.php18:57:39
@freephile:matrix.orgrundghttps://gerrit.wikimedia.org/g/mediawiki/core/+/785dc0ee3aa54f59b826ae622eb5dee390086642/includes/jobqueue/jobs/DoubleRedirectJob.php#24219:00:31
@freephile:matrix.orgrundgOne thing I did was completely drop the database and restore it from a backup (because new tables had been introduced during an attempted update with SMW enabled)19:02:48
@freephile:matrix.orgrundgMy thinking is "Don't introduce any changes until after the upgrade process can be completeed"19:03:19
@freephile:matrix.orgrundgThere are apparently 56 entries in revision where rev_user_text is 'Redirect fixer' (rev_user = 7425)19:07:02
@freephile:matrix.orgrundgBut no record in user where user_id = 742519:07:15
@freephile:matrix.orgrundg

If I

delete from logging where log_user_text="";
delete from actor where actor_name = 'Redirect fixer';
delete from logging where log_user_text="";
delete from revision where rev_user_text = 'Redirect fixer';

and re-run maintenance/migrateActors.php then I still get the same result.

20:42:21
@freephile:matrix.orgrundgSo I guess I need to write some code around MigrateActors::addActorsForRows20:43:07
19 Sep 2020
@tgr:matrix.orgtgr
In reply to @hexmode:matrix.org
yep, I'm sticking with User::createUser. I used to be able to do this with user->load(), I think, but that doesn't work now.
Pretty sure that never worked.
00:31:53
@hexmode:matrix.orghexmodemaybe only after saveSettings()?00:32:31
@hexmode:matrix.orghexmodebut whatever I was doing before isn't working now00:32:45
@tgr:matrix.orgtgrNo. If you load a user with non-existent name, it will end up with ID 0. Hopefully you wouldn't have been able to save that, but even if it worked, it would have meant a very different thing from what you intended.00:34:47
@tgr:matrix.orgtgrIn any case, user management hasn't really changed when AuthManager was introduced, apart from some password-related aspects00:35:32
@tgr:matrix.orgtgrload, save, addToDatabase etc. does the same thing they did before00:35:53
@hexmode:matrix.orghexmodecreateUser seems to have what it does on the tin, though.00:35:58
@hexmode:matrix.orghexmodeit seems i missed it00:36:20
@tgr:matrix.orgtgrI have no idea what the difference is between createUser and addToDatabase, TBH00:36:29
@tgr:matrix.orgtgrapart from some esoteric transaction management details00:36:47
@hexmode:matrix.orghexmodelooking at the code createUser seems a little more high level00:37:09
@tgr:matrix.orgtgrAnyway the proper method to create a new user would be to write an AuthenticationProvider.00:37:45
@tgr:matrix.orgtgrThe slightly less proper one would be to call AuthManager::autoCreateUser.00:38:14
@tgr:matrix.orgtgrManual user creation will mess up all kinds of internal state, like site statistics.00:38:35
@tgr:matrix.orgtgr(And newSystemUser is for creating an account that is impossible to log into. You can probably abuse it for creating normal users, but it's not safe.)00:40:16
@tgr:matrix.orgtgr freephile: the redirect fixer is a system user that dereferences double redirects. It's the result of either running fixDoubleRedirects.php or enabling $wgFixDoubleRedirects. 00:44:11
@tgr:matrix.orgtgr probably your best bet is to get into a shell and run User::createNew( 'Redirect fixer', [ 'id' => 7425 ] ) 00:47:23
20 Sep 2020
@freephile:matrix.orgrundg

get into a shell

I tried with php ./maintenance/shell.php but everything I do with the shell just returns an error.

print wfMessage("Recentchanges")->plain();
PHP Error:  syntax error, unexpected '.', expecting ',' or ';' in Psy Shell code on line 1
13:56:43
21 Sep 2020
@nikerabbit:matrix.orgnikerabbit
In reply to @freephile:matrix.org

get into a shell

I tried with php ./maintenance/shell.php but everything I do with the shell just returns an error.

print wfMessage("Recentchanges")->plain();
PHP Error:  syntax error, unexpected '.', expecting ',' or ';' in Psy Shell code on line 1
Yeah that is a common(?) issue. You have to use eval.php in this case. https://phabricator.wikimedia.org/T208304
07:47:06
@freephile:matrix.orgrundg

Thanks nikerabbit . That worked

php ./maintenance/eval.php
User::createNew( 'Redirect fixer', [ 'id' => 7425 ] )
Ctrl + c
mysql wiki_en -e 'select * from user where user_id = 7425;'

15:42:32
@freephile:matrix.orgrundgNow I get to see if that will cure the upgrade process... in about 9 hours because that's how long it takes to redo.15:44:06
@hexmode:matrix.orghexmode
In reply to @tgr:matrix.org
Manual user creation will mess up all kinds of internal state, like site statistics.

tgr: thanks for the help. I'm seeing two slightly different users in the db which is why, I think I had the code working in a deferred update (before) instead of immediately (like I was trying to do now). Probably the account was being created in the proper way before and I only glued it to the SSO afterward in the deferred update.

But, I didn't have that documented, so when I looked at it now, it looked all confusing and smelly. TY for the pointers.

18:20:25

Show newer messages


Back to Room ListRoom Version: