YunoHost-Apps / freshrss_ynh

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

RSS feeds are not updating automatically #147

Open TheGreatBeginner777 opened 1 year ago

TheGreatBeginner777 commented 1 year ago

Describe the bug

My feeds are not updating automatically. Feeds are only updated by clicking on "Update feeds" from the main page in FressRSS (this means I have to login to YunoHost instance to update feeds for it to be propagated to the same user on desktop/mobiles etc.). I searched for similar issue and found issue #77.

  1. I'm unable to locate log file in /tmp/freshrss.log.
  2. For cat /etc/cron.d/freshrss output is MAILTO="root" /10 * freshrss /usr/bin/php7.3 /var/www/freshrss/app/actualize_script.php >/var/www/freshrss/freshrss.log 2>&1

freshrss cron job is pointing to php7.3. Based on #77 solution from some users should I edit cron and point to php7.0?

Context

Steps to reproduce

Login to YunoHost instance. Go into FreshRSS app and click on "Update feeds" icon.

Expected behavior

Feeds to be updated automatically.

Logs

n/a.

lapineige commented 1 year ago

Isn't FreshRSS using php7.4 now ? :thinking:

lapineige commented 1 year ago

https://github.com/YunoHost-Apps/freshrss_ynh/issues/77#issuecomment-1264737829 : @yalh76 do you have any clue ?

yalh76 commented 1 year ago

Isn't FreshRSS using php7.4 now ? 🤔

Nope, it's not using PHP7.4 since you have not merged #146

lapor-kris commented 1 year ago

I have the same problem since upgrading it to 1.20

Esit: any workaround for this issue? Thanks

mprimi commented 1 year ago

Sharing some info that may be useful to other stumbling upon this.

@TheGreatBeginner777 :

For cat /etc/cron.d/freshrss output is MAILTO="root" */10 * * * * freshrss /usr/bin/php ...

A cron file exists, but it's not installed. This is why refresh is not working.

Here's how set it up:

Login as root using sudo su when logged in as admin. The rest of the commands here are executed as root.

  1. Check cron jobs for various users:
    for u in <your username> admin freshrss root;  do sudo -u $u crontab -l; done
    no crontab for USER1
    no crontab for admin
    no crontab for freshrss
    no crontab for root

Confirms none of the users has a cron job installed.

  1. Run refresh manually The script /var/www/freshrss/app/actualize_script.php belongs to user freshrss. And that's the user FreshRSS runs as.
sudo -u freshrss /usr/bin/php7.3 /var/www/freshrss/app/actualize_script.php
FreshRSS starting feeds actualization at 2022-11-06T20:26:12+00:00
FreshRSS actualize USER1…
FreshRSS actualization done for 2 users, using 6.00 MiB of memory, in 0 day(s), 0 hour(s), 0 minute(s) and 1 seconds.
Results:
USER1 OK
End.

This worked fine.

  1. Install the cron job sudo -u freshrss crontab -e

This opens an editor, I add the line:

*/30 * * * * /usr/bin/php7.3 /var/www/freshrss/app/actualize_script.php >/var/log/freshrss/freshrss.log 2>&1

This refreshes every 30 minutes. Save and quit. It should say crontab: installing new crontab.

Double check: sudo -u freshrss crontab -l

*/30 * * * * /usr/bin/php7.3 /var/www/freshrss/app/actualize_script.php >/var/log/freshrss/freshrss.log 2>&1

After enough time has passed, I can see (as root) that the update ran:

cat /var/log/freshrss/freshrss.log
FreshRSS starting feeds actualization at 2022-11-06T20:51:40+00:00
FreshRSS actualize USER1…
FreshRSS actualization done for 1 users, using 4.00 MiB of memory, in 0 day(s), 0 hour(s), 0 minute(s) and 0 seconds.

Notice this is slightly brittle: the crontab is hardcoding /usr/bin/php7.3 which may not be the right executable after an update.

Anyway, this works.

Notice that this page has 2 different methods to do the same:

inrepublica commented 1 year ago

Same problem for me with upgrade 1.20

lapor-kris commented 1 year ago

After the upgrade to 1.20 I also get cron mail every 10 minutes with this: /bin/sh: 1: cannot create /var/log/freshrss/freshrss.log: Permission denied

Is there a way to add permission for this?

edit: if I try: cat /var/log/freshrss/freshrss.log cat: /var/log/freshrss/freshrss.log: No such file or directory

mprimi commented 1 year ago

@lapor-kris Either /var/log/freshrss/ doesn't exist, or it's not writeable by whichever user you installed the cronjob for.

Assuming is running under freshrss user:

Create the directory: sudo mkdir -p /var/log/freshrss/ Change owner of directory: sudo chown freshrss /var/log/freshrss/

lapineige commented 1 year ago

150 should have fixed it.

Maybe not for the people who upgraded in the mid-time ?