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.

Event Timeline

Krenair raised the priority of this task from to Needs Triage.
Krenair updated the task description. (Show Details)
Krenair subscribed.

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

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 triaged this task as Medium priority.Mar 23 2015, 6:14 PM

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'

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