Cron suddenly not working

Nextcloud version (eg, 12.0.2): 17.0.3
Operating system and version (eg, Ubuntu 17.04): Centos 7
Apache or nginx version (eg, Apache 2.4.25): Apache/2.4.6
PHP version (eg, 7.1): 7.2.24

So All of a sudden, problably after a server or nextcloud update, cron is not working anymore.

This is what cron looks like under apache user:

[root@localhost ~]# crontab -u apache -l
*/5 * * * * /usr/bin/php -f /var/www/nextcloud/cron.php

Nevertheless I get the warning in the admin page that cron is not working… It did so before.

Any ideas on how to fix this?

The output of your Nextcloud log in Admin > Logging:

[cron] Error: Error: Call to a member function getUserFolder() on null at <<closure>>

0. /var/www/html/nextcloud/lib/public/BackgroundJob/Job.php line 77
   OCA\Maps\BackgroundJob\UpdatePhotoByFileJob->run({fileId: 601672,userId: "USER"})
1. /var/www/html/nextcloud/lib/public/BackgroundJob/QueuedJob.php line 46
   OCP\BackgroundJob\Job->execute(OC\BackgroundJob\JobList {}, OC\Log {})
2. /var/www/html/nextcloud/cron.php line 147
   OCP\BackgroundJob\QueuedJob->execute(OC\BackgroundJob\JobList {}, OC\Log {})

GET /cron.php
from 192.168.1.1 at 2020-02-20T20:21:26+00:00

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

<?php
$CONFIG = array (
  'instanceid' => 'xxxxxxx',
  'passwordsalt' => 'xxxxxxxx',
  'secret' => 'xxxxxxx/',
  'trusted_domains' => 
  array (
    0 => 'xxx.xxxx.xxxxxx',
  ),
  'datadirectory' => '/var/www/html/nextcloud/data',
  'dbtype' => 'mysql',
  'version' => '17.0.3.1',
  'overwrite.cli.url' => 'http://192.168.1.50/nextcloud',
  'dbname' => 'nextcloud',
  'dbhost' => 'localhost',
  'dbport' => '',
  'dbtableprefix' => 'oc_',
  'dbuser' => 'xxxxx',
  'dbpassword' => 'xxxxxxx',
  'installed' => true,
  'updater.release.channel' => 'stable',
  'maintenance' => false,
  'theme' => '',
  'loglevel' => 2,
  'memcache.distributed' => '\\OC\\Memcache\\Redis',
  'memcache.locking' => '\\OC\\Memcache\\Redis',
  'memcache.local' => '\\OC\\Memcache\\APCu',
  'redis' => 
  array (
    'host' => 'localhost',
    'port' => 6379,
  ),
  'enabledPreviewProviders' => 
  array (
    0 => 'OC\\Preview\\PNG',
    1 => 'OC\\Preview\\JPEG',
    2 => 'OC\\Preview\\GIF',
    3 => 'OC\\Preview\\BMP',
    4 => 'OC\\Preview\\XBitmap',
    5 => 'OC\\Preview\\MP3',
    6 => 'OC\\Preview\\TXT',
    7 => 'OC\\Preview\\MarkDown',
    8 => 'OC\\Preview\\MSOffice2003',
    9 => 'OC\\Preview\\MSOffice2007',
    10 => 'OC\\Preview\\MSOfficeDoc',
    11 => 'OC\\Preview\\OpenDocument',
    12 => 'OC\\Preview\\PDF',
    13 => 'OC\\Preview\\TIFF',
    14 => 'OC\\Preview\\PSD',
  ),
  'mail_from_address' => 'nextcloud',
  'mail_smtpmode' => 'smtp',
  'mail_sendmailmode' => 'smtp',
  'mail_domain' => 'xxxx.xxxx',
  'mail_smtpauth' => 1,
  'mail_smtpauthtype' => 'LOGIN',
  'mail_smtphost' => 'xxxx.xxxx.xxxx',
  'mail_smtpname' => 'xxxx@xxx.xxxx.xxx',
  'mail_smtppassword' => 'xxxxx-fsgg',
  'mail_smtpport' => '587',
  'has_rebuilt_cache' => true,
);

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

[Tue Jan 21 20:40:41.228547 2020] [authz_core:error] [pid 9401] [client 192.168.1.1:58223] AH01630: client denied by server configuration: /var/www/html/nextcloud/config

Is there a way to check if cron is executing at all?

When I use AJAX it doesn’t make any difference. Nextcloud still says the last cron job was executed days ago.

Or, I’m wondering if it’s nextcloud giving a false alarm.

Thx.
K.

Looks like this issue: https://github.com/nextcloud/maps/issues/291
Disable or update the maps app.

1 Like

This seems to be related, I disabled the maps app and it works now but only using AJAX, not the cron method…

Is there another place where you can monitor this? There’s nothing new in the nextcloud log.

Set up the cron method and come back in a few hours.

It seems to work now, thanks!