Nextcloud version: 21.0.2
Operating system and version: Ubuntu 20.04
Apache or nginx version: Apache/2.4.41
PHP version: 7.4
The issue you are facing:
When I set background jobs to cron under basic settings and add the line
*/5 * * * * php -f /var/www/nextcloud/cron.php
to crontab using sudo -u www-data crontab -e it does not update the “Last job ran…” notification on the settings menu. When I run cron.php from the cli it runs just fine (I had to set the log_level to 1 to get this to run otherwise it would just hang indefinitely) and it updates the “Last job ran…” notification. If I check journalctl | grep CRON I can see that the cron job is run every 5 minutes as expected, but the notification does not update. After looking through the forums I tried updating the memory_limit under /etc/php/7.4/cli/php.ini as I only had it set in …/apache2/php.ini, but this did not work. This problem has only become apparent after updating to NC 21.0.2 from NC 20.0.8 however I cannot verify whether it was working before the update as I was just using AJAX then. Also, it may be of note that I had to add apc.enable_cli=1 to /etc/php/7.4/mods-available/apcu.ini as well as have ‘memcache.local’ => ‘\OC\Memcache\APCu’, in $NEXTCLOUD/config/config.php in order to get things like occ to run after updating.
Is this the first time you’ve seen this error? (Y/N):
Steps to replicate it:
- Change to system cron
- Add relevant cronjob to crontab
- Notice that last background job notification does not update
I will provide any relevant logs if necessary, but the only relevant thing the logs appear to show is occasionally some logging from cron.php if I run on cli.