Cron not running in NC 21.0.3

I updated only NC, no PHP update or anything and the error occured.
I went back to NC 21.0.2 with a backup and now it workls fine again.

I did some tests. I did a fresh installation of 21.0.3 on a second DiskStation (another Firmware version) and as soon as I enabled APCu the cron stopped. I did then a dffresh installation of 21.0.2 and the croin stayed intact after enabling APCu.

Here is the solution for Synology:
Create the file /usr/local/etc/php74/cli/conf.d/user_settings.ini with following content:

extension = apcu.so

[apc]
apc.shm_size = 512M
apc.enable_cli = 1

Thx to the guys from the German Synology Forum.

1 Like

So far I think it’s safe to say, that the parameter apc.enable_cli = 1 is mandatory for the cronjobs to continue to work if one uses APCu for local caching. In my opinion, however, this parameter has been recommended or even required for quite some time. It also says so in the documentation starting from v13… https://docs.nextcloud.com/server/13/admin_manual/configuration_server/caching_configuration.html#id1

1 Like

I have the same problem with Cron when migrating to 20.0.3. But I am running Nextcloud on a SYNOLOGY DSM. PHP 7.4, MariaDB 10, Apache2.4.
In WEB Station Configuration, PHP parameters, I gave to apc.enable_cli the value of 1 and it brakes instantly my Nextcloud Installation : internal server error.
I restored Nextcloud in 21.0.2 and Web Server in its previous configuration. It’s ok.
Is anyone using Synology and has changed apc.enable_cli to 1 with success ?
Thank you !

I posted the answer 2 posts above yours.

Thank you, but, it didn’t work for me…
I created the file
I migrated to NC 21.0.3
No error in Syno CRON JOB Task, but still the message in NC : an error occurred…
I modified apc.enable_cli=1 in webserver
Same message appeared : Internal Server Error

Thanks a lot!!
This solved my problem (php7.3.2 not updated) after updating to 21.0.3 on my machine as well.
I’m happy again.
BenBenna

Hello Pierre,
I also have a Synology with NextCloud, having the same issue (when I migrated to the 21.0.3 version).
The difference is that I migrated also to DSM 7
I changed the value apc.enable_cli=1 in WebStation. It didn’t break anything, but it didn’t either changed the cron from returning an error.
cheers,
Laurent.

Changing the value in the WebStation doesn’t help as it only applies to the Web Server. You have to create the config file for the cli.

Also restarting the DS might me neccessary.

1 Like

same problem here;
solution from @bb77 fixed the problem;

thx

1 Like

Thanks @Thor this is working fine with my Synology running DSM 7.0
I have created the file /usr/local/etc/php74/cli/conf.d/user_settings.ini

extension = apcu.so

[apc]
apc.shm_size = 512M
apc.enable_cli = 1

and running the task sudo -u http php74 /volume1/web/nextcloud/cron.php as root

cheers

Hi all,
I have the same problem with my NC instance on my lab server. NC runs as a Docker container, and I strictly don’t know where’s the incriminated file /etc/php/7.4/mods-available/apcu.ini, so I can’t verify the appropriate settings.
Can anyone help me in this context? Thanks in advance!

Thanks a lot it works

The best practice for future use is to get rid of cron, and switch to [systemd timer] I had no trouble at all.
(https://nextcloud.com/blog/setup-cron-or-systemd-timers-for-the-nextcloud-preview-generator/).

Do not panic, the cron still works as usual, despite of NxC Basic Settings: Background jobs false warning (PHP 8.0.3).

@henk

This has nothing to do with the issue at hand. The parameter apc.enable_cli = 1 should be used in any case if you use APCu as local cache, no matter if you use systemd, crontab or any other tool to execute the cron.php.

@vladas

No one is panicking here. We are just trying to set up our Nextclouds correctly, as recommended in the Nextcloud documentation…

1 Like

Helped me too, i’m using PHP7.3. After add the line

apc.enable_cli=1

the Cron is running after restart raspi.

Thanks. :slight_smile:

2 Likes

This solution worked for me, too. Thanks!

i confirm the issue for the exact same version of Debian (10 Buster w/out systemd).
It occurred right after the latest php7.3 and php7.3-module-upgrade performed with apt.
In my case occ (which i use for NC-upgrades) and cron did not work. In the NC admin-handbook/tuning-howto you are advised that the parameter enable.cli=1 is mandatory
Still, i do not consider this a NC-issue - it is a manual change to a configfile belonging to a file installed by by the PM, and - really - IMHO a PM as mature as APT must take this into account.

@pete.dawgg - I’d like to disagree.

Please have a look at:

All the recommendations to set apc.enable_cli to 1 in the php.ini config files have been followed on my machine since the beginning. The php7.3 was a coincidence and is not the cause of the a.m. issue. The issue only appeared after the NC 21.0.3.1 update and the above proves sufficiently the intentional changes by the NC devs to the PHP code, I presume.

Hope this helps.

Happy hacking.
:sunflower:

did only the 21.0.2 to 21.0.3 upgrade and get stuck also.

adding apc.enable_cli=1 resolved my issue. Thanks !