Page MenuHomePhabricator

Can't link to files and upload - "Fatal exception of type MWException"
Closed, InvalidPublic

Description

[2ae57982] 2012-12-27 20:21:30: Fatal exception of type MWException

Anytime I

  • try to upload a file OR
  • try to link to a not existing file (there are no files in my wiki)

it says this error. Everytime with another hex-number in square brackets, time, date. This is on http://blechschaden.bplaced.net

I have another Wiki there wich is on 1.18.0 and it runs fine. I don't have root access.


Version: 1.20.x
Severity: normal

Details

Reference
bz43469

Event Timeline

bzimport raised the priority of this task from to Needs Triage.Nov 22 2014, 1:10 AM
bzimport set Reference to bz43469.
bzimport added a subscriber: Unknown Object (MLST).

Not sure if this will help (at least to identify the problem): can you change the language of the wiki to English and see if it still happens? Sometimes this error message has appeared in relation of non-English characters found in some translated string.

Usuall file upload works in MediaWiki 1.20.2. Changing severity to normal.

Can you look up that error in your error log? (somewhere like /var/log/apache2/error.log)
Alternatively set "$wgShowExceptionDetails = true"; in your LocalSettings.php and then try to trigger it again.

[offtopic] /me thinks the default error message should have instructions to enable $wgShowExceptionDetails to see details (and not just in an html comment). Didn't that use to be the case?


Do you have instant commons enabled? The error from your website is as follows:

Exception Caught: MWHttpRequest:🏭 allow_url_fopen needs to be enabled for pure PHP http requests to work. If possible, curl should be used instead. See http://php.net/curl.

This is most likely because you checked use images from commons during the install process (or set $wgUseInstantCommons to true). Thus when you include an image, MW tries to check if wikimedia commons has a file. However to do that it has to contact commons. It tries to use CURL or php's fopen to do so. But curl is not installed, and allow_url_fopen is disabled in your php.ini. Hence the error.

Solution: Best solution - try to convince your web host to install the curl php extension. Second best, convince him/her to set allow_url_fopen to true in php.ini. Both of these usually require root access.

If you cannot convince them to do that, go into your LocalSettings.php and look for a line $wgUseInstantCommons = true; . Change the true to false. (Can also be $wgForeignFileRepos ). This will stop it from trying to use commons for image files, and hence make your wiki work. There will be some reduced features if HTTP access isn't available to your wiki, but 95% of the features do not require the wiki to do HTTP requests, so you'll mostly be fine.

Sometimes this
error message has appeared in relation of non-English characters found in some
translated string.

Fatal exception of type MWException is a very generic error message. It can appear for almost anything.


Closing bug as invalid, since its not really a MediaWiki bug but a configuration problem. If my above advice doesn't apply, please don't hesitate to re-open the bug.

Gilles triaged this task as Unbreak Now! priority.Dec 4 2014, 10:11 AM
Gilles moved this task from Untriaged to Done on the Multimedia board.
Gilles lowered the priority of this task from Unbreak Now! to Needs Triage.Dec 4 2014, 11:23 AM