Project

General

Profile

Unable to delete attachments in issue. [Solved]

Added by Thomas Godard about 11 years ago

Hello !

I am finalizing my installation of Redmine 2.3.1 and have an issue concerning attachments in my issues.

My environment :

Centos 6.4

Environment:
Redmine version 2.3.1.stable
Ruby version 1.9.3 (i686-linux)
Rails version 3.2.13
Environment production
Database adapter Mysql2
Redmine plugins:
no plugin installed

When I send an email with an attachment to redmine. The process goes well and my mail is treated. A new issue is created and the mail attachment becomes an issue attachment.

When I want to delete this attachment, I get a internal error code 500. I know this has to do with the rights on my directories. My "Files" directory is owned by apache (Centos 6.4). In Redmine, I have the green logo next to "Attachments directory writable". So there is no problem normally.

The problem comes when Redmine creates the Files/2013/07 for example. The directories 2013 and 07 comes with rights that are not compatible with deleting attachments.

Is there a way to create de new directories each month with the correct rights ? Or must I change the rights on these directories each month myself ?

Thank you very much.


Replies (1)

RE: Unable to delete attachments in issue. - Added by Thomas Godard about 11 years ago

Just a reminder : My distribution is CentOS 6.4
This might not work on another distribution.

I managed to get rid of this problem by changing my crontab job.

My previous crontab was :
*/5 * * * * /var/etc/www/redmine/mail.sh

with mail.sh :

#!/bin/sh
HOSTNAME=centos
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin
cd /var/www/redmine;
rake redmine:email:receive_imap RAILS_ENV="production" host=my_host_name username="my_username" password="my_password" project=my_project tracker=my_tracker allow_override=project,tracker,priority,status,category,assigned_to

My new crontab is :
*/5 * * * * su -s /bin/sh apache -c "/var/etc/www/redmine/mail.sh"

If it still doesn't work, try :
*/5 * * * * su apache -s /bin/sh -c "/var/www/redmine/mail.sh"

Now, all the subdirectories are correctly create as belonging to apache. I am now able to delete every attachment, anytime.

    (1-1/1)