Cron problems & maintenance mode

Nextcloud 28.0.3
debian bookworm
apache 2.4.57-2
PHP 8.2.7

I have been using nextcloud for some years now without major problems. For some weeks I face the following problem: The system cron works fine for some days, then for some reason it suddenly stops working.

cron.log tells me that cron.php is still being executed, but nextcloud reports: “last cron x hours ago, somthing is wrong”. When i run the nextcloud cron.php as www-data manually no error is reported, but nextcloud still complains that cron is not working.

After some more time (days) nextcloud is suddenly in maintenance mode. at this point the only thing that works is restaring apache (although every other website etc works fine). Now nextcloud works again as expected including system cron. A few days later the cylce repeats…

Most probably I am just stupid and the fact that restarting apache temporarily solves the problem is curious, but i cannot find relevant hints in either the apache or php error logs.

Sorry for the long text, but perhaps someone can point me in the right direction… :confused:

Please check your Nextcloud log (either via Admin setttings->Logging or via data/nextcloud.log. Your Nextcloud cron job may be executing, but still failing within Nextcloud itself (i.e. one of the background jobs is generate a serious enough error).

Your Nextcloud log may have other clues that will help explain why an Apache restart is needed and, more importantly, why maintenance mode is kicking in somehow on its own.

Thanks for your answer. Over the past month(s) nextcloud threw exceptions at two occasions

  1. “HMAC does not match. Could not decrypt or decode encrypted session data”
  2. “RouteNotFoundException Unable to generate a URL for the named route …”

but I am not sure if these correspond to the cron/maintenance problem (the timing does not match).

Other stuff I tried without lasting success: deactivation of most apps, complete reinstall of nextcloud, de/activating APCu (with apc.enable_cli=1) :confused:

ok: As expected it was my own stupidity: (a weekly backup cron-job filled up the disk temporarily causing the problems). Please ignore everything above…