Page MenuHomePhabricator

Automatic global group membership is updated on unrelated local group changes
Closed, ResolvedPublic

Description

Automatic global group membership is sometimes updated on unrelated local group changes:

Another weird case: https://en.wikibooks.org/w/index.php?title=Special:Log&logid=5292619 caused https://en.wikibooks.org/wiki/Special:Log/gblrights even though the relevant local group (CU) wasn't even changed – and local admins shouldn't be able to do anything that affects global groups: All local/global group changes (CU/OS/GS) which trigger granting/removing GTAIV can only be done by stewards.

I suppose this is because the new global group was not initially populated with the users belonging to relevant local groups, so the change took effect the next time the local group membership was changed in any way?

I think we should fix it by populating the groups with a maintenance script. I am already working on one for the 'local-bot' group from T415588: https://gerrit.wikimedia.org/r/c/mediawiki/extensions/CentralAuth/+/1234540. Should we run the script for the 'global-temporary-account-viewer' group as well?

Event Timeline

Stewards didn’t get GTAIV because it’s redundant to our steward permissions. But it turned out most of us still got the permissions once our local groups changed in a wiki where we hold CU/OS permissions (even when the group change was unrelated to CU/OS like in the example above) or when temporarily granting CU/OS permissions to ourselves to perform actions on a wiki without local CU/OS.
As of today there are just four stewards left without GTAIV https://meta.wikimedia.org/wiki/Special:GlobalUsers?username=&group=steward&limit=100

I suppose this is because the new global group was not initially populated with the users belonging to relevant local groups, so the change took effect the next time the local group membership was changed in any way?

Yes, that would explain it.

I think we should fix it by populating the groups with a maintenance script. I am already working on one for the 'local-bot' group from T415588: https://gerrit.wikimedia.org/r/c/mediawiki/extensions/CentralAuth/+/1234540. Should we run the script for the 'global-temporary-account-viewer' group as well?

Thanks. Yes please, it makes sense to run it for 'global-temporary-account-viewer' too.

Change #1234540 had a related patch set uploaded (by Bartosz Dziewoński; author: Bartosz Dziewoński):

[mediawiki/extensions/CentralAuth@master] Add maintenance script to update automatic global group membership

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

Change #1234540 merged by jenkins-bot:

[mediawiki/extensions/CentralAuth@master] Add maintenance script to update automatic global group membership

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

Next step: wait for train rollout, then run foreachwikiindblist sul CentralAuth:UpdateAutomaticGlobalGroupMembership --local-group=checkuser --local-group=suppress. This will take care of any outstanding memberships in global-temporary-account-viewer that weren't processed before, per this config for local groups: https://gerrit.wikimedia.org/g/operations/mediawiki-config/+/a13355b072b61df5be4e319f3fdaec6479fb3276/wmf-config/CommonSettings.php#4568 (I checked and all users in the global group global-sysop are already members of the new global group, so there's no need to handle that). Changes will be logged at https://meta.wikimedia.org/wiki/Special:Log/gblrights/Maintenance_script.

Done on the beta cluster: https://meta.wikimedia.beta.wmcloud.org/wiki/Special:Log/gblrights/Maintenance_script

1matmarex@deployment-mwmaint03:~$ foreachwikiindblist sul CentralAuth:UpdateAutomaticGlobalGroupMembership --local-group=checkuser --local-group=suppress
2-----------------------------------------------------------------
3aawiki
4-----------------------------------------------------------------
5aawiki: No changes were made.
6-----------------------------------------------------------------
7apiportalwiki
8-----------------------------------------------------------------
9apiportalwiki: No changes were made.
10-----------------------------------------------------------------
11arwiki
12-----------------------------------------------------------------
13arwiki: No changes were made.
14-----------------------------------------------------------------
15bnwiki
16-----------------------------------------------------------------
17bnwiki: No changes were made.
18-----------------------------------------------------------------
19cawiki
20-----------------------------------------------------------------
21cawiki: Added 2 users to the 'global-temporary-account-viewer' user group.
22-----------------------------------------------------------------
23commonswiki
24-----------------------------------------------------------------
25commonswiki: Added 5 users to the 'global-temporary-account-viewer' user group.
26-----------------------------------------------------------------
27crhwiki
28-----------------------------------------------------------------
29crhwiki: No changes were made.
30-----------------------------------------------------------------
31cswiki
32-----------------------------------------------------------------
33cswiki: No changes were made.
34-----------------------------------------------------------------
35dewiki
36-----------------------------------------------------------------
37dewiki: Added 5 users to the 'global-temporary-account-viewer' user group.
38-----------------------------------------------------------------
39dewiktionary
40-----------------------------------------------------------------
41dewiktionary: No changes were made.
42-----------------------------------------------------------------
43enwiki
44-----------------------------------------------------------------
45enwiki: Added 40 users to the 'global-temporary-account-viewer' user group.
46-----------------------------------------------------------------
47enwikibooks
48-----------------------------------------------------------------
49enwikibooks: No changes were made.
50-----------------------------------------------------------------
51enwikinews
52-----------------------------------------------------------------
53enwikinews: Added 1 users to the 'global-temporary-account-viewer' user group.
54-----------------------------------------------------------------
55enwikiquote
56-----------------------------------------------------------------
57enwikiquote: No changes were made.
58-----------------------------------------------------------------
59enwikisource
60-----------------------------------------------------------------
61enwikisource: No changes were made.
62-----------------------------------------------------------------
63enwikiversity
64-----------------------------------------------------------------
65enwikiversity: No changes were made.
66-----------------------------------------------------------------
67enwikivoyage
68-----------------------------------------------------------------
69enwikivoyage: No changes were made.
70-----------------------------------------------------------------
71enwiktionary
72-----------------------------------------------------------------
73enwiktionary: No changes were made.
74-----------------------------------------------------------------
75eowiki
76-----------------------------------------------------------------
77eowiki: No changes were made.
78-----------------------------------------------------------------
79eswiki
80-----------------------------------------------------------------
81eswiki: No changes were made.
82-----------------------------------------------------------------
83eswikibooks
84-----------------------------------------------------------------
85eswikibooks: No changes were made.
86-----------------------------------------------------------------
87fawiki
88-----------------------------------------------------------------
89fawiki: No changes were made.
90-----------------------------------------------------------------
91foundationwiki
92-----------------------------------------------------------------
93foundationwiki: No changes were made.
94-----------------------------------------------------------------
95frwiki
96-----------------------------------------------------------------
97frwiki: No changes were made.
98-----------------------------------------------------------------
99frwiktionary
100-----------------------------------------------------------------
101frwiktionary: No changes were made.
102-----------------------------------------------------------------
103hewiki
104-----------------------------------------------------------------
105hewiki: No changes were made.
106-----------------------------------------------------------------
107hewiktionary
108-----------------------------------------------------------------
109hewiktionary: No changes were made.
110-----------------------------------------------------------------
111hiwiki
112-----------------------------------------------------------------
113hiwiki: No changes were made.
114-----------------------------------------------------------------
115incubatorwiki
116-----------------------------------------------------------------
117incubatorwiki: No changes were made.
118-----------------------------------------------------------------
119jawiki
120-----------------------------------------------------------------
121jawiki: No changes were made.
122-----------------------------------------------------------------
123kowiki
124-----------------------------------------------------------------
125kowiki: No changes were made.
126-----------------------------------------------------------------
127loginwiki
128-----------------------------------------------------------------
129loginwiki: Added 1 users to the 'global-temporary-account-viewer' user group.
130-----------------------------------------------------------------
131metawiki
132-----------------------------------------------------------------
133metawiki: Added 2 users to the 'global-temporary-account-viewer' user group.
134-----------------------------------------------------------------
135nlwiki
136-----------------------------------------------------------------
137nlwiki: No changes were made.
138-----------------------------------------------------------------
139plwikivoyage
140-----------------------------------------------------------------
141plwikivoyage: No changes were made.
142-----------------------------------------------------------------
143ruwiki
144-----------------------------------------------------------------
145ruwiki: No changes were made.
146-----------------------------------------------------------------
147simplewiki
148-----------------------------------------------------------------
149simplewiki: Added 1 users to the 'global-temporary-account-viewer' user group.
150-----------------------------------------------------------------
151sqwiki
152-----------------------------------------------------------------
153sqwiki: No changes were made.
154-----------------------------------------------------------------
155srwiki
156-----------------------------------------------------------------
157srwiki: No changes were made.
158-----------------------------------------------------------------
159svwiki
160-----------------------------------------------------------------
161svwiki: No changes were made.
162-----------------------------------------------------------------
163test2wiki
164-----------------------------------------------------------------
165test2wiki: No changes were made.
166-----------------------------------------------------------------
167testwiki
168-----------------------------------------------------------------
169testwiki: Added 5 users to the 'global-temporary-account-viewer' user group.
170-----------------------------------------------------------------
171ukwiki
172-----------------------------------------------------------------
173ukwiki: No changes were made.
174-----------------------------------------------------------------
175viwiki
176-----------------------------------------------------------------
177viwiki: No changes were made.
178-----------------------------------------------------------------
179wikidatawiki
180-----------------------------------------------------------------
181wikidatawiki: No changes were made.
182-----------------------------------------------------------------
183zhwiki
184-----------------------------------------------------------------
185zhwiki: No changes were made.
186-----------------------------------------------------------------
187zhwikivoyage
188-----------------------------------------------------------------
189zhwikivoyage: No changes were made.

There are some discrepancies in the numbers reported by the script, and the number of log entries. The script says that a total of 62 users were added to the group. The log only shows 9 entries.

The current list of users has 70 of them. I didn't think to check it before running the script, and I haven't found any way to find the previous data. My best guess, based on the gblrights log and the order of entries in the global_user_groups table, is that there were 14 users in the group and 56 were added.

My best guess is that the problems were likely caused by the script reading from the replica databases. In some cases this caused it to try to add a user again because it appeared that they were not group members yet, and in other cases to skip generating the log entry because it appeared that no changes were made.

Change #1242458 had a related patch set uploaded (by Bartosz Dziewoński; author: Bartosz Dziewoński):

[mediawiki/extensions/CentralAuth@master] UpdateAutomaticGlobalGroupMembership: Read user data from primary

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

You could always just configure a global-temporary-account-viewer-2 group on beta, re-run the script, and see what happens. That's guaranteed to be empty at start.

I was going to run a query to delete user group memberships, excluding those that seem to have been there before today:

DELETE FROM global_user_groups 
WHERE gug_group='global-temporary-account-viewer' 
AND gug_user NOT IN (202091, 55618, 33432, 296022, 13970, 196695, 17, 296122, 296023, 296016, 296009, 252629, 24596, 34246);

This should be fine too, right?

Change #1242458 merged by jenkins-bot:

[mediawiki/extensions/CentralAuth@master] UpdateAutomaticGlobalGroupMembership: Read user data from primary

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

I ran that DELETE.

Second attempt to run the script on the beta cluster: https://meta.wikimedia.beta.wmcloud.org/wiki/Special:Log/gblrights/Maintenance_script?limit=100

1matmarex@deployment-mwmaint03:~$ foreachwikiindblist sul CentralAuth:UpdateAutomaticGlobalGroupMembership --local-group=checkuser --local-group=suppress
2-----------------------------------------------------------------
3aawiki
4-----------------------------------------------------------------
5aawiki: No changes were made.
6-----------------------------------------------------------------
7apiportalwiki
8-----------------------------------------------------------------
9apiportalwiki: No changes were made.
10-----------------------------------------------------------------
11arwiki
12-----------------------------------------------------------------
13arwiki: No changes were made.
14-----------------------------------------------------------------
15bnwiki
16-----------------------------------------------------------------
17bnwiki: No changes were made.
18-----------------------------------------------------------------
19cawiki
20-----------------------------------------------------------------
21cawiki: Added 2 users to the 'global-temporary-account-viewer' user group.
22-----------------------------------------------------------------
23commonswiki
24-----------------------------------------------------------------
25commonswiki: Added 5 users to the 'global-temporary-account-viewer' user group.
26-----------------------------------------------------------------
27crhwiki
28-----------------------------------------------------------------
29crhwiki: No changes were made.
30-----------------------------------------------------------------
31cswiki
32-----------------------------------------------------------------
33cswiki: No changes were made.
34-----------------------------------------------------------------
35dewiki
36-----------------------------------------------------------------
37dewiki: Added 5 users to the 'global-temporary-account-viewer' user group.
38-----------------------------------------------------------------
39dewiktionary
40-----------------------------------------------------------------
41dewiktionary: No changes were made.
42-----------------------------------------------------------------
43enwiki
44-----------------------------------------------------------------
45enwiki: Added 34 users to the 'global-temporary-account-viewer' user group.
46-----------------------------------------------------------------
47enwikibooks
48-----------------------------------------------------------------
49enwikibooks: No changes were made.
50-----------------------------------------------------------------
51enwikinews
52-----------------------------------------------------------------
53enwikinews: Added 1 users to the 'global-temporary-account-viewer' user group.
54-----------------------------------------------------------------
55enwikiquote
56-----------------------------------------------------------------
57enwikiquote: No changes were made.
58-----------------------------------------------------------------
59enwikisource
60-----------------------------------------------------------------
61enwikisource: No changes were made.
62-----------------------------------------------------------------
63enwikiversity
64-----------------------------------------------------------------
65enwikiversity: No changes were made.
66-----------------------------------------------------------------
67enwikivoyage
68-----------------------------------------------------------------
69enwikivoyage: No changes were made.
70-----------------------------------------------------------------
71enwiktionary
72-----------------------------------------------------------------
73enwiktionary: No changes were made.
74-----------------------------------------------------------------
75eowiki
76-----------------------------------------------------------------
77eowiki: No changes were made.
78-----------------------------------------------------------------
79eswiki
80-----------------------------------------------------------------
81eswiki: No changes were made.
82-----------------------------------------------------------------
83eswikibooks
84-----------------------------------------------------------------
85eswikibooks: No changes were made.
86-----------------------------------------------------------------
87fawiki
88-----------------------------------------------------------------
89fawiki: No changes were made.
90-----------------------------------------------------------------
91foundationwiki
92-----------------------------------------------------------------
93foundationwiki: No changes were made.
94-----------------------------------------------------------------
95frwiki
96-----------------------------------------------------------------
97frwiki: No changes were made.
98-----------------------------------------------------------------
99frwiktionary
100-----------------------------------------------------------------
101frwiktionary: No changes were made.
102-----------------------------------------------------------------
103hewiki
104-----------------------------------------------------------------
105hewiki: No changes were made.
106-----------------------------------------------------------------
107hewiktionary
108-----------------------------------------------------------------
109hewiktionary: No changes were made.
110-----------------------------------------------------------------
111hiwiki
112-----------------------------------------------------------------
113hiwiki: No changes were made.
114-----------------------------------------------------------------
115incubatorwiki
116-----------------------------------------------------------------
117incubatorwiki: No changes were made.
118-----------------------------------------------------------------
119jawiki
120-----------------------------------------------------------------
121jawiki: No changes were made.
122-----------------------------------------------------------------
123kowiki
124-----------------------------------------------------------------
125kowiki: No changes were made.
126-----------------------------------------------------------------
127loginwiki
128-----------------------------------------------------------------
129loginwiki: Added 1 users to the 'global-temporary-account-viewer' user group.
130-----------------------------------------------------------------
131metawiki
132-----------------------------------------------------------------
133metawiki: Added 2 users to the 'global-temporary-account-viewer' user group.
134-----------------------------------------------------------------
135nlwiki
136-----------------------------------------------------------------
137nlwiki: No changes were made.
138-----------------------------------------------------------------
139plwikivoyage
140-----------------------------------------------------------------
141plwikivoyage: No changes were made.
142-----------------------------------------------------------------
143ruwiki
144-----------------------------------------------------------------
145ruwiki: No changes were made.
146-----------------------------------------------------------------
147simplewiki
148-----------------------------------------------------------------
149simplewiki: Added 1 users to the 'global-temporary-account-viewer' user group.
150-----------------------------------------------------------------
151sqwiki
152-----------------------------------------------------------------
153sqwiki: No changes were made.
154-----------------------------------------------------------------
155srwiki
156-----------------------------------------------------------------
157srwiki: No changes were made.
158-----------------------------------------------------------------
159svwiki
160-----------------------------------------------------------------
161svwiki: No changes were made.
162-----------------------------------------------------------------
163test2wiki
164-----------------------------------------------------------------
165test2wiki: No changes were made.
166-----------------------------------------------------------------
167testwiki
168-----------------------------------------------------------------
169testwiki: Added 5 users to the 'global-temporary-account-viewer' user group.
170-----------------------------------------------------------------
171ukwiki
172-----------------------------------------------------------------
173ukwiki: No changes were made.
174-----------------------------------------------------------------
175viwiki
176-----------------------------------------------------------------
177viwiki: No changes were made.
178-----------------------------------------------------------------
179wikidatawiki
180-----------------------------------------------------------------
181wikidatawiki: No changes were made.
182-----------------------------------------------------------------
183zhwiki
184-----------------------------------------------------------------
185zhwiki: No changes were made.
186-----------------------------------------------------------------
187zhwikivoyage
188-----------------------------------------------------------------
189zhwikivoyage: No changes were made.

This looks much better. Scripts says 56 users added, and there are 56 new log entries. I think we can go ahead with production now.

Change #1242469 had a related patch set uploaded (by Bartosz Dziewoński; author: Bartosz Dziewoński):

[mediawiki/extensions/CentralAuth@wmf/1.46.0-wmf.16] UpdateAutomaticGlobalGroupMembership: Read user data from primary

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

Change #1242469 merged by jenkins-bot:

[mediawiki/extensions/CentralAuth@wmf/1.46.0-wmf.16] UpdateAutomaticGlobalGroupMembership: Read user data from primary

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

tgr@deploy2002:~$ foreachwikiindblist sul CentralAuth:UpdateAutomaticGlobalGroupMembership --local-group=checkuser --local-group=suppress | tee T416541.log

tgr@deploy2002:~$ ack 'users' T416541.log
itwiki:  Added 1 users to the 'global-temporary-account-viewer' user group.
loginwiki:  Added 3 users to the 'global-temporary-account-viewer' user group.
testwiki:  Added 2 users to the 'global-temporary-account-viewer' user group.

Checks out: https://meta.wikimedia.org/wiki/Special:Log/gblrights/Maintenance_script

21:57, 23 February 2026 Maintenance script talk contribs changed global group membership for DWalden (WMF): granted global-temporary-account-viewer; kept staff unchanged (Automatically updated global groups after configuration was changed.)
21:57, 23 February 2026 Maintenance script talk contribs changed global group membership for SBassett (WMF): granted global-temporary-account-viewer; kept staff unchanged (Automatically updated global groups after configuration was changed.)
21:52, 23 February 2026 Maintenance script talk contribs changed global group membership for HakanIST: granted global-temporary-account-viewer; kept steward unchanged (Automatically updated global groups after configuration was changed.)
21:52, 23 February 2026 Maintenance script talk contribs changed global group membership for Albertoleoncio: granted global-temporary-account-viewer; kept steward and vrt-permissions unchanged (Automatically updated global groups after configuration was changed.)
21:51, 23 February 2026 Maintenance script talk contribs changed global group membership for Masti: granted global-temporary-account-viewer; kept steward and vrt-permissions unchanged (Automatically updated global groups after configuration was changed.)
21:49, 23 February 2026 Maintenance script talk contribs changed global group membership for Sakretsu: granted global-temporary-account-viewer; kept steward unchanged (Automatically updated global groups after configuration was changed.)

Thanks for deploying @Tgr!