Page MenuHomePhabricator

InvalidArgumentException: Invalid IP address
Closed, ResolvedPublicPRODUCTION ERROR

Description

Error
normalized_message
[{reqId}] {exception_url}   InvalidArgumentException: Invalid IP address
exception.trace
from /srv/mediawiki/php-1.38.0-wmf.1/includes/user/UserFactory.php(115)
#0 /srv/mediawiki/php-1.38.0-wmf.1/extensions/MobileFrontend/includes/specials/SpecialMobileContributions.php(73): MediaWiki\User\UserFactory->newAnonymous(string)
#1 /srv/mediawiki/php-1.38.0-wmf.1/extensions/MobileFrontend/includes/specials/MobileSpecialPage.php(75): SpecialMobileContributions->executeWhenAvailable(string)
#2 /srv/mediawiki/php-1.38.0-wmf.1/extensions/MobileFrontend/includes/specials/MobileSpecialPageFeed.php(30): MobileSpecialPage->execute(string)
#3 /srv/mediawiki/php-1.38.0-wmf.1/includes/specialpage/SpecialPage.php(647): MobileSpecialPageFeed->execute(string)
#4 /srv/mediawiki/php-1.38.0-wmf.1/includes/specialpage/SpecialPageFactory.php(1367): SpecialPage->run(string)
#5 /srv/mediawiki/php-1.38.0-wmf.1/includes/MediaWiki.php(314): MediaWiki\SpecialPage\SpecialPageFactory->executePath(string, RequestContext)
#6 /srv/mediawiki/php-1.38.0-wmf.1/includes/MediaWiki.php(925): MediaWiki->performRequest()
#7 /srv/mediawiki/php-1.38.0-wmf.1/includes/MediaWiki.php(559): MediaWiki->main()
#8 /srv/mediawiki/php-1.38.0-wmf.1/index.php(53): MediaWiki->run()
#9 /srv/mediawiki/php-1.38.0-wmf.1/index.php(46): wfIndexMain()
#10 /srv/mediawiki/w/index.php(3): require(string)
#11 {main}
Impact
Notes

Cause when someone goes to Special:Contributions/<some IP address>/24. I guess they are looking for contributions from a whole network. The exception should be caught and user error reported.

I am assuming the issue is MobileFrontend since the end of the trace has SpecialMobileContributions

Details

Event Timeline

hashar lowered the priority of this task from Unbreak Now! to Medium.Sep 21 2021, 7:50 PM

Change 722673 had a related patch set uploaded (by Zabe; author: Zabe):

[mediawiki/extensions/MobileFrontend@master] Make sure an IP address is valid

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

Merging to address the fatal, but this also suffers from the same issue described in https://phabricator.wikimedia.org/T241455

Screen Shot 2021-09-21 at 7.05.27 PM.png (446×1 px, 44 KB)

Change 722673 merged by jenkins-bot:

[mediawiki/extensions/MobileFrontend@master] Make sure an IP address is valid

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

Is there a reason not to backport the fix to wmf.1? Otherwise I suggest doing that in the upcoming backport+config window.

Change 724947 had a related patch set uploaded (by Lucas Werkmeister (WMDE); author: Lucas Werkmeister (WMDE)):

[mediawiki/extensions/MobileFrontend@master] Add test for invalid IP address error

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

hi @Jdlrobson - even though https://gerrit.wikimedia.org/r/722673 was merged on 9/21/21, I still see nearly 5k of these errors from the past week. Is it because this needs to be backported still?

hi @Jdlrobson - even though https://gerrit.wikimedia.org/r/722673 was merged on 9/21/21, I still see nearly 5k of these errors from the past week. Is it because this needs to be backported still?

The fix is part of wmf.2, which has not yet been deployed to all wikis.

The fix is part of wmf.2, which has not yet been deployed to all wikis.

gtk - thanks for clarifying

Zabe claimed this task.
Zabe added a subscriber: cjming.

wmf.2 has now been deployed to all wikis and https://en.m.wikipedia.org/wiki/Special:Contributions/101.99.60.0/19 no longer throws fatals. @Jdlrobson can you take a look at the tests by Lucas, thanks.

I'm sorry, only just saw this patch for the backport window. There was no reason why we couldn't have backported this.

I'll take ownership of getting your tests patch merged. I'm a bit behind on my my code review queue.

Change 724947 merged by jenkins-bot:

[mediawiki/extensions/MobileFrontend@master] Add test for invalid IP address error

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