Page MenuHomePhabricator

Empty block log snippet due to non-normalized range block
Closed, ResolvedPublicBUG REPORT

Description

On ruwiki there is a block of 2A02:2168:B01:6FD4:0:0:0:1/64, improperly normalized in the DB. The log snippet code on Special:Contributions finds it anyway, but then passes the normalized title to LogEventsList::showLogExtract(). The log entry is not found and you end up with an empty wrapper div.

Database cleanup would be useful. Maybe also make showLogExtract() take a list of multiple titles.


Original report

Since a couple of weeks, we are getting sporadic issues with IP blocks on the Russian Wikipedia.
I'm not sure if they are related to each other, so I'm creating multiple tickets - one for each issue type.

Steps to replicate the issue (include links if applicable):

  • Hard to replicate, as the issue is sporadic.
  • Block enough IP addresses

What happens?:
The IP 2A02:2168:B01:6FD4:0:0:0:1 was blocked for one week on March 18th.
The block is not visible on IP's contribution page
https://ru.wikipedia.org/wiki/Служебная:Вклад/2A02:2168:B01:6FD4:0:0:0:1

Only if we go to the block log, we can see the block:
https://ru.wikipedia.org/w/index.php?title=Служебная:Журналы/block&page=Участник%3A2A02%3A2168%3AB01%3A6FD4%3A0%3A0%3A0%3A1&uselang=en

[snip separate issue moved to T389452]

The issue is very sporadic and happens during the manual blocks using the GUI as well as bot blocks using API

What should have happened instead?:
The block should prevent the IPs/users from editing and be visible on the contribution page as it supposed to be.

Software version (on Special:Version page; skip for WMF-hosted wikis like Wikipedia):

Other information (browser name/version, screenshots, etc.):

contribution_page_manual_block.png (528×1 px, 214 KB)

block_log_manual_block.png (844×1 px, 141 KB)

Event Timeline

Q-bit-array renamed this task from Sporadic issues with IP blocks on the Russian Wikipedia - ISSUE 2 to Sporadic issues with IP blocks on the Russian Wikipedia - issue 2.Mar 19 2025, 12:36 PM
Q-bit-array renamed this task from Sporadic issues with IP blocks on the Russian Wikipedia - issue 2 to Sporadic issues with IP blocks on Russian Wikipedia - issue 2.Mar 19 2025, 12:55 PM
Dreamy_Jazz subscribed.

Could be related to Multiblocks? The examples I see have blocks which appear to not be reflected on the current target but should still be active.

The block is not visible on IP's contribution page
https://ru.wikipedia.org/wiki/Служебная:Вклад/2A02:2168:B01:6FD4:0:0:0:1

This is partly due to T388097. There is a range block and a single-IP block. The range block is not properly normalized in either the logging table or the block_target table, it's in there as 2A02:2168:B01:6FD4:0:0:0:1/64 not 2A02:2168:B01:6FD4:0:0:0:0/64. Since T384916, the header on Special:Contributions loads both blocks and picks one randomly to use for the log search. It picks the range block. Then it searches for the normalized range in the log, and doesn't find it, so it ends up producing an empty div which you can see in the HTML source.

The block should still apply to any IP address in the range. If the blocks didn't apply, Special:Contributions wouldn't have loaded them.

And it also looks like that the block is really inactive and doesn't prevent editing. Some days ago, I had to hard-block an IP (proxy) from one of our LTAs. The block didn't prevent him from editing on the next day, which is a critical vulnerability!
https://ru.wikipedia.org/w/index.php?title=Служебная:Журналы/block&page=Участник%3A38.52.220.27&uselang=en
(You can't see contributions from this IP, because they were made from accounts. But a hard block is supposed to prevent even registered users from editing.)

I'll split off a separate task for this, since it doesn't seem to be related, and because I can make it NDA and paste some logs.

Filed T389452. @Q-bit-array it looks like you're not in the NDA group for whatever reason. If you're a functionary you've probably got an NDA already, so you probably just need to ask someone to add you to the group.

Anyway, I've mostly isolated it. It's definitely a separate issue from the IPv6 range block issue, so I'll edit the task description here to clarify what I'm making this one be about.

tstarling renamed this task from Sporadic issues with IP blocks on Russian Wikipedia - issue 2 to Empty block log snippet due to non-normalized range block.Mar 20 2025, 3:45 AM
tstarling updated the task description. (Show Details)

@tstarling as a CU and oversighter I've signed a NDA many years ago. Do you perhaps know who can add me to the NDA group? Stewards?

This probably welcomes a confirmation from @KFrancis that we have an NDA on file ^

There are two different NDAs. The NDA typically referred to in Phabricator as WMF-NDA (and which is being talked about here) is different from the NDA signed by on-wiki functionaries. Q-bit-array has likely signed only the latter NDA and not the former one.

I have no idea why this is.

This probably welcomes a confirmation from @KFrancis that we have an NDA on file ^

I checked my records for an NDA for Q-bit-array, but did not find one on file. -Happy to process one. Q-bit-array, please send your mailing address to me at kfrancis@wikimedia.org and I'll put the NDA together. Thanks!

FYI, I closed the private task T389452 as resolved. I solved all the mysteries, backported and deployed a patch, and cleaned up the DB.

FYI, I closed the private task T389452 as resolved. I solved all the mysteries, backported and deployed a patch, and cleaned up the DB.

Thank you for letting me know (as I don't have access to T389452) and especially for fixing the bug!

@tstarling is there anything outstanding on this?

Yes, LogEventsList::showLogExtract() should accept an array of pages, and ContributionsSpecialPage::contributionsSub() should pass all the block target user pages instead of just selecting a random one. That would have prevented the problem of the apparently disappearing single IP block.

Change #1138142 had a related patch set uploaded (by Tim Starling; author: Tim Starling):

[mediawiki/core@master] block: In block log snippets, link to all logs affecting the user

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

Change #1138142 merged by jenkins-bot:

[mediawiki/core@master] block: In block log snippets, link to all logs affecting the user

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