Wrong permissions being applied

Keywords: Redmine - Microsoft Azure - Technical issue - Permissions

bndiagnostic ID: 000d94fd-1bba-5a89-603a-4237e2867415

bndiagnostic output:

? Connectivity: Found possible issues
https://docs.bitnami.com/general/faq/administration/use-firewall/

bndiagnostic failure reason: The suggested guides are not related with my issue

Description:
I have created a Redmine instance in my Azure cloud via the Azure Marketplace and have set up the system to retrieve incoming email to create issue tickets. I have followed the steps here to set up this process Convert incoming email to issues
I have no problem running that command via cron, however, at the beginning of the month, if the Redmine system creates a ticket via email that has an attachment, then the system automatically creates a month folder at /opt/bitnami/redmine/files/2022/

When this happens, the system creates the folder with root privileges, i.e. root root. This causes the Redmine application to produce the error message “Internal Server Error” when users try to manually attach a file to a ticket. The only solution I have found is, at the beginning of the month, change the permissions on the month folder from root root to daemon daemon (see this post Files folder has the wrong permissions).

My question is, is there a way to have the month folder created with daemon privileges instead of root privileges when the rake command is ran from the crontab file?

You can set the user to use when running the cron job

https://serverfault.com/questions/352835/crontab-running-as-a-specific-user

Thank you, I updated my crontab entry and added “-u daemon” (without quotes) at the beginning, but am having some odd results.

After April 1st, I sent an email with an attachment to our Redmine account to see if the issue was resolved. Redmine had no problem connecting to the inbox and creating a ticket from the email but it did not attach the file from the email. Also, the system did not create an “04” folder for the month of April. How do I get my crontab entry to create the necessary monthly folder with the appropriate permissions? I am following Bitnami’s instructions on this. Here is the beginning of my crontab entry:

*/5 * * * * sudo -u daemon bundle exec rake -f /opt/bitnami/redmine/Rakefile redmine:email:receive_imap RAILS_ENV=“production”…

Hi @ataylor,

As your question is specific to the application I recommend asking in the official Redmine forum, they will be able to help you further.

Regards,
Michiel

I solved this issue.

I had to change the permissions on the parent directory named “2022” to daemon:daemon instead of root:root as well. (/opt/bitnami/redmine/files)

Also, adding “-u daemon” to the cronjob entry worked once I had all permissions set correctly. It allowed the system to create a new month folder with the daemon:daemon permissions.

Just a recommendation, but you may want to update your documentation and add “-u daemon” to the cronjob instructions because as it sits the root user ends of creating any necessary MariaDB directories if they don’t exist and this always sets the permissions of the directory to root:root. This problem has crept up in every Bitnami instance of Redmine I have used.

Hi @ataylor ,

I’m glad to hear it’s solved. Our docs team will check your recommendations.

Regards,
Michiel

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.