Cron job not executing

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: 20.0.2
Operating system and version (eg, Ubuntu 20.04): CentOS 7
Apache or nginx version (eg, Apache 2.4.25): 2.4.46
PHP version (eg, 7.1): 7.4

The issue you are facing:

I get an error in backend for Cron Jobs; Last job execution ran 2 hours ago. Something seems wrong.

I’m executing crons via crontab and the output is
$ crontab -l
MAILTO=""
SHELL="/usr/local/cpanel/bin/jailshell"

          • php -f /home/**************/cron.php

I have also tried with the webcron and If I execute it over browser I get a success status;
{“status”:“success”}

If I execute it over cron
curl https://example.cloud/cron.php
the cron job is also run successfully.

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

The output of your Nextcloud log in Admin > Logging:

Empty

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


application/x-httpd-php config.php ( PHP script, ASCII text )
<?php
$CONFIG = array (
  'instanceid' => '**************',
  'passwordsalt' => '**************',
  'secret' => '**************',
  'trusted_domains' => 
  array (
    0 => 'example.cloud',
  ),
  'datadirectory' => '/home/**************/data',
  'dbtype' => 'mysql',
  'version' => '20.0.2.2',
  'overwrite.cli.url' => 'https://example.cloud',
  'dbname' => '**************',
  'dbhost' => 'localhost',
  'dbport' => '',
  'dbtableprefix' => 'oc_',
  'mysql.utf8mb4' => true,
  'dbuser' => '**************',
  'dbpassword' => '**************',
  'installed' => true,
  'default_language' => 'en',
  'default_locale' => 'en_US',
  'htaccess.RewriteBase' => '/',
  'memcache.local' => '\\OC\\Memcache\\APCu',
  'memcache.distributed' => '\\OC\\Memcache\\Redis',
  'filelocking.enabled' => true,
  'memcache.locking' => '\\OC\\Memcache\\Redis',
  'redis' => 
  array (
    'host' => '/var/redis/redis.sock',
    'port' => 0,
    'dbindex' => 0,
    'password' => '**************',
    'timeout' => 1.5,
  ),
  'mail_smtpmode' => 'smtp',
  'mail_smtpsecure' => 'ssl',
  'mail_sendmailmode' => 'smtp',
  'mail_smtpauthtype' => 'LOGIN',
  'mail_smtpauth' => 1,
  'mail_domain' => 'example.cloud',
  'mail_from_address' => 'automail',
  'mail_smtpname' => 'auto@example.cloud',
  'mail_smtppassword' => '**************',
  'mail_smtphost' => 'mail.example.cloud',
  'mail_smtpport' => '465',
  'ldapIgnoreNamingRules' => false,
  'ldapProviderFactory' => 'OCA\\User_LDAP\\LDAPProviderFactory',
  'simpleSignUpLink.shown' => false,
  'blacklisted_files' => 
  array (
  ),
  'maintenance' => false,
  'theme' => '',
  'loglevel' => 0,
  'updater.release.channel' => 'stable',
);

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

[29-Nov-2020 13:19:01 UTC] PHP Fatal error:  Uncaught Error: Call to a member function getLogger() on null in /home/**************/cron.php:162
Stack trace:
#0 {main}
  thrown in /home/**************/cron.php on line 162