Topic on Project:Support desk

Fatal error: Call to a member function addWikiMsg() on a non-object in /home/username/public_html/wiki/includes/specials/SpecialLinkSearch.php on line 82

28
Ibro (talkcontribs)

Hi

Today I installed media wiki for private use and every thing seems to be OK but when I click on the External links search in special page I get this error

Jeffwang (talkcontribs)
  1. Have you edited it before?
  2. Check any code errors on LocalSettings.php.
Ibro (talkcontribs)

Hi , I did not change any thing in localsettings.php. This is a new installation. please see my localsettings.php here

http://paste.ubuntu.com/805960/

Can't it be because of my server tight security?

Jeffwang (talkcontribs)

Hmm... well it isn't LocalSettings? Are you sure you did not change anything? Sometimes notepad will add BOMs.

Bawolff (talkcontribs)

Note, BOM's cause a different type of error. (headers already sent error)

This type of error would be caused if the relavent OutputPage wasn't being returned properly from the SpecialPage's context. I have no idea how that can happen (and furthermore, no idea how that could happen without many other massive errors popping up everywhere on your wiki) [This is probably a bug in MediaWiki]

Could you test temporarily disabling all extensions (just comment out the require_once lines near the bottom of LocalSettings.php) just to check if its being caused by one of those extensions (seems unlikely, but good to check).

p.s. You may want to change the value of $wgSecretKey and $wgUpgradeKey afterwards since they were left in your LocalSettings.php

Ibro (talkcontribs)

You said " You may want to change the value of $wgSecretKey and $wgUpgradeKey afterwards since they were left in your LocalSettings.php

How to do it? for test I just addes abc at the end of $wgSecretKey and $wgUpgradeKey but got the same error. What can I do now? Amy body can help?

Bawolff (talkcontribs)

I mean you publically posted them. It doesn't really matter what they are, but they should be secret (think of them like a password) or else people can do evil things to your wiki. You should be able to change them directly in your LocalSettings.php

Ibro (talkcontribs)

Bawolff I have not made public my wiki url so what danger is there if $wgSecretKey and $wgUpgradeKey is public?

Bawolff (talkcontribs)

There isn't a whole lot of danger then. Its still not exactly a great idea from a paranoia perspective, but probably not something to worry about if no one knows where your wiki is located.

Jafarda (talkcontribs)

Thanks just curious what if my wiki IS public but it is completely private , Directory password protected and more over it is restricted with an htaccess to an IP address? If still some body knows $wgSecretKey and $wgUpgradeKey can there be any danger?

Bawolff (talkcontribs)

Well first of all, that depends if the people who are allowed access are trustworthy (I suppose that goes without saying). If no one evil can access your wiki, then they can't really do evil things to it.

Leaking $wgUpgradeKey would allow someone to run the installer. Off the top of my head I think that only allows someone to basically update db tables (Which could perhaps open you up to a DOS attack i suppose maybe, not sure if any evil could really be done here. but its definitly not something i'd want randoms to have access).

$wgSecretKey is related to how tokens for user authentication are generated (aka the stuff we stick in cookies to make sure a user stays logged in). If an attacker knows this, it would make it quite a bit easier for them to spoof a cookie, and gain control of another account (Still would be quite a bit of work, just a lot less than wthout $wgSecretKey)

[This is mostly off the top of my head, there's definitely the possibility i missed something here]

114.202.247.100 (talkcontribs)

OK Jeff not sure, Is there any original file I can replace it with what I have? but when I try to add the data base info in there what should I do? what is the right way or editor to make the changes?

Bawolff (talkcontribs)
Ibro (talkcontribs)

I am still having this issue Please some body tell me how to resolve it

Jeffwang (talkcontribs)

Reinstalling?

Ibro (talkcontribs)

Thanks Jeff but I have already filled it with more than 100 entries . Any better suggestion? or an Idea on how to re install without loosing my data?

Jeffwang (talkcontribs)

Backup all your SQL databases, suggestively "export" via PhpMyAdmin.

114.202.247.100 (talkcontribs)

Thanks Jeff so you mean I use SSH to backup my whole database I install a fresh wiki and then restore the datbase?

Jeffwang (talkcontribs)

Yes.

Jafarda (talkcontribs)

Jeff thanks that would be very easy to do takes 30 min or so but what I wonder among all the intelligent guys here there is no body available to tell me what is wrong with this new installed software ? This is scary !

Bawolff (talkcontribs)

Its hard to tell because I can't re-create it on my local install. Possibilities always includes things like somehow one uploading mediawiki you had an older version of a specific php file instead of the version that goes with your version (rare, but does happen)

Is your wiki public? if you provide a url I might be able to tell you more.

Jafarda (talkcontribs)

My wiki is private. Just installed a wiki when installing I chose Private wiki

Choshi (talkcontribs)

I have this same error on my wiki when I click on the Special page for the link search (the search page doesnt load and it gives an error). Its 1.18.0 (correctly updated from previous MW, deleted old files, everything else works). "Fatal error: Call to a member function addWikiMsg() on a non-object in /home/[user] ... /includes/specials/SpecialLinkSearch.php on line 82". I can turn on debugging and stuff to get some more detail messages and post them here. Whats the best way to do that?

Jack Phoenix (talkcontribs)

You don't need to turn on any further debugging to fix that error. If you have SSH (shell) access, connect to the server and use a text editor (such as nano or vim) to edit the file includes/specials/SpecialLinkSearch.php. Find line 82, which looks like this: $out->addWikiMsg( ... and change the $out to $wgOut and that fixes the error.
If you don't have SSH access, use FTP or something to access the server, copy the file into your local computer and make the modification with your favorite non-Microsoft Notepad text editor.

It's a nasty bug that slipped into the 1.18.0 release, and I believe this bug has been fixed in 1.18.1 (although I haven't tested 1.18.1 myself). Sadly this means that every unpatched MediaWiki 1.18.0 will have a broken Special:LinkSearch. :-(

92.41.233.20 (talkcontribs)

I have the same issue, this even happens on a clean install of 1.18.1 (which hows up as version 1.18.0 under Special:version.

Is there a patch for this? I changed the $out to $wgOut and got further issues such as $self->getPrefixedDbKey() does not exist (would need to go through and repeat my changes to find out the exact errors.

Bawolff (talkcontribs)

If it shows up as 1.18.0 in Special:version, then you didn't install 1.18.1. Make sure that all files from your 1.18.0 install are over-written by the 1.18.1 files (Except LocalSettings.php)

This issue should be fixed in 1.18.1 (1.18.1 uses $out, but its supposed to use $out. The issue in 1.18.0 is only half of the $wgOut -> $out change went through, breaking things badly for that special page)

Reply to "Fatal error: Call to a member function addWikiMsg() on a non-object in /home/username/public_html/wiki/includes/specials/SpecialLinkSearch.php on line 82"