Last modified: 2011-12-16 15:51:08 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T35101, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 33101 - Viewing a User or User talk page of username resembling IP ending with ".xxx" causes internal error
Viewing a User or User talk page of username resembling IP ending with ".xxx"...
Status: RESOLVED FIXED
Product: MediaWiki
Classification: Unclassified
User blocking (Other open bugs)
1.18.x
All All
: High critical (vote)
: ---
Assigned To: Nobody - You can work on this!
: patch, patch-need-review
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2011-12-14 12:56 UTC by chzz
Modified: 2011-12-16 15:51 UTC (History)
6 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments
Don't try to load blocks for an invalid username (522 bytes, patch)
2011-12-14 21:41 UTC, Brad Jorsch
Details

Description chzz 2011-12-14 12:56:30 UTC
enwiki

Trying to display this page;

http://en.wikipedia.org/wiki/User_talk:213.253.39.xxx

Results in;

---
Internal error

From Wikipedia, the free encyclopedia

Tried to load block with invalid type

Backtrace:

#0 /usr/local/apache/common-local/php-1.18/includes/Block.php(1039): Block->newLoad('213.253.39.xxx')
#1 /usr/local/apache/common-local/php-1.18/includes/Article.php(646): Block::newFromTarget(NULL, '213.253.39.xxx')
#2 /usr/local/apache/common-local/php-1.18/includes/Article.php(570): Article->getRobotPolicy('view')
#3 /usr/local/apache/common-local/php-1.18/includes/Wiki.php(479): Article->view()
#4 /usr/local/apache/common-local/php-1.18/includes/Wiki.php(250): MediaWiki->performAction(Object(Article))
#5 /usr/local/apache/common-local/php-1.18/includes/Wiki.php(635): MediaWiki->performRequest()
#6 /usr/local/apache/common-local/php-1.18/includes/Wiki.php(542): MediaWiki->main()
#7 /usr/local/apache/common-local/php-1.18/index.php(57): MediaWiki->run()
#8 /usr/local/apache/common-local/live-1.5/index.php(3): require('/usr/local/apac...')
#9 {main}
---

At time of writing, the page has only one revision, which is from 2007;

http://en.wikipedia.org/w/index.php?title=User_talk:213.253.39.xxx&diff=prev&oldid=145797301

Other IP user talks ending with .xxx give similar, including;

http://en.wikipedia.org/wiki/User_talk:216.195.179.xxx
http://en.wikipedia.org/wiki/User_talk:209.75.42.xxx

Originally reported at VPT;

http://en.wikipedia.org/wiki/Wikipedia:Village_pump_%28technical%29#Internal_error

http://en.wikipedia.org/w/index.php?title=Wikipedia:Village_pump_(technical)&diff=prev&oldid=465754254
Comment 1 Erwin Dokter 2011-12-14 14:33:42 UTC
Presumably, either parser or block module tries to interpret username as an IP adress. Marking as critical.
Comment 2 Brad Jorsch 2011-12-14 21:41:39 UTC
Created attachment 9703 [details]
Don't try to load blocks for an invalid username

It appears the problem will occur on any non-redlinked user or user talk page for an invalid username. Names like "209.75.42.xxx" are invalid because they were used by the usemod software to "cloak" IP addresses, but any other case where you can create the user or user talk page for an invalid username will do it.

The problem lies in Block, in that it will try to load blocks for what it already knows is an invalid username, and then complains when it finds that it has an invalid username. It was broken in the big rewrite in r84475.

I've attached a patch that quite simply just makes it return "no blocks" for an invalid username.
Comment 3 Hazard-SJ 2011-12-14 22:33:27 UTC
See also, a user page with the same problem: http://en.wikipedia.org/wiki/User:213.253.39.xxx
Comment 4 Erwin Dokter 2011-12-14 23:47:36 UTC
What does "invalid" mean in this context? Obviously, these usernames exist, andthe can be blocked. So reporting no-blocks would be just as bad.
Comment 5 Graham87 2011-12-15 03:30:14 UTC
(In reply to comment #4)
> What does "invalid" mean in this context?
Presumably, it means that the usernames can't be created anymore, per bug 3631.
Comment 6 Sam Reed (reedy) 2011-12-15 18:58:38 UTC
(In reply to comment #2)
> Created attachment 9703 [details]
> Don't try to load blocks for an invalid username
> 
> It appears the problem will occur on any non-redlinked user or user talk page
> for an invalid username. Names like "209.75.42.xxx" are invalid because they
> were used by the usemod software to "cloak" IP addresses, but any other case
> where you can create the user or user talk page for an invalid username will do
> it.
> 
> The problem lies in Block, in that it will try to load blocks for what it
> already knows is an invalid username, and then complains when it finds that it
> has an invalid username. It was broken in the big rewrite in r84475.
> 
> I've attached a patch that quite simply just makes it return "no blocks" for an
> invalid username.

Interesting, I couldn't reproduce locally on trunk, but pushing the fix to the cluster fixed the issue. So I'm gonna apply the patch based on that

r106354 and r106355

Thanks!
Comment 7 chzz 2011-12-15 22:14:21 UTC
(In reply to comment #6)
> (In reply to comment #2)
> > Created attachment 9703 [details]
> > Don't try to load blocks for an invalid username
> > 
> > It appears the problem will occur on any non-redlinked user or user talk page
> > for an invalid username. Names like "209.75.42.xxx" are invalid because they
> > were used by the usemod software to "cloak" IP addresses, but any other case
> > where you can create the user or user talk page for an invalid username will do
> > it.
> > 
> > The problem lies in Block, in that it will try to load blocks for what it
> > already knows is an invalid username, and then complains when it finds that it
> > has an invalid username. It was broken in the big rewrite in r84475.
> > 
> > I've attached a patch that quite simply just makes it return "no blocks" for an
> > invalid username.
> 
> Interesting, I couldn't reproduce locally on trunk, but pushing the fix to the
> cluster fixed the issue. So I'm gonna apply the patch based on that
> 
> r106354 and r106355
> 
> Thanks!

Gosh, it's a whole other language. As a mere human. I have no idea about your 
'pushing trunks' and so forth; I can only thank you for your kind attention
Comment 8 Brad Jorsch 2011-12-16 15:51:08 UTC
(In reply to comment #4)
> What does "invalid" mean in this context? Obviously, these usernames exist,
> andthe can be blocked. So reporting no-blocks would be just as bad.

In this context, "invalid" means "User::newFromName($name) returns false". I'm not sure how well an existing account with such a name would be usable, as anything that tries to use User::newFromName to get at the user data will break.


(In reply to comment #6)

> Interesting, I couldn't reproduce locally on trunk, but pushing the fix to the
> cluster fixed the issue. So I'm gonna apply the patch based on that

Did you make sure to create the user/user talk page on your local wiki?

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links