Cronjob not running for Nextcloud 22.2.0

Support intro

Sorry to hear you’re facing problems :slightly_frowning_face:

help.nextcloud.com is for home/non-enterprise users. If you’re running a business, paid support can be accessed via portal.nextcloud.com where we can ensure your business keeps running smoothly.

In order to help you as quickly as possible, before clicking Create Topic please provide as much of the below as you can. Feel free to use a pastebin service for logs, otherwise either indent short log examples with four spaces:

example

Or for longer, use three backticks above and below the code snippet:

longer
example
here

Some or all of the below information will be requested if it isn’t supplied; for fastest response please provide as much as you can :heart:

Nextcloud version: 22.2.1
Operating system and version: Ubuntu 20.04
nginx version 1.21.3
PHP version: 7.4

The issue you are facing:
every now and then I get the message:
Letzte Cron-Job-Ausführung: Vor X Tagen. Check the background job settings :arrow_upper_right:.

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

Steps to replicate it:

  1. update to 22.2.0

The output of your Nextcloud log in Admin > Logging:

Keine Serverlogs Alles funktioniert gut

The output of your config.php file in /path/to/nextcloud (make sure you remove any identifiable information!):

config.php                                                                                        
<?php
$CONFIG = array (
  'instanceid' => 'X',
  'passwordsalt' => 'X',
  'secret' => 'X',
  'trusted_domains' => 
  array (
    0 => '192.168.XXX.XX',
    1 => 'cloud.xxxxxx.xx',
  ),
  'datadirectory' => '/xxxx/nextcloud_data',
  'dbtype' => 'mysql',
  'version' => '22.2.0.2',
  'overwrite.cli.url' => 'https://192.168.XX.XX',
  'dbname' => 'nextcloud',
  'dbhost' => 'localhost',
  'dbport' => '',
  'dbtableprefix' => 'oc_',
  'mysql.utf8mb4' => true,
  'dbuser' => 'nextcloud_user',
  'dbpassword' => 'PWPWPWPW',
  'installed' => true,
  'log_type' => 'file',
  'logfile' => '/var/log/nextcloud.log',
  'logfilemode' => 0640,
  'loglevel' => '2',
  'logdateformat' => 'F d, Y H:i:s',
  'filelocking.enabled' => 'true',
  'memcache.locking' => '\\OC\\Memcache\\Redis',
  'memcache.local' => '\\OC\\Memcache\\APCu',
  'redis' => 
  array (
    'host' => '/run/redis/redis-server.sock',
    'port' => 0,
    'timeout' => 0.0,
  ),
  'default_phone_region' => 'BE',
  'overwriteprotocol' => 'https',
  'logtimezone' => 'Europe/XXXXXXXXXXXX',
  'auth.bruteforce.protection.enabled' => true,
  'maintenance' => false,
  'mail_smtpmode' => 'smtp',
  'mail_sendmailmode' => 'smtp',
  'mail_from_address' => 'cloudatlas',
  'mail_domain' => 'vvvvvvvvvv.vv',
  'mail_smtphost' => 'vvvvvvvvvvvvvvvvvv.vvv',
  'mail_smtpport' => '465',
  'mail_smtpsecure' => 'ssl',
  'mail_smtpauth' => 1,
  'mail_smtpauthtype' => 'LOGIN',
  'mail_smtpname' => 'XXXXXXXXXXXXXXX@iXXXXXX',
  'mail_smtppassword' => 'XXXXXXXXXXXXXXXXXXXXX',
  'app_install_overwrite' => 
  array (
    0 => 'ocsms',
    1 => 'podcast',
    2 => 'whiteboard',
    3 => 'forms',
    4 => 'drop_account',
  ),
  'theme' => '',
  'skeletondirectory' => '/XXXXXXXXXX/XXXXXXXXXXXXXXXXX',
  'data-fingerprint' => 'XXXXXXXXXXXXXXXXXXXXX',
  'updater.secret' => '$XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.',
);

The output of your nginx/system log in /var/log/____:

nothing

Since the cloud is updated is happens now and then. I renewed cron.php. Everything looks fine, but it’ s not. Does anyone have any idea?

Best Joon

You can manually run the cron command from terminal to see the errors in the output:

sudo -u www-data php -f cron.php

1 Like

It says: Could not open input file: cron.php, why??? I’m root

In parallel the daily backup throws the error:
PHP Fatal error: Allowed memory size of 2097152 bytes exhausted (tried to allocate 446464 bytes) in /var/www/nextcloud/3rdparty/composer/autoload_real.php on line XX
Is there any connection?
I reinstalled collabora (on my own server) some days ago, because it didn’t connect to the document.

???

Perhaps the wrong path. Also with sudo -u www-data you are not anymore root but www-data

sudo -u www-data php -f /path/to/nextcloud/cron.php

thanks, it was the wrong path. now it throws (like the backup):
PHP Fatal error: Allowed memory size of 2097152 bytes exhausted (tried to allocate 446464 bytes) in /var/www/nextcloud/3rdparty/composer/autoload_real.php on line 37

Check your PHP memory settings. There is a setting with only 2 MB.

I checked and applied:

Doesn’t change anything. apc.enable_cli=1 is inserted in php.ini additionally I added in /etc/php/7.4/mods-available/apcu.ini the same line.

You can test to use it in command line:

sudo -u www-data php --define apc.enable_cli=1 -f /path/to/nextcloud/cron.php

OCC won't run with memcache/apcu

1 Like

unfortunately not. If I do: php -i
it gives: memory_limit => 512MB => 512MB

if I do that: same answer:
PHP Fatal error: Allowed memory size of 2097152 bytes exhausted (tried to allocate 446464 bytes) in /var/www/nextcloud/3rdparty/composer/autoload_real.php on line 37

don’t know, but my impression is it has to do with the reinstallation of collabora. That works now. It’s installed via docker and in a container.

Where should this setting be?
or cli/php.ini or fpm/php.ini has memory_limit=512MB
???
Thanks for your patience!!

Where should this 2MB limit be?
both php.ini in …/cli and …/fpm/ are set to memory_limit = 512MB

This problem occurs after the reinstallation of docker and the latest Collabora-Container, is there now a third option to raise an memory_limit?
There is a closed issue on Github: Change PHP memory_limit (I am going crazy) · Issue #1019 · nextcloud/docker · GitHub nearly the same line was produced, but in that case nextcloud it self was in docker. In my case only collabora is in docker.

Any ideas??? Iḿ really at a loss :frowning:

PS: Sorry for the overflow of answers!

Sorry that was the wrong issue:

The right one is:

After having also read an older post, I understood that only the php.ini in …/cli/ hast to be set to memory_limit = 512M
In …/fpm/ it has to be set to memory_limit = -1
For my system it works now.

I had the same issue upgrading to the 22.2.0 on my pi3b+, even with redis cache

Uncommenting and adjusting the php_admin_value[memory_limit] = 512M

in /etc/php/7.4/fpm/pool.d/www.conf

It dit the trick for me.

Interesting. I’ve also redis caching. So it works maybe also, the other way around: memory_limit at cli to -1 and at fpm to 512M? Systems are complex ;).