Topic on Project:Support desk

[RESOLVED] Unable to Determine IP (IPv6)

13
Megamandos (talkcontribs)

Ok so I have this setup for hosting this wiki at home and am having trouble with it. It seems to install just find but after i move the LocalSettings.php file to the root it starts giving me an error when i try to access the web site.

Object Moved

This document may be found hereMediaWiki internal error.

Original exception: exception 'MWException' with message 'Unable to determine IP' in C:\inetpub\wwwroot\wiki\includes\ProxyTools.php:115
Stack trace:
#0 C:\inetpub\wwwroot\wiki\includes\User.php(1531): wfGetIP()
#1 C:\inetpub\wwwroot\wiki\includes\db\Database.php(478): User->getName()
#2 C:\inetpub\wwwroot\wiki\includes\db\Database.php(874): DatabaseBase->query('SELECT * FROM...', 'Job::pop')
#3 C:\inetpub\wwwroot\wiki\includes\db\Database.php(954): DatabaseBase->select('job', '*', 'job_id >= 0', 'Job::pop', Array, Array)
#4 C:\inetpub\wwwroot\wiki\includes\JobQueue.php(107): DatabaseBase->selectRow('job', '*', 'job_id >= 0', 'Job::pop', Array)
#5 C:\inetpub\wwwroot\wiki\includes\Wiki.php(430): Job::pop()
#6 C:\inetpub\wwwroot\wiki\includes\Wiki.php(379): MediaWiki->doJobs()
#7 C:\inetpub\wwwroot\wiki\index.php(118): MediaWiki->finalCleanup(Array, Object(OutputPage))
#8 {main}  

Exception caught inside exception handler: exception 'MWException' with message 'Unable to determine IP' in C:\inetpub\wwwroot\wiki\includes\ProxyTools.php:115
Stack trace:
#0 C:\inetpub\wwwroot\wiki\includes\User.php(1531): wfGetIP()
#1 C:\inetpub\wwwroot\wiki\includes\db\Database.php(478): User->getName()
#2 C:\inetpub\wwwroot\wiki\includes\db\Database.php(874): DatabaseBase->query('SELECT lc_valu...', 'LCStore_DB::get')
#3 C:\inetpub\wwwroot\wiki\includes\db\Database.php(954): DatabaseBase->select('l10n_cache', Array, Array, 'LCStore_DB::get', Array, Array)
#4 C:\inetpub\wwwroot\wiki\includes\LocalisationCache.php(763): DatabaseBase->selectRow('l10n_cache', Array, Array, 'LCStore_DB::get')
#5 C:\inetpub\wwwroot\wiki\includes\LocalisationCache.php(307): LCStore_DB->get('en', 'messages:intern...')
#6 C:\inetpub\wwwroot\wiki\includes\LocalisationCache.php(225): LocalisationCache->loadSubitem('en', 'messages', 'internalerror')
#7 C:\inetpub\wwwroot\wiki\languages\Language.php(1480): LocalisationCache->getSubitem('en', 'messages', 'internalerror')
#8 C:\inetpub\wwwroot\wiki\includes\MessageCache.php(532): Language->getMessage('internalerror')
#9 C:\inetpub\wwwroot\wiki\includes\GlobalFunctions.php(742): MessageCache->get('internalerror', true, false)
#10 C:\inetpub\wwwroot\wiki\includes\GlobalFunctions.php(707): wfMsgGetKey('internalerror', true, false, true)
#11 C:\inetpub\wwwroot\wiki\includes\GlobalFunctions.php(613): wfMsgReal('internalerror', Array, true)
#12 C:\inetpub\wwwroot\wiki\includes\Exception.php(119): wfMsg('internalerror')
#13 C:\inetpub\wwwroot\wiki\includes\Exception.php(209): MWException->getPageTitle()
#14 C:\inetpub\wwwroot\wiki\includes\Exception.php(172): MWException->htmlHeader()
#15 C:\inetpub\wwwroot\wiki\includes\Exception.php(191): MWException->reportHTML()
#16 C:\inetpub\wwwroot\wiki\includes\Exception.php(289): MWException->report()
#17 C:\inetpub\wwwroot\wiki\includes\Exception.php(348): wfReportException(Object(MWException))
#18 [internal function]: wfExceptionHandler(Object(MWException))
#19 {main} 


When i click the link "here" it takes me to "/index.php?title=Main_Page" which then gives me this error:

PQEWiki error

Unable to determine IP   

Backtrace:

#0 C:\inetpub\wwwroot\wiki\includes\User.php(1531): wfGetIP()
#1 C:\inetpub\wwwroot\wiki\includes\db\Database.php(478): User->getName()
#2 C:\inetpub\wwwroot\wiki\includes\db\Database.php(874): DatabaseBase->query('SELECT lc_valu...', 'LCStore_DB::get')
#3 C:\inetpub\wwwroot\wiki\includes\db\Database.php(954): DatabaseBase->select('l10n_cache', Array, Array, 'LCStore_DB::get', Array, Array)
#4 C:\inetpub\wwwroot\wiki\includes\LocalisationCache.php(763): DatabaseBase->selectRow('l10n_cache', Array, Array, 'LCStore_DB::get')
#5 C:\inetpub\wwwroot\wiki\includes\LocalisationCache.php(321): LCStore_DB->get('en', 'deps')
#6 C:\inetpub\wwwroot\wiki\includes\LocalisationCache.php(350): LocalisationCache->isExpired('en')
#7 C:\inetpub\wwwroot\wiki\includes\LocalisationCache.php(262): LocalisationCache->initLanguage('en')
#8 C:\inetpub\wwwroot\wiki\includes\LocalisationCache.php(205): LocalisationCache->loadItem('en', 'defaultUserOpti...')
#9 C:\inetpub\wwwroot\wiki\languages\Language.php(458): LocalisationCache->getItem('en', 'defaultUserOpti...')
#10 C:\inetpub\wwwroot\wiki\includes\User.php(1052): Language->getDefaultUserOptionOverrides()
#11 C:\inetpub\wwwroot\wiki\includes\User.php(1974): User::getDefaultOptions()
#12 [internal function]: User->getOption('numberheadings')
#13 C:\inetpub\wwwroot\wiki\includes\StubObject.php(58): call_user_func_array(Array, Array)
#14 C:\inetpub\wwwroot\wiki\includes\StubObject.php(182): StubObject->_call('getOption', Array)
#15 C:\inetpub\wwwroot\wiki\includes\parser\ParserOptions.php(150): StubUser->__call('getOption', Array)
#16 C:\inetpub\wwwroot\wiki\includes\parser\ParserOptions.php(150): StubUser->getOption('numberheadings')
#17 C:\inetpub\wwwroot\wiki\includes\parser\ParserOptions.php(109): ParserOptions->initialiseFromUser(Object(StubUser))
#18 C:\inetpub\wwwroot\wiki\includes\Article.php(4054): ParserOptions->__construct(Object(StubUser))
#19 C:\inetpub\wwwroot\wiki\includes\Article.php(745): Article->getParserOptions()
#20 C:\inetpub\wwwroot\wiki\includes\Wiki.php(493): Article->view()
#21 C:\inetpub\wwwroot\wiki\includes\Wiki.php(70): MediaWiki->performAction(Object(OutputPage), Object(Article), Object(Title), Object(User), Object(WebRequest))
#22 C:\inetpub\wwwroot\wiki\index.php(117): MediaWiki->performRequestForTitle(Object(Title), Object(Article), Object(OutputPage), Object(User), Object(WebRequest))
#23 {main}

I tracked it down to "/includes/ProxyTools.php" line #114

if( !$ip ) {
	throw new MWException( "Unable to determine IP" );
}

If i comment that out it seems to work, but then i get another error when i try to log in

MediaWiki internal error.

Original exception: exception 'MWException' with message 'SkinTemplate::makeTalkUrlDetails given invalid pagename User:' in C:\inetpub\wwwroot\wiki\includes\SkinTemplate.php:682
Stack trace:
#0 C:\inetpub\wwwroot\wiki\includes\SkinTemplate.php(623): SkinTemplate->makeTalkUrlDetails('User:')
#1 C:\inetpub\wwwroot\wiki\includes\SkinTemplate.php(489): SkinTemplate->buildPersonalUrls()
#2 C:\inetpub\wwwroot\wiki\includes\OutputPage.php(1615): SkinTemplate->outputPage(Object(OutputPage))
#3 C:\inetpub\wwwroot\wiki\includes\Wiki.php(376): OutputPage->output()
#4 C:\inetpub\wwwroot\wiki\index.php(118): MediaWiki->finalCleanup(Array, Object(OutputPage))
#5 {main} 

Exception caught inside exception handler: exception 'MWException' with message 'SkinTemplate::makeTalkUrlDetails given invalid pagename User:' in C:\inetpub\wwwroot\wiki\includes\SkinTemplate.php:682
Stack trace:
#0 C:\inetpub\wwwroot\wiki\includes\SkinTemplate.php(623): SkinTemplate->makeTalkUrlDetails('User:')
#1 C:\inetpub\wwwroot\wiki\includes\SkinTemplate.php(489): SkinTemplate->buildPersonalUrls()
#2 C:\inetpub\wwwroot\wiki\includes\OutputPage.php(1615): SkinTemplate->outputPage(Object(OutputPage))
#3 C:\inetpub\wwwroot\wiki\includes\Exception.php(164): OutputPage->output()
#4 C:\inetpub\wwwroot\wiki\includes\Exception.php(191): MWException->reportHTML()
#5 C:\inetpub\wwwroot\wiki\includes\Exception.php(289): MWException->report()
#6 C:\inetpub\wwwroot\wiki\includes\Exception.php(348): wfReportException(Object(MWException))
#7 [internal function]: wfExceptionHandler(Object(MWException))
#8 {main}

I have tried searching for about an hour now for a solution to the first error with no luck, the second error seems to be related to a cookie it put on the client, which it uses to track login sessions, although I have found no actual solution to either problem thus far. Can someone here help?

Megamandos (talkcontribs)

Oh also, this might help. My network topology might be causing the proxy issue, although I cannot change it for technical and security reasons.

<Internet> ----- <Router with static IP> --(192.168.1.0/24)-- <Router to Private network> --(10.0.0.0/24)-- <Server>

You will have to trust me that the port forwarding is done correctly, because the rest of the site works fine, including a wordpress front page and phpBB forums.

MaxSem (talkcontribs)

What is your $_SERVER['REMOTE_ADDR'] and other IP-related stuff? Can you dump its contents from visiting a .php file containing <?php phpinfo(); in browser?

72.81.131.11 (talkcontribs)

Its an IPv6 private address.

fe80::e4d2:7ee6:6aa:ce9d%11
72.81.131.11 (talkcontribs)
_SERVER["REMOTE_ADDR"]	fe80::e4d2:7ee6:6aa:ce9d%11
_SERVER["REMOTE_HOST"]	fe80::e4d2:7ee6:6aa:ce9d%11
_SERVER["REMOTE_PORT"]	52243
_SERVER["REMOTE_USER"]	no value
Mread5 (talkcontribs)

if you aren't using ipv6 on that machine, you can just disable it and it works fine. That's all I did for my wiki running on win 2008. I doubt you are using ipv6, since that is just a link-local (non routable) address. Just remove it from the properties of the network connection.

I think mediawiki is expecting the address in ipv4 format only

MaxSem (talkcontribs)

Yes, pre-1.17 versions have problems with IPv6.

207.67.108.200 (talkcontribs)

I encountered a similar error in v1.18.2 While support for IPv6 was added, support for the zone was not, I simply trimmed the zone information off as follows: line 659+ in /includes/IP.php:

public static function canonicalize( $addr ) {

   $addr = preg_replace('/\%.*/i',,$addr); #line I added to remove zone info

if ( self::isValid( $addr ) ) { return $addr; }

Nick Kuznia

Jasper Deng (talkcontribs)

Yeah, but I don't see why your webserver should even listen on link-local IPv6 addresses in the first place.

207.67.108.200 (talkcontribs)

It's not your average setup, and no I'm not willing to go into more detail. But I thought I would provide the solution nonetheless as others may be experiencing the same issue.

212.86.204.221 (talkcontribs)

Nick,

your patch saved my day! I just needed to add the missing single quotes

$addr = preg_replace('/\%.*/i','',$addr);

It works fine with 1.19 as well.

/Niklas

Reply to "[RESOLVED] Unable to Determine IP (IPv6)"