YunoHost-Apps / freshrss_ynh

FreshRSS package for YunoHost
https://freshrss.org
GNU Affero General Public License v3.0
28 stars 20 forks source link

actualize_script.php failed to write log : cannot create /var/log/freshrss/freshrss.log: Permission denied #148

Closed xoddark closed 1 year ago

xoddark commented 1 year ago

Describe the bug

After update, I receive from my Yunohost instance emails with subject : Cron freshrss@yunhost /usr/bin/php7.4 /var/www/freshrss/app/actualize_script.php >/var/log/freshrss/freshrss.log 2>&1 And content : bin/sh: 1: cannot create /var/log/freshrss/freshrss.log: Permission denied

Context

Steps to reproduce

Expected behavior

The actualize_script should be able to write log. The freshrss should be able to write log in root folder, or the folder should have good access right.

xoddark commented 1 year ago

If folder /var/log/freshrss_app should belong to app_user, perhaps upgrade script should ensure of that.

pobee24 commented 1 year ago

I confirm, I get the same issue after the update. with some help from the chat, an update of the permissions solved the problem (sudo chown freshrss:root /var/log/freshrss)

lapineige commented 1 year ago

Fixed by #150

SimonLefort commented 1 year ago

Same problem for me. @pobee24 's solution worked for me.

$ sudo chown freshrss:root /var/log/freshrss

Thanks to @xoddark and @lapineige for the fix.

xoddark commented 1 year ago

@lapineige or @plopoyop : That would be good idea to release a new version with the fix, no ?

plopoyop commented 1 year ago

That is exactly what the fix do :

log_path="/var/log/$app"
mkdir -p $log_path
chown $app:www-data "$log_path"

The merge in master was 2 days ago, did you upgrade after this date ?

xoddark commented 1 year ago

The package version wasn't upgraded, so Yunohost don't propose me upgrade. The package should not have been upgraded ?

lapineige commented 1 year ago

Good point, thanks !