danb35 / freenas-iocage-nextcloud

Script to create an iocage jail on FreeNAS for the latest Nextcloud 28 release, including Caddy, MariaDB or PostgreSQL, and Let's Encrypt
GNU General Public License v3.0
250 stars 71 forks source link

Cron Task Issue #178

Closed arthertm closed 2 years ago

arthertm commented 2 years ago

Hi, firstly to say this is not an issue with your script which I've found to be flawless, thank you, but an issue that has emerged (i believe) since update to stable 21.0.3. I get the error "Last background job execution ran 24 days ago. Something appears wrong." Something has changed as this worked perfectly before but wondering if you could give me any pointers as to what may change changed/resolve? thank you

danb35 commented 2 years ago

In the jail, check the command that's being run with crontab -u www -l. Then try to run it from the shell prompt and note any errors.

arthertm commented 2 years ago

Thanks Dan.

This is the response with -l

/5 * /usr/local/bin/php -f /usr/local/www/nextcloud/cron.php

Sorry for being somewhat dim... how do I manually run the task from shell?

Thank you

danb35 commented 2 years ago

The command starts with the /usr, so run /usr/local/bin/php -f /usr/local/www/nextcloud/cron.php

arthertm commented 2 years ago

Thank you - I run the command and get no errors, however Nextcloud still states "Last background job execution ran last month. Something seems wrong. Check the background job settings". Is their any further diagnosis you can recommend please? Again, I can only conclude this error appeared after minor upgrade to latest stable version (21.0.3). Any help appreciated.

I wondered if any permissions may have changed with the update, probably nothing to do with, but they are:

/usr/local/bin/php -rwxr-xr-x root:wheel /usr/local/www/nextcloud/cron.php -rw-r--r-- www:www

t26y commented 2 years ago

I think I fixed it: I noticed an error about apcu not being available when trying to set an unrelated config variable from the command line.

Some googling then led me to enable apc for the cli by setting apc.enable_cli=1 in /usr/local/etc/php.ini., as mentioned here: https://docs.nextcloud.com/server/stable/admin_manual/configuration_server/caching_configuration.html#id1 This also appears to have fixed the cron issue.