Files upload 500 Internal Server Error by process user
Added by Ted Hyde about 7 years ago
Greets - I have a passenger/apache/debian redmine instance installed (Redmine version 2.5.3.stable/ Ruby version 1.9.3-p484 (2013-11-22) [x86_64-linux] / Rails version 3.2.19 / Environment production / Database adapter Mysql2) which has been running stable for quite a while. Since its a continuous production system, in-line upgrades do not occur immediately.
We migrated the {redmine}/files folder from a local filestructure to a nas link, which worked just fine by ensuring that the NAS structure was owned by www-data:www-data, and environment.rb was owned by www-data, and there was a PassengerDefaultUser www-data in apache2/mods-enabled/passenger.conf
Until we rolled over to the beginning of this month - which is an important time frame because redmine organizes uploads by year/month. When redmine created the "files/2017/11" folder, it did it with 1006:users for which I have no idea. I think 1006 was the process number, no idea why it all of a sudden changed from www-data.
In a test, I added that user (and 1008, and 1009 due to restarts!) as users on my nas with write permissions and the files still (and always) did upload to the NAS. They had non-executable permissions (no big deal) - but the ownership was forced to that user (like 1006:users) instead of www-data.
A large file will show upload progress, and it will be on the NAS, but at the end of the upload, it will fail with an Internal server error. There are no entries in production.log or in apache's error logs for this. (Unlike during my early migration testing where I did have permission fail log entries). The only problem out of the failure is that redmine won't show the file as attached or available in the project.
Does redmine try to check the existence of the file after the upload applet has done its job, but then gets unhappy because it isn't owned by www-data, then fails the database insert at that point? Is there a fix to ensure that the file is always available to redmine?
Thanks,
Ted.
Replies (1)
RE: Files upload 500 Internal Server Error by process user - Added by Pero Postar about 7 years ago
I have a similar setup and identical problem. Redmine 3.4.3. Debian, www-data running apache2 and stuff...
Every-new-month folder is created with root:root. If i change to www-data:www-data then everything works OK.
For now I have shceduled a cron job that takes care about permissions.