Page MenuHomePhabricator

Fatal exception on Special:Contributions for blocked user (InvalidArgumentException: "Blocker must be a local user or a name that cannot be a local user")
Open, HighPublic

Description

Urls look like:

/w/index.php?title=Special:Contributions&contribs=user&target=*** where *** is an abusive username that was blocked.

Stacktrace:

2018-07-19 10:28:24 [W1BnyApAAEYAAD6E1UgAAADU] mw1275 metawiki 1.32.0-wmf.13 exception ERROR:
{
  exception_id: W1BnyApAAEYAAD6E1UgAAADU
  exception_url: "/w/index.php?limit=50&title=Special%3AContributions&contribs=user&target=***&namespace=&tagfilter=&start=&end=",
  "caught_by": mwe_handler
} 
[Exception InvalidArgumentException] (/srv/mediawiki/php-1.32.0-wmf.13/includes/Block.php:1514) Blocker must be a local user or a name that cannot be a local user
  #0 /srv/mediawiki/php-1.32.0-wmf.13/includes/Block.php(462): Block->setBlocker(User)
  #1 /srv/mediawiki/php-1.32.0-wmf.13/includes/Block.php(492): Block->initFromRow(stdClass)
  #2 /srv/mediawiki/php-1.32.0-wmf.13/includes/Block.php(362): Block::newFromRow(stdClass)
  #3 /srv/mediawiki/php-1.32.0-wmf.13/includes/Block.php(1195): Block->newLoad(NULL)
  #4 /srv/mediawiki/php-1.32.0-wmf.13/includes/user/User.php(1847): Block::newFromTarget(User, NULL, boolean)
  #5 /srv/mediawiki/php-1.32.0-wmf.13/includes/user/User.php(2274): User->getBlockedStatus(boolean)
  #6 /srv/mediawiki/php-1.32.0-wmf.13/includes/user/User.php(2264): User->getBlock(boolean)
  #7 /srv/mediawiki/php-1.32.0-wmf.13/includes/specials/SpecialContributions.php(376): User->isBlocked()
  #8 /srv/mediawiki/php-1.32.0-wmf.13/includes/specials/SpecialContributions.php(306): SpecialContributions::getUserLinks(SpecialContributions, User)
  #9 /srv/mediawiki/php-1.32.0-wmf.13/includes/specials/SpecialContributions.php(114): SpecialContributions->contributionsSub(User)
  #10 /srv/mediawiki/php-1.32.0-wmf.13/includes/specialpage/SpecialPage.php(566): SpecialContributions->execute(NULL)
  #11 /srv/mediawiki/php-1.32.0-wmf.13/includes/specialpage/SpecialPageFactory.php(569): SpecialPage->run(NULL)
  #12 /srv/mediawiki/php-1.32.0-wmf.13/includes/MediaWiki.php(288): SpecialPageFactory::executePath(Title, RequestContext)
  #13 /srv/mediawiki/php-1.32.0-wmf.13/includes/MediaWiki.php(867): MediaWiki->performRequest()
  #14 /srv/mediawiki/php-1.32.0-wmf.13/includes/MediaWiki.php(524): MediaWiki->main()
  #15 /srv/mediawiki/php-1.32.0-wmf.13/index.php(42): MediaWiki->run()
  #16 /srv/mediawiki/w/index.php(3): include(string)
  #17 {main}

Explanation:
I was typing an username in Special:Contributions. A list of abusive usernames attacking that user also appear there so I wanted to know if those were handled properly. Selecting any of them resulted in the fatal I reported above.

Related Objects

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald TranscriptApr 24 2018, 9:22 PM
MusikAnimal updated the task description. (Show Details)Apr 24 2018, 9:34 PM
MusikAnimal updated the task description. (Show Details)
Vvjjkkii renamed this task from Fatal exception while querying an username to 7aeaaaaaaa.Jul 1 2018, 1:14 AM
Vvjjkkii raised the priority of this task from Normal to High.
Vvjjkkii updated the task description. (Show Details)
Vvjjkkii removed subscribers: Aklapper, MarcoAurelio.
AfroThundr3007730 renamed this task from 7aeaaaaaaa to Fatal exception while querying an username.Jul 1 2018, 6:53 AM
AfroThundr3007730 lowered the priority of this task from High to Normal.
AfroThundr3007730 updated the task description. (Show Details)
Krinkle added a subscriber: Krinkle.EditedJul 18 2018, 11:32 PM

@MarcoAurelio I'm unable to find this in the logs, I searched for the class name of the exception and anything with "Contributions". Can you still reproduce it? If so, please provide another exception ID so that I can re-query for details. In its current form, we cannot find or solve the problem.

(Tip: Be sure to use the share/short-url option next time, because the address bar is not shareable; the normal Logstash encoding is private to your session only.)

@Krinkle Actually the logstash link was shared to me by another developer. I do not have access to Logstash in production so I'm not able to provide you with another URL.

I'll try to remember which username it was and try to query it again.

@Krinkle: [W1BnyApAAEYAAD6E1UgAAADU] 2018-07-19 10:28:24: Fatal exception of type "InvalidArgumentException".

Thanks. It seems this one didn't make it to Logstash for some reason, but found it on mwlog1001 in archive/exception.log-20180720.gz.

2018-07-19 10:28:24 [W1BnyApAAEYAAD6E1UgAAADU] mw1275 metawiki 1.32.0-wmf.13 exception ERROR:
{
  exception_id: W1BnyApAAEYAAD6E1UgAAADU
  exception_url: "/w/index.php?limit=50&title=Special%3AContributions&contribs=user&target=***&namespace=&tagfilter=&start=&end=",
  "caught_by": mwe_handler
} 
[Exception InvalidArgumentException] (/srv/mediawiki/php-1.32.0-wmf.13/includes/Block.php:1514) Blocker must be a local user or a name that cannot be a local user
  #0 /srv/mediawiki/php-1.32.0-wmf.13/includes/Block.php(462): Block->setBlocker(User)
  #1 /srv/mediawiki/php-1.32.0-wmf.13/includes/Block.php(492): Block->initFromRow(stdClass)
  #2 /srv/mediawiki/php-1.32.0-wmf.13/includes/Block.php(362): Block::newFromRow(stdClass)
  #3 /srv/mediawiki/php-1.32.0-wmf.13/includes/Block.php(1195): Block->newLoad(NULL)
  #4 /srv/mediawiki/php-1.32.0-wmf.13/includes/user/User.php(1847): Block::newFromTarget(User, NULL, boolean)
  #5 /srv/mediawiki/php-1.32.0-wmf.13/includes/user/User.php(2274): User->getBlockedStatus(boolean)
  #6 /srv/mediawiki/php-1.32.0-wmf.13/includes/user/User.php(2264): User->getBlock(boolean)
  #7 /srv/mediawiki/php-1.32.0-wmf.13/includes/specials/SpecialContributions.php(376): User->isBlocked()
  #8 /srv/mediawiki/php-1.32.0-wmf.13/includes/specials/SpecialContributions.php(306): SpecialContributions::getUserLinks(SpecialContributions, User)
  #9 /srv/mediawiki/php-1.32.0-wmf.13/includes/specials/SpecialContributions.php(114): SpecialContributions->contributionsSub(User)
  #10 /srv/mediawiki/php-1.32.0-wmf.13/includes/specialpage/SpecialPage.php(566): SpecialContributions->execute(NULL)
  #11 /srv/mediawiki/php-1.32.0-wmf.13/includes/specialpage/SpecialPageFactory.php(569): SpecialPage->run(NULL)
  #12 /srv/mediawiki/php-1.32.0-wmf.13/includes/MediaWiki.php(288): SpecialPageFactory::executePath(Title, RequestContext)
  #13 /srv/mediawiki/php-1.32.0-wmf.13/includes/MediaWiki.php(867): MediaWiki->performRequest()
  #14 /srv/mediawiki/php-1.32.0-wmf.13/includes/MediaWiki.php(524): MediaWiki->main()
  #15 /srv/mediawiki/php-1.32.0-wmf.13/index.php(42): MediaWiki->run()
  #16 /srv/mediawiki/w/index.php(3): include(string)
  #17 {main}

@MarcoAurelio Given that you know the username that triggered it and (probably) how/why it was blocked, could you narrow down what circumstances cause this error? The internal error suggests that it may have something to do with global blocks or locks.

Krinkle updated the task description. (Show Details)Jul 24 2018, 3:01 PM
Krinkle renamed this task from Fatal exception while querying an username to Fatal exception on Special:Contributions for blocked user (InvalidArgumentException: "Blocker must be a local user or a name that cannot be a local user").
Krinkle raised the priority of this task from Normal to High.
Krinkle added a project: Contributors-Team.
Krinkle moved this task from Other to User blocking on the MediaWiki-User-management board.
Krinkle added a comment.EditedOct 24 2018, 6:03 PM

Still seen on 1.32.0-wmf.26. Usually for simple user requests for urls like Special:Contributions/<some blocked username>.

The user names being intentionally hidden from public logs I won't post the url here, but to developers/managers: reach out privately for example that trigger this error. It typically looks like this:

The exception is still present on 1.33.0-wmf.25 (fca0750). I go the error when blocking a user from Special:Block.

This is an example of the issue on zhwp.

It seems the data coming from the database and the blocker is already invalid on the database.

Maybe a maintenance script was blocking some users here?
Someone has to look at the ipblocks table for the row to see what is the blocker name, maybe refered by user id, user name or actor id.