Topic on Project:Support desk

[SOLVED] 'Could not create directory "mwstore://local-backend/local-public".' on file upload

9
Spydar007 (talkcontribs)

So I've been having trouble with file uploads on my newly made wiki recently.

Whenever I upload a file, I get the error: Could not create directory "mwstore://local-backend/local-public".

Let me give you some background on the situation.

When I first made the wiki, I would get: Exception from line 1871 of /wiki/includes/filerepo/file/LocalFile.php: Could not acquire lock for 'blah.png'

I searched and eventually found that to fix this you add the following to LocalSettings.php:

$wgFileBackends[] = array(
	'name'        => 'local-backend',
	'class'       => 'FSFileBackend',
	'lockManager' => 'nullLockManager',
	'containerPaths' => array(
		'local-public'  => "{$wgUploadDirectory}",
		'local-thumb'   => "{$wgUploadDirectory}/thumb",
		'local-deleted' => $wgDeletedDirectory,
		'local-temp'    => "{$wgUploadDirectory}/temp",
	),
	'fileMode'    => 0644,
);
 
$wgLocalFileRepo = array (
        'class'             => 'LocalRepo',
        'name'              => 'local',
		'directory'         => $wgUploadDirectory,
        'scriptDirUrl'      => $wgScriptPath,
        'scriptExtension'   => $wgScriptExtension,
        'url'               => $wgUploadBaseUrl ? $wgUploadBaseUrl . $wgUploadPath : $wgUploadPath,
        'hashLevels'        => $wgHashedUploadDirectory ? 2 : 0,
        'thumbScriptUrl'    => $wgThumbnailScriptPath,
        'transformVia404'   => !$wgGenerateThumbnailOnParse,
		'deletedDir'        => $wgDeletedDirectory,
		'deletedHashLevels' => 3,
        'backend'           => 'local-backend',
);

This now produces the error Could not create directory "mwstore://local-backend/local-public".. I have already tried a lot of things found in other posts. I have tried chmodding and chownning the /images directory, but that does not work. What other fixes are there for this?

Spydar007 (talkcontribs)

[dupe post]

Ciencia Al Poder (talkcontribs)

You should comment out those added lines and enable the debug log to see what location in your server is local-backend/local-public, in case you mispelled something in the configuration files, and also see what steps are being performed and when it fails.

Problems are usually permissions, upload directory under a symlink, or SELinux not allowing the creation of some directories.

Spydar007 (talkcontribs)

Doing so gives the following (in a very messed up way in terms of displaying it):

Warning: failed to mkdir "/images/lockdir" mode 0777 [Called from wfMkdirParents in /home/spydar007/wiki/includes/GlobalFunctions.php at line 2582] in /home/spydar007/wiki/includes/debug/MWDebug.php on line 302

Warning: fopen(/images/lockdir/564h27zv7wopab0cnx8ockvv2hi50ds.lock): failed to open stream: No such file or directory in /home/spydar007/wiki/includes/filebackend/lockmanager/FSLockManager.php on line 125

Warning: failed to mkdir "/images/lockdir" mode 0777 [Called from wfMkdirParents in /home/spydar007/wiki/includes/GlobalFunctions.php at line 2582] in /home/spydar007/wiki/includes/debug/MWDebug.php on line 302

Warning: fopen(/images/lockdir/564h27zv7wopab0cnx8ockvv2hi50ds.lock): failed to open stream: No such file or directory in /home/spydar007/wiki/includes/filebackend/lockmanager/FSLockManager.php on line 125

Warning: failed to mkdir "/images/lockdir" mode 0777 [Called from wfMkdirParents in /home/spydar007/wiki/includes/GlobalFunctions.php at line 2582] in /home/spydar007/wiki/includes/debug/MWDebug.php on line 302

Warning: fopen(/images/lockdir/564h27zv7wopab0cnx8ockvv2hi50ds.lock): failed to open stream: No such file or directory in /home/spydar007/wiki/includes/filebackend/lockmanager/FSLockManager.php on line 125

Warning: failed to mkdir "/images/lockdir" mode 0777 [Called from wfMkdirParents in /home/spydar007/wiki/includes/GlobalFunctions.php at line 2582] in /home/spydar007/wiki/includes/debug/MWDebug.php on line 302

Warning: fopen(/images/lockdir/564h27zv7wopab0cnx8ockvv2hi50ds.lock): failed to open stream: No such file or directory in /home/spydar007/wiki/includes/filebackend/lockmanager/FSLockManager.php on line 125

Warning: failed to mkdir "/images/lockdir" mode 0777 [Called from wfMkdirParents in /home/spydar007/wiki/includes/GlobalFunctions.php at line 2582] in /home/spydar007/wiki/includes/debug/MWDebug.php on line 302

Warning: fopen(/images/lockdir/564h27zv7wopab0cnx8ockvv2hi50ds.lock): failed to open stream: No such file or directory in /home/spydar007/wiki/includes/filebackend/lockmanager/FSLockManager.php on line 125

Warning: failed to mkdir "/images/lockdir" mode 0777 [Called from wfMkdirParents in /home/spydar007/wiki/includes/GlobalFunctions.php at line 2582] in /home/spydar007/wiki/includes/debug/MWDebug.php on line 302

Warning: fopen(/images/lockdir/564h27zv7wopab0cnx8ockvv2hi50ds.lock): failed to open stream: No such file or directory in /home/spydar007/wiki/includes/filebackend/lockmanager/FSLockManager.php on line 125

Warning: failed to mkdir "/images/lockdir" mode 0777 [Called from wfMkdirParents in /home/spydar007/wiki/includes/GlobalFunctions.php at line 2582] in /home/spydar007/wiki/includes/debug/MWDebug.php on line 302

Warning: fopen(/images/lockdir/564h27zv7wopab0cnx8ockvv2hi50ds.lock): failed to open stream: No such file or directory in /home/spydar007/wiki/includes/filebackend/lockmanager/FSLockManager.php on line 125

Warning: failed to mkdir "/images/lockdir" mode 0777 [Called from wfMkdirParents in /home/spydar007/wiki/includes/GlobalFunctions.php at line 2582] in /home/spydar007/wiki/includes/debug/MWDebug.php on line 302

Warning: fopen(/images/lockdir/564h27zv7wopab0cnx8ockvv2hi50ds.lock): failed to open stream: No such file or directory in /home/spydar007/wiki/includes/filebackend/lockmanager/FSLockManager.php on line 125

Warning: failed to mkdir "/images/lockdir" mode 0777 [Called from wfMkdirParents in /home/spydar007/wiki/includes/GlobalFunctions.php at line 2582] in /home/spydar007/wiki/includes/debug/MWDebug.php on line 302

Warning: fopen(/images/lockdir/564h27zv7wopab0cnx8ockvv2hi50ds.lock): failed to open stream: No such file or directory in /home/spydar007/wiki/includes/filebackend/lockmanager/FSLockManager.php on line 125

Warning: Cannot modify header information - headers already sent by (output started at /home/spydar007/wiki/includes/debug/MWDebug.php:302) in /home/spydar007/wiki/includes/WebResponse.php on line 37

Warning: Cannot modify header information - headers already sent by (output started at /home/spydar007/wiki/includes/debug/MWDebug.php:302) in /home/spydar007/wiki/includes/WebResponse.php on line 37

Warning: Cannot modify header information - headers already sent by (output started at /home/spydar007/wiki/includes/debug/MWDebug.php:302) in /home/spydar007/wiki/includes/WebResponse.php on line 37

Warning: Cannot modify header information - headers already sent by (output started at /home/spydar007/wiki/includes/debug/MWDebug.php:302) in /home/spydar007/wiki/includes/WebResponse.php on line 37

Internal error
[7954ecee] /wiki/Special:Upload Exception from line 1871 of /home/spydar007/wiki/includes/filerepo/file/LocalFile.php: Could not acquire lock for 'blah.PNG.'

Backtrace:

#0 /home/spydar007/wiki/includes/filerepo/file/LocalFile.php(1174): LocalFile->lock()
#1 /home/spydar007/wiki/includes/upload/UploadBase.php(738): LocalFile->upload(string, string, string, integer, array, boolean, User)
#2 /home/spydar007/wiki/includes/specials/SpecialUpload.php(467): UploadBase->performUpload(string, string, boolean, User)
#3 /home/spydar007/wiki/includes/specials/SpecialUpload.php(186): SpecialUpload->processUpload()
#4 /home/spydar007/wiki/includes/specialpage/SpecialPage.php(363): SpecialUpload->execute(NULL)
#5 /home/spydar007/wiki/includes/specialpage/SpecialPageFactory.php(584): SpecialPage->run(NULL)
#6 /home/spydar007/wiki/includes/MediaWiki.php(275): SpecialPageFactory::executePath(Title, RequestContext)
#7 /home/spydar007/wiki/includes/MediaWiki.php(584): MediaWiki->performRequest()
#8 /home/spydar007/wiki/includes/MediaWiki.php(435): MediaWiki->main()
#9 /home/spydar007/wiki/index.php(46): MediaWiki->run()
#10 {main}

Warning: Cannot modify header information - headers already sent by (output started at /home/spydar007/wiki/includes/debug/MWDebug.php:302) in /home/spydar007/wiki/includes/WebResponse.php on line 37

Warning: Cannot modify header information - headers already sent by (output started at /home/spydar007/wiki/includes/debug/MWDebug.php:302) in /home/spydar007/wiki/includes/WebResponse.php on line 37

Warning: Cannot modify header information - headers already sent by (output started at /home/spydar007/wiki/includes/debug/MWDebug.php:302) in /home/spydar007/wiki/includes/WebResponse.php on line 37

Warning: Cannot modify header information - headers already sent by (output started at /home/spydar007/wiki/includes/debug/MWDebug.php:302) in /home/spydar007/wiki/includes/WebResponse.php on line 37
88.130.96.10 (talkcontribs)

Basically it seems like there is only one error to be solved, that is this one:

Warning: failed to mkdir "/images/lockdir" mode 0777 [Called from wfMkdirParents in /home/spydar007/wiki/includes/GlobalFunctions.php at line 2582]

The other errors are only consequences of this one.

Can you investigate, why it is not possible to create the folder /images/lockdir? Does the webserver not have permission to write into the images/ folder?

Spydar007 (talkcontribs)

As I already said, I have tried chownning and chmodding /images to various users and permissions. I have tried again, and this still doesn't work. I also tried manually making lockdir, but the same error is produced.

Ciencia Al Poder (talkcontribs)

I'd say your $wgUploadDirectory is wrong. Shouldn't it be /home/spydar007/wiki/images instead of /images?

Spydar007 (talkcontribs)

YES. IT WORKS.

Thanks so much, I hadn't thought of that.

D
Spydar007 (talkcontribs)
Reply to "[SOLVED] 'Could not create directory "mwstore://local-backend/local-public".' on file upload"