Page MenuHomePhabricator

Clean up broken CheckUser block log parameters
Closed, ResolvedPublic

Description

Legacy block log parameters are supposed to be the expiry, optionally followed by a comma-separated list of block flags on a new line. But CheckUser has been setting log parameters like this for years:

1 week
anononly
nocreate

e.g. in https://en.wikipedia.org/w/index.php?title=Special%3ALog&type=block&user=Keegan&page=82.225.47.229 and https://en.wikipedia.org/w/index.php?title=Special%3ALog&type=block&user=Lar&page=70.145.96.22 - they show "anonymous users only" but not "account creation disabled"

We should fix this code in the extension and fix Wikimedia's log entries.

Details

Related Gerrit Patches:
mediawiki/extensions/WikimediaMaintenance : masterAdd maintenance script to fix up old CU-created block log entries
mediawiki/extensions/CheckUser : masterFix block flags in log for user blocks from Special:CheckUser

Event Timeline

Krenair created this task.Mar 15 2015, 7:43 PM
Krenair raised the priority of this task from to Needs Triage.
Krenair updated the task description. (Show Details)
Krenair added a subscriber: Krenair.
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptMar 15 2015, 7:43 PM

Change 196776 had a related patch set uploaded (by Alex Monk):
Fix block flags in log for user blocks from Special:CheckUser

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

Krenair added a comment.EditedMar 15 2015, 9:33 PM
select count(*) from logging where log_type = 'block' and log_action = 'block' and log_params like '%\nanononly\nnocreate';
arwiki:      [count(*)] => 8
commonswiki:      [count(*)] => 14
cswiki:      [count(*)] => 1
enwiki:      [count(*)] => 181
eswikisource:      [count(*)] => 2
itwiki:      [count(*)] => 12
jawiki:      [count(*)] => 18
kowiki:      [count(*)] => 1
mywiki:      [count(*)] => 1
ptwiki:      [count(*)] => 10
simplewiki:      [count(*)] => 14
svwiktionary:      [count(*)] => 1
zhwiki:      [count(*)] => 2

Change 196776 merged by jenkins-bot:
Fix block flags in log for user blocks from Special:CheckUser

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

Patch merged; is there anything left to do here?

Patch merged; is there anything left to do here?

The patch only fixes the code in the extension. We still need to fix the log entries made prior to the patch as this task was originally filed to fix both these issues.

Aklapper set Security to None.
Aklapper triaged this task as Medium priority.Mar 23 2015, 6:14 PM
Krenair added a comment.EditedMar 25 2015, 1:26 AM

So, I think this query should probably do it:

update logging set log_params = '1 week\nanononly,nocreate' where log_type = 'block' and log_action = 'block' and log_params = '1 week\nanononly\nnocreate';

Since we don't appear to have any with log_params = 'indefinite\nanonly\nnocreate'

Krenair added a comment.EditedMar 25 2015, 1:57 AM

I ran

foreachwiki sql.php listT92775.sql > T92775-listOfIDs.out

from terbium:~krenair, just in case

On the gerrit change I wrote:

update logging
   set log_params = '1 week\nanononly,nocreate'
 where log_type = 'block'
   and log_action = 'block'
   and log_params = '1 week\nanononly\nnocreate';

Because it should only affect block logs. A list of wikis is above, but should be done again because the fix is in Version 1.25wmf22 which is not deployed to all wikis yet (but will be done in the next hours)

Yep, that's identical to the query I wrote above.

Change 199672 had a related patch set uploaded (by Alex Monk):
Add maintenance script to fix up old CU-created block log entries

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

Change 199672 merged by jenkins-bot:
Add maintenance script to fix up old CU-created block log entries

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

Krenair closed this task as Resolved.Mar 26 2015, 5:19 AM

Done.

MarcoAurelio moved this task from Backlog to Closed on the CheckUser board.May 9 2016, 8:57 AM
Restricted Application added a subscriber: JEumerus. · View Herald TranscriptMay 9 2016, 8:57 AM