Last background job execution ran X days ago

Nextcloud version (eg, 20.0.5): 21.0.3
Operating system and version (eg, Ubuntu 20.04): Ubuntu 20.04 focal
Apache or nginx version (eg, Apache 2.4.25): nginx/1.18.0
PHP version (eg, 7.4): PHP 7.4.3

The issue you are facing:
On the Settings > Security & setup warnings:
Last background job execution ran 21 days ago. Something seems wrong. Check the background job settings.
Otherwise the instance seems to be running well.

Is this the first time you’ve seen this error? (Y/N): Y

Steps to replicate it:

  1. Go to Settings > Overview

The example output of cron in syslog:

Jul 28 16:10:01 dysoncloudserver CRON[543006]: (www-data) CMD (php -f /usr/share/nginx/nextcloud/cron.php)
Jul 28 16:15:01 dysoncloudserver CRON[543048]: (www-data) CMD (php -f /usr/share/nginx/nextcloud/cron.php)
Jul 28 16:17:01 dysoncloudserver CRON[543061]: (root) CMD (   cd / && run-parts --report /etc/cron.hourly)
Jul 28 16:20:01 dysoncloudserver CRON[543074]: (www-data) CMD (php -f /usr/share/nginx/nextcloud/cron.php)
Jul 28 16:25:01 dysoncloudserver CRON[543113]: (www-data) CMD (php -f /usr/share/nginx/nextcloud/cron.php)
Jul 28 16:30:01 dysoncloudserver CRON[543630]: (root) CMD ([ -x /etc/init.d/anacron ] && if [ ! -d /run/systemd/system ]; then /usr/sbin/invoke-rc.d anacron start >/dev/null; fi)
Jul 28 16:30:01 dysoncloudserver CRON[543631]: (www-data) CMD (php -f /usr/share/nginx/nextcloud/cron.php)
Jul 28 16:35:01 dysoncloudserver CRON[543765]: (www-data) CMD (php -f /usr/share/nginx/nextcloud/cron.php)
Jul 28 16:39:01 dysoncloudserver CRON[544394]: (root) CMD (  [ -x /usr/lib/php/sessionclean ] && if [ ! -d /run/systemd/system ]; then /usr/lib/php/sessionclean; fi)
Jul 28 16:40:01 dysoncloudserver CRON[544933]: (www-data) CMD (php -f /usr/share/nginx/nextcloud/cron.php)
Jul 28 16:45:01 dysoncloudserver CRON[544955]: (www-data) CMD (php -f /usr/share/nginx/nextcloud/cron.php)

Seems to me that the job is running, no? Any idea why I would be getting the error message?

I´m facing the same issue. Same version of NC, 21.0.3, though I am running it in a TrueNAS jail on Apache.

No errors in System / Logging or in /var/log/cron or anywhere else that I can find.

1 Like

Has this ever been solved?
I have a similar issue but when I run as www-data the command php -f /var/www/nextcloud/cron.php I see the following error message:

This version of Nextcloud is not compatible with PHP>=8.2.
You are currently running 8.2.5.

I am running NextCloudPi 25.0.5
NextCloudPi v1.52.0 is up to date

you must eather remove all php8.2 packages from your Pi:

sudo apt-get remove --purge *php8.2*

or set them manually to the php version (e.g. 8.0 or 8.1) with this command:

for linkgroup in $(ls /var/lib/dpkg/alternatives/ | grep -E "ph(ar|p)"); do sudo update-alternatives --config $linkgroup; done

controll, if all php-versions are switched to the version you want. I would recommend to not leave it in automatic mode but choosing the respective manual mode so that no unintentional version changes can take place, but only after your conscious change.

last possibility is to not run php -f but php$version -f instead (where $version must be replaced with 8.0 or 8.1 depending on which version you want to use - which of course has to be installed)

You can find out, which php-versions and -packages are installed on you system with:

dpkg -l | awk '/^ii/ {print $2}' | grep -i php

Much luck

Your issue may be related to this:

The bottom line is the the error message is accurate: PHP 8.2 should not be installed. But it’s possible you ended up with it perhaps due to this recent issue in NCP.

for linkgroup in $(ls /var/lib/dpkg/alternatives/ | grep -E "ph(ar|p)"); 
do sudo update-alternatives --config $linkgroup; done

According to your suggestion, the above worked and the cronjobs are running again.
Let’s see what other obstacles I encounter, but thank you very much.

2 Likes