Cron not running in NC 21.0.3

Thanks to both @andrewheeler82 with 21.0.3 OC\HintException: Memcache \OC\Memcache\APCu not available · Issue #27781 · nextcloud/server · GitHub and @maysi2k and I sadly consent.

Apparently, the new Nextcloud policy is taking from big business now: “It’s not a bug it’s a feature.

https://docs.nextcloud.com/server/21/admin_manual/configuration_server/caching_configuration.html#id1

The admin manual has been changed to reflect this change of design only recently, I presume. This seems to be an intentional change to the PHP coding in NC 22 and obviously was backported to NC 21.0.3 without any notice to the community. Please prove me wrong, but this is my picture after reading the below reports which are one month old.

If this is the case, this apparent negligence and way of change from Nextcloud would be especially hurting to community people like me who were running a stable NC environment for years.

I had this setting configured before, so somewhere this must have been communicated. This is also the reason why I assumed that the upgrade of the PHP packages caused the error, because I had already made this confiiguration change before.

I’m not a developer and don’t understand half of the linked GitHub threads :wink: But it seems to me that APCu should be abandoned as the local cache and that Redis should be used for local caching to avoid problems in the future… Correct me if I’m misinterpreting this…

I think it’s a problem with the 21.0.3 update. Nothing above helps for me.
I decided to restore a backup with V 21.0.2. This works fine again. The problems with the cron’s and APCu begun with the update to V21.0.3.

I have another NC server which I updated from 20.0.11 to 21.0.3. Here I have no such problems with Cron and APCu.

How can someone understand such behaviour…

Best regards
DZ

Adding apc.enable_cli=1 to /etc/php/8.0/mods-available/apcu.ini worked for me as well

3 Likes

Then the two servers are not configured identically.

Unfortunately, I can’t say exactly what the problem was in my case, because as I mentioned earlier, I updated the PHP packages and then immediately updated to NC 21.0.3. Either the update of the PHP packages or the update of the Nexcloud obviously changed something in the PHP configuration. However, since I document all my installation steps and configurations, I was able to solve the problem in 5 minutes by simply reconfiguring PHP.

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