Good morning. I seem to be having some issues. I get the following when trying to upload a file: Internal Error [3a9c03ba] 2015-02-15 15:37:53: Fatal exception of type MWException
Any help would be appreciated.
If file permissions in folders are not the problem, check out if SELinux is blocking apache from creating the file
Good morning. I seem to be having some issues. I get the following when trying to upload a file: Internal Error [3a9c03ba] 2015-02-15 15:37:53: Fatal exception of type MWException
Any help would be appreciated.
Please add $wgShowExceptionDetails = true;
to your LocalSettings.php to see the ful error message and a stack trace. This error message and stack trace you should post here :)
I just got that enabled: [94bbdfd6] /index.php/Special:Upload Exception from line 1871 of /var/www/html/includes/filerepo/file/LocalFile.php: Could not acquire lock for 'Doink.png.'
Backtrace:
See Thread:Project:Support desk/Problem With File Upload: Could not acquire lock for "mwstore://local-backend/local-public/1/1e". if that helps
This is happening to me also on a fresh install on Centos 7 (3.10.0-123.el7.x86_64)
MediaWiki 1.24.1 PHP 5.4.37 (apache2handler) MySQL 5.6.23
I set these debug options in LocalSettings.php:
# DEBUG error_reporting( -1 ); ini_set( 'display_errors', 1 ); $wgShowSQLErrors = true; $wgDebugDumpSql = true; $wgShowExceptionDetails = true; $wgShowDBErrorBacktrace = true;
Backtrace:
#0 /var/www/html/mediawiki-1.24.1/includes/filerepo/file/LocalFile.php(1174): LocalFile->lock() #1 /var/www/html/mediawiki-1.24.1/includes/upload/UploadBase.php(738): LocalFile->upload(string, string, string, integer, array, boolean, User) #2 /var/www/html/mediawiki-1.24.1/includes/specials/SpecialUpload.php(467): UploadBase->performUpload(string, string, boolean, User) #3 /var/www/html/mediawiki-1.24.1/includes/specials/SpecialUpload.php(186): SpecialUpload->processUpload() #4 /var/www/html/mediawiki-1.24.1/includes/specialpage/SpecialPage.php(363): SpecialUpload->execute(NULL) #5 /var/www/html/mediawiki-1.24.1/includes/specialpage/SpecialPageFactory.php(584): SpecialPage->run(NULL) #6 /var/www/html/mediawiki-1.24.1/includes/MediaWiki.php(275): SpecialPageFactory::executePath(Title, RequestContext) #7 /var/www/html/mediawiki-1.24.1/includes/MediaWiki.php(584): MediaWiki->performRequest() #8 /var/www/html/mediawiki-1.24.1/includes/MediaWiki.php(435): MediaWiki->main() #9 /var/www/html/mediawiki-1.24.1/index.php(46): MediaWiki->run() #10 {main}
Also, this error appears on-screen after the failed upload (with the above debugging options on):
Warning: fopen(/var/www/html/mediawiki-1.24.1/images/lockdir/dmzfox3ljn7ipsdr0zlw44nwle1qlbp.lock): failed to open stream: No such file or directory in /var/www/html/mediawiki-1.24.1/includes/filebackend/lockmanager/FSLockManager.php on line 125 Warning: failed to mkdir "/var/www/html/mediawiki-1.24.1/images/lockdir" mode 0777 [Called from wfMkdirParents in /var/www/html/mediawiki-1.24.1/includes/GlobalFunctions.php at line 2582] in /var/www/html/mediawiki-1.24.1/includes/debug/MWDebug.php on line 302
If you set a debug.log up, this seems to be the relevant tidbit:
[warning] failed to mkdir "/var/www/html/mediawiki-1.24.1/images/lockdir" mode 0777 [Called from wfMkdirParents in /var/www/html/mediawiki-1.24.1/includes/GlobalFunctions.php at line 2582] [warning] failed to mkdir "/var/www/html/mediawiki-1.24.1/images/lockdir" mode 0777 [Called from wfMkdirParents in /var/www/html/mediawiki-1.24.1/includes/GlobalFunctions.php at line 2582] [warning] failed to mkdir "/var/www/html/mediawiki-1.24.1/images/lockdir" mode 0777 [Called from wfMkdirParents in /var/www/html/mediawiki-1.24.1/includes/GlobalFunctions.php at line 2582] [warning] failed to mkdir "/var/www/html/mediawiki-1.24.1/images/lockdir" mode 0777 [Called from wfMkdirParents in /var/www/html/mediawiki-1.24.1/includes/GlobalFunctions.php at line 2582] [warning] failed to mkdir "/var/www/html/mediawiki-1.24.1/images/lockdir" mode 0777 [Called from wfMkdirParents in /var/www/html/mediawiki-1.24.1/includes/GlobalFunctions.php at line 2582] [warning] failed to mkdir "/var/www/html/mediawiki-1.24.1/images/lockdir" mode 0777 [Called from wfMkdirParents in /var/www/html/mediawiki-1.24.1/includes/GlobalFunctions.php at line 2582] [warning] failed to mkdir "/var/www/html/mediawiki-1.24.1/images/lockdir" mode 0777 [Called from wfMkdirParents in /var/www/html/mediawiki-1.24.1/includes/GlobalFunctions.php at line 2582] [warning] failed to mkdir "/var/www/html/mediawiki-1.24.1/images/lockdir" mode 0777 [Called from wfMkdirParents in /var/www/html/mediawiki-1.24.1/includes/GlobalFunctions.php at line 2582] [warning] failed to mkdir "/var/www/html/mediawiki-1.24.1/images/lockdir" mode 0777 [Called from wfMkdirParents in /var/www/html/mediawiki-1.24.1/includes/GlobalFunctions.php at line 2582] [exception] [2c79a15b] /index.php/Special:Upload Exception from line 1871 of /var/www/html/mediawiki-1.24.1/includes/filerepo/file/LocalFile.php: Could not acquire lock for 'Images_(18).jpg.'
So, I think it's a permissions thing in general and maybe an SELinux thing in particular? But I can't figure it out. I've set the images dir chmod -R 777. Any idea what's up here?
If you think it's a SELinux problem, try disabling it and see if upload works.
So, here is what finally fixed it for me:
sudo mkdir /var/www/html/mediawiki-1.24.1/images/temp chmod -R 777 /var/www/html/mediawiki-1.24.1/images sudo setsebool -P httpd_unified 1
The last command was suggested by the log dumped to screen when you run
audit2allow -a -w
So I guess it's SELinux. I will try to see if it stick after a reboot. I hope this helps somebody.
This also worked for me. I was convince the problem was related to the $wgScriptPath.
Thanks for the tip.