OJS OCS OMP OHS

You are viewing the PKP Support Forum | PKP Home Wiki



Files don't always upload

Are you responsible for making OJS work -- installing, upgrading, migrating or troubleshooting? Do you think you've found a bug? Post in this forum.

Moderators: jmacgreg, btbell, michael, bdgregg, barbarah, asmecher

Forum rules
What to do if you have a technical problem with OJS:

1. Search the forum. You can do this from the Advanced Search Page or from our Google Custom Search, which will search the entire PKP site. If you are encountering an error, we especially recommend searching the forum for said error.

2. Check the FAQ to see if your question or error has already been resolved.

3. Post a question, but please, only after trying the above two solutions. If it's a workflow or usability question you should probably post to the OJS Editorial Support and Discussion subforum; if you have a development question, try the OJS Development subforum.

Files don't always upload

Postby elavaud » Mon Oct 28, 2013 1:43 am

Hi there,

For the first time after a year of use of multiple OJS, I am requesting your help.

I am running OJS 2.3.6 on Ubuntu 12.10.

A problem I noticed before but which is now urgent for me to solve: files don't always upload (submission file, supplementary files...).
This happen quite rarely, but enough to give us a lot of troubles. I just got reprimanded by my supervisor and need to find a solution as soon as possible :D

I am pretty good on the development side but not really in server administration. I have of course been looking to various topics on the PKP forums but couldn't get an answer.

I however manage to get the error log of 1 (one) file upload which failed:


WARNING: move_uploaded_file(/var/upfiles/journals/articles/111/supp/2013.27.NIOPH.27.VIE.SupplementaryFile.1.Oct282013-11:26am.pdf): failed to open stream: Permission denied
In file: /var/www/laohrp/lib/pkp/classes/file/FileManager.inc.php
At line:112

WARNING: move_uploaded_file(): Unable to move '/tmp/phpwbgnD8' to '/var/upfiles/journals/4/articles/111/supp/2013.27.NIOPH.27.VIE.SupplementaryFile.1.Oct282013-11:26am.pdf'
In file: /var/www/laohrp/lib/pkp/classes/file/FileManager.inc.php
At line: 112


This looks pretty similar to what I've seen in other topics.

If I go to my database, I can see that the table article_supplementary_files well possess the line concerning the missing file, but the file_id is set to 0. On the table article_files, the line concerning the missing file is missing too.

My config file well redirect the files to the "upfiles" folder
/var/upfiles 755 www-data root
The 2 sub-folders, journals and temp have the same owners and file permissions. By the way I am wondering why there is a "temp" folder.

On my php.ini, the "upload_tmp_dir" is commented. It should therefore use the default temp folder. I also checked the max size (2M, the file missing is 135kb) and number of files uploaded in one action (20).

Here are my tmp folders:
/tmp/ 777 root root
/var/tmp/ 777 root root


I am really confused because this happens only with some files and not from a specific format...

Any advice on what to check would be greatly appreciated.

Thanks!

Edouard
elavaud
 
Posts: 4
Joined: Thu Nov 29, 2012 6:43 pm

Re: Files don't always upload

Postby JasonNugent » Mon Oct 28, 2013 9:24 am

Hi Edouard,

Those 'permission denied' errors are usually indications that the permissions on the '/var/upfiles/' directory, and possibly sub directories, are not writable by the web server. Can you confirm?

Regards,
jason
JasonNugent
Site Admin
 
Posts: 863
Joined: Tue Jan 10, 2006 6:20 am

Re: Files don't always upload

Postby elavaud » Mon Oct 28, 2013 9:15 pm

Hi Jason,

Thanks for taking time to answer me!

Indeed, when I go to the "articles" folder, all the sub-folders doesn't have the same owners. Since we launched the system 1 year and a half ago, 2 migrations has been done. Now in the "articles" folder, all the sub-folders are 755 however I can see multiple types of owner:

root root
www-data root
www-data www-data

Which one should be the good owner rigths?

Is there a file, or in my server, or in OJS I should modify to be always sure of the owner rights of the new folders created?

Thanks a lot!

Edouard
elavaud
 
Posts: 4
Joined: Thu Nov 29, 2012 6:43 pm

Re: Files don't always upload

Postby elavaud » Mon Oct 28, 2013 10:44 pm

Hi again Jason,

By the way, on the config file it is written about the upload folder:
This directory should not be directly web-accessible
I understood it by moving it outside of the www folder (in my case /var/upfiles), am I right?

Thanks again,

Edouard
elavaud
 
Posts: 4
Joined: Thu Nov 29, 2012 6:43 pm

Re: Files don't always upload

Postby JasonNugent » Tue Oct 29, 2013 5:12 am

Hi Edouard,

The owner of those directories depends on who your web server runs as. You can check this by looking at the output of the 'ps auxww' command, and find the relevant entries for your Apache or httpd process. The beginning of the lines will tell you who the user is. It's probably the 'www-data' user.

But it's more than just the owner. The actual permissions themselves matter. Even if your web server owns the directory, it still needs write permission in order to store new files there. My suggestion would be a 'www-data' owner, with a directory mode of 700. No one else needs to go in there.

Regards,
Jason
JasonNugent
Site Admin
 
Posts: 863
Joined: Tue Jan 10, 2006 6:20 am

Re: Files don't always upload

Postby elavaud » Tue Oct 29, 2013 5:29 am

Hi Jason,


Thanks a lot for this.

Just tried 'ps auxww' command and yes, the relevant entries should be www-data for apache.

Please excuse my small knowledge in server administration. I will not reproduce the mistake!


Long life to PKP!


Edouard
elavaud
 
Posts: 4
Joined: Thu Nov 29, 2012 6:43 pm


Return to OJS Technical Support

Who is online

Users browsing this forum: Bing [Bot] and 3 guests

cron