Topic on Project:Support desk

Cannot upload Image

9
Vprashant1 (talkcontribs)

I've installed Mediawiki v1.24.1 on my server which is running RHEL7. I've installed it under /var/www/foohelp/wiki. However, when I try to upload a file, I get the following error:

[f3eae72a] /foohelp/wiki/index.php/Special:Upload Exception from line 1871 of /var/www/foohelp/mediawiki-1.24.1/includes/filerepo/file/LocalFile.php: Could not acquire lock for 'User-default.png.' Backtrace:

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

If I edit /includes/filebackend/FileBackendGroup.php and modify LockManager to

'lockManager' => 'fsLockManager', and modify permissions as follows:

chown -R apache:apache images/ chown -R 755 images/ I get the following error:

(Could not create directory "mwstore://local-backend/local-public) Any help would be appreciated.

Temptuousinsolence (talkcontribs)

755 might not be enough. Either you use 777 or set up a special enviroment with ACL instead of UID and GID. We had the same problem yesterday and solved it with a set of ACLs for our system. We are not yet satisfied with the outcome but the system appears to be running as it should.

Personally, I would recommend ACL, because it is better able to handle the various rights issues.

Vprashant1 (talkcontribs)

That's true. But I'd like to set up this wiki such that any user can access it, but certain users across the globe can edit it if they are editors without necessarily giving them access to the server and setting up permissions. (I am a little new to this, so I apologize if I did not follow your point correctly. An example or a link would really help).

Temptuousinsolence (talkcontribs)

You misunderstood it. In order to setup the Wiki secure and sound you can either use the normal UID and GID settings or this: https://doc.opensuse.org/documentation/html/openSUSE_121/opensuse-security/cha.security.acls.html

This has nothing to do with what you have pointed towards. A normal user does not have any access on the server, but deals with the Wiki and the content thereon. Yet, in order to handle the aspect of a save server, the settings, especially when there are more than one user, needs to be dealt with carefully.

To give the apache access to the images folder has its downsites as does a 777 on the folder. Especially when there are more than one user on a server. That is where the ACLs come into play.

But as you are new to this "universe", you may want to start with a 777 on the images folder and set up stricter restrictions over time, with more experience and a better understanding on how things are and how things work.

Vprashant1 (talkcontribs)

I tried 777 on the images folder. I get the same error.

Ciencia Al Poder (talkcontribs)

Try disabling SELinux to see if SELinux is the problem. If this solves the problem, either keep SELinux disabled or configure it properly.

Also, you could also setup a debug log to see exactly what physical directory is trying to create (instead of a nonsensical mwstore://local-backend/local-public) to check if this is the expected location of your images folder or you mistyped something.

87.229.231.234 (talkcontribs)

deleting SE does not solve problem too ... Full permissions is set on wiki base dir. I have not found solution of this problem. Everything is ok on Windows.

Woiow (talkcontribs)

I also can not upload images?!?!

Would this also explain some of the broken 'existing' image links do not work and now can't find the images?

Error creating thumbnail: Unable to save thumbnail to destination Error creating thumbnail: Unable to save thumbnail to destination

Ciencia Al Poder (talkcontribs)

Yes, that would explain it. Check what has been said already on this thread.

Reply to "Cannot upload Image"