Error log permissions

The following error is being logged in the error log of my erpnext website at an interval of around 1 hour.

IOError: [Errno 13] Permission denied: u’/home/frappe/frappe-bench/logs/frappe.log’

Here is the current status of the frappe.log file in the server.

-rw-r–r-- 1 root root 51450 May 29 06:39 frappe.log

How to remove this error. I guess I need to update permission of the file, but I am worried of whether updating permissions will cause any security issue or not?

usually frappe as a user is the only user that needs to write in its home dir/ ie there should be no files owned by root in /home/frappe/frappe-bench

To correct this is easy fortunately and has no ramifications with security. In fact it’s far better that the files are owned only by frappe, as if someone were able to hack your server they could only take over files owned by frappe. If the files were owned by root, and root ran the supervisorctl start script then a hacker could take control of the whole server …

Just do (as root):-

chown -R frappe: /home/frappe

This changes the owner and group to frappe:frappe recursively for all the files in the frappe home directory.

Thank you for this reply. But now it gives

chown: invalid spec: ‘frappe:’

Try chown -R frappe:frappe /home/frappe

Thank You very much. It worked. Previously It was not working because frappe was not a valid user.