Topic on Project:Support desk

[RESOLVED] Problem uploading files: Could not create directory "mwstore://local-backend/local-public/5/54".

25
Summary by TiltedCerebellum

7 year old thread

192.12.119.2 (talkcontribs)

Hello, I upgraded our wiki from 1.16 to 1.21.0rc5. I can no longer upload files. I get the error: Could not create directory "mwstore://local-backend/local-public/5/54".

I also get

Internal errors:
Error storing file in '/tmp/php2k23Xw': Could not create directory "mwstore://local-backend/local-temp/c/ca".

Backtrace:

#0 /var/www/html/wiki/includes/upload/UploadBase.php(836): UploadStash->stashFile('/tmp/php2k23Xw', 'file')
#1 /var/www/html/wiki/includes/upload/UploadBase.php(849): UploadBase->stashFile()
#2 /var/www/html/wiki/includes/upload/UploadBase.php(858): UploadBase->stashFileGetKey()
#3 /var/www/html/wiki/includes/specials/SpecialUpload.php(332): UploadBase->stashSession()
#4 /var/www/html/wiki/includes/specials/SpecialUpload.php(425): SpecialUpload->showUploadWarning(Array)
#5 /var/www/html/wiki/includes/specials/SpecialUpload.php(172): SpecialUpload->processUpload()
#6 /var/www/html/wiki/includes/SpecialPage.php(613): SpecialUpload->execute(NULL)
#7 /var/www/html/wiki/includes/SpecialPageFactory.php(487): SpecialPage->run(NULL)
#8 /var/www/html/wiki/includes/Wiki.php(291): SpecialPageFactory::executePath(Object(Title), Object(RequestContext))
#9 /var/www/html/wiki/includes/Wiki.php(565): MediaWiki->performRequest()
#10 /var/www/html/wiki/includes/Wiki.php(458): MediaWiki->main()
#11 /var/www/html/wiki/index.php(59): MediaWiki->run()
#12 {main}

I have tried changing ownership and permissions on all files and sub-directories and I just cannot figure out what I am doing wrong. any help would be most appreciated. Below is my installed software.

  • Installed software
    • Product Version
    • MediaWiki 1.21.0rc5
    • PHP 5.3.8 (apache2handler)
    • MySQL 5.1.60
  • Entry point URLs
    • Entry point URL
    • Article path /wiki/index.php/$1
    • Script path /wiki
    • index.php /wiki/index.php
    • api.php /wiki/api.php
    • load.php /wiki/load.php
MarkAHershberger (talkcontribs)

The second error is especially interesting. Are you using shared hosting? What are the permissions on your images directory? What are the permissions on /tmp?

192.12.119.2 (talkcontribs)

Hello, I am not using shared hosting. Root owns both /tmp and /var/www/html/wiki/ (and all its subdirectories including images). The permissions are 777 across the board. Thanks.

MarkAHershberger (talkcontribs)

also, saw that you aren't using the latest mw... can you d/l the latest and try again?

192.12.119.2 (talkcontribs)

I will give it a try.

192.12.119.2 (talkcontribs)

Mark, I upgraded to the latest MW(see info below), and although I no longer get the Internal error with a backtrace, I still get: Could not create directory "mwstore://local-backend/local-public/5/54".

For the life of me, I just can't figure this one out.

Installed software Product Version MediaWiki 1.21.1 PHP 5.3.8 (apache2handler) MySQL 5.1.60 Entry point URLs Entry point URL Article path /mediawiki-1.21.1/index.php/$1 Script path /mediawiki-1.21.1 index.php /mediawiki-1.21.1/index.php api.php /mediawiki-1.21.1/api.php load.php /mediawiki-1.21.1/load.php

Any ideas for me? Thanks, Phil

Ektip (talkcontribs)

Hvaing the same issue. Looking for solution...

Ektip (talkcontribs)

do this:

sudo chmod -R 777 /var/www/yourwiki.com/images
80.240.226.13 (talkcontribs)

I fixed it with

sudo chmod -R 774 /var/www/yourwiki.com/images

7 - user 7 - group 4 - others - read only was enough

Keramik (talkcontribs)

I still got problem while uploading files. Error message is: Could not create directory "mwstore://local-backend/local-public/f/fd".

Permissions are set 777 to whole wiki directory and subdirectories, php.ini is configured to allow uploads, LocalSettings.php also allows file uploads. While page was on localhost I had no problems with uploads.

Also no thumbnails for earlier added photos are shown. Message is Error creating thumbnail: File seems to be missing. But file is shown correctly when I use no "thumb" settings for image, for example, by default is:

File:Vispinf.png|right|thumb|120 px|Vispārēja informācija <--not shown

File:Vispinf.png|right|Vispārēja informācija <--shown correctly

MediaWiki version 1.21.2. Also installed extension for image pop up to original size from preview.

Keramik (talkcontribs)

Any ideas why it is so?

Ciencia Al Poder (talkcontribs)

If you have enabled the PHP directive open_basedir it must include both the destination upload folder in your MediaWiki installation ("{$IP}/images") and the 'upload_tmp_dir' folder (default system folder if not set).

195.234.144.4 (talkcontribs)

It's not enabeled.

195.234.144.4 (talkcontribs)

Maybe it happends because I'm hosting mine web page on Virtualhost?

Ciencia Al Poder (talkcontribs)

195.234.144.4‎, are you Keramik? If not, please open a new thread since we don't know what solutions described here have you tested so far.

And no, Virtual Host can't cause any problems.

Keramik (talkcontribs)

Yes, it was mine post about VirtualHost. I'll ask tech guys to check access rights on FTP, because I can't see no other reason, why it is impossible to create thumbnails and upload images on my wiki.

By the way, maybe it is good idea to update wiki?

Ciencia Al Poder (talkcontribs)

You should upgrade to the latest 1.21 release to be protected against security/stability bugs that have been fixed, but that probably wouldn't make uploads work.

You should try Setting up a debug log file to see the full path it's trying to access and see if they are really present in the filesystem and writable. Set it up, upload a file or edit a page changing the size of a thumb, and disable the log again, since it degrades performance.

Keramik (talkcontribs)

I've got 1.12.2 already, thanks for advice. I'll try to set up log file.

Keramik (talkcontribs)

I made mistake in previous post. I've got 1.21.2 version :)

175.209.166.190 (talkcontribs)

Hello~ I'm not good at english. But I had alike problem, such as "Could not create directory "mwstore://local-backend/local-public/....... ", and also have solved by myself. If you are able, do it. :)

First of all, I checked my "chown" in mediawiki/images, and found that owner+group was wrong. Mainly, php engine is using mediawiki as group name - "www-data".

So, I changed like this. "mediawiki> sudo chown -R ubuntu:www-data images". And perfectly, problem has solved.

Good luck to you. :)

114.34.79.165 (talkcontribs)

agreed, simply a permissions issue.

browse to your mediawiki folder (i.e /var/www/mediawiki) sudo chown -R www-data images/

done

Roberto ge83 (talkcontribs)

I had the same issue with 1.35 once upgrade was done

Now with permissions set to 774 that worked.


Thanks.

Katkov Yury (talkcontribs)

I think the following will be useful for that type of error.

If you use Vagrant and your directory is a Shared Folder then Vagrant will reset the access rights every time you try to change it. In this case you have to use mount_optons in your Vagrantfile:

config.vm.synced_folder "../www", "/var/www/html", mount_options: ["dmode=777", "fmode=777"]

this way your www directory will have 777 rights and the web server will be able to write to it. See also related stackoverflow question.

Hypergrove (talkcontribs)
Hypergrove (talkcontribs)