Cron issue. Last job execution ran 3 hours ago. Something seems wrong

Nextcloud version (eg, 20.0.5): 27.0.2
Operating system and version (eg, Ubuntu 20.04): Debian 11
Apache or nginx version (eg, Apache 2.4.25): 2.4.56
PHP version (eg, 7.4): 8.2.8

The issue you are facing:
I have set my instance background jobs to run in Cron, as it is recommended, but I am getting a notification in the basic settings page that says "Last job execution ran 3 hours ago. Something seems wrong. " Any help with this? If i set the Background jobs to AJAX, they seem to run fine, but there is still a notification saying "Some jobs have not been executed since 3 months ago. Please consider switching to system cron. "

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

Steps to replicate it:

  1. In the default settings, set the background jobs to be run by cron.
  2. Get error

The output of your config.php file in /var/www/nextcloud/config:

<?php
$CONFIG = array (
  'instanceid' => 'xxxxx',
  'passwordsalt' => 'xxxxxxxx',
  'secret' => 'xxxxxxxxx',
  'trusted_domains' =>
  array (
    0 => 'xxxxxxx',
    1 => 'xxxxxxx',
    2 => 'xxxxxxx',
    3 => 'xxxxxxx',
  ),
  'datadirectory' => '/mnt/disk3/nextcloud/data',
  'dbtype' => 'mysql',
  'version' => '27.0.2.1',
  'overwrite.cli.url' => 'http://localhost',
  'dbname' => 'nextcloud',
  'dbhost' => 'localhost',
  'dbport' => '',
  'dbtableprefix' => 'oc_',
  'mysql.utf8mb4' => true,
  'dbuser' => 'nextcloud',
  'dbpassword' => 'xxxxxxx',
  'installed' => true,
  'app_install_overwrite' =>
  array (
    0 => 'occweb',
    1 => 'admin_notifications',
  ),
  'filesystem_check_changes' => 0,
  'enforce_theme' => '',
  'maintenance' => false,
  'updater.secret' => 'xxxxxxx',
  'theme' => '',
  'loglevel' => 2,
  'memcache.local' => '',
);

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

[Tue Aug 29 00:00:06.268484 2023] [mpm_prefork:notice] [pid 433250] AH00163: Apache/2.4.56 (Debian) OpenSSL/1.1.1n configured -- resuming normal operations
[Tue Aug 29 00:00:06.268496 2023] [core:notice] [pid 433250] AH00094: Command line: '/usr/sbin/apache2'

Output errors in nextcloud.log in /var/www/ or as admin user in top right menu, filtering for errors. Use a pastebin service if necessary.

[Tue Aug 29 07:32:34.424814 2023] [negotiation:error] [pid 451813] [client 192.241.219.31:51768] AH00687: Negotiation: discovered file(s) matching request: /var/www/nextcloud/version (None could be negotiated).
[Tue Aug 29 11:17:32.920685 2023] [php:error] [pid 467178] [client 54.234.194.13:40542] script '/var/www/nextcloud/gate.php' not found or unable to stat
[Tue Aug 29 16:17:32.209058 2023] [php:error] [pid 485303] [client 54.226.137.151:54068] script '/var/www/nextcloud/gate.php' not found or unable to stat

Did you actually set up a cron job in the crontab of www-data?

https://docs.nextcloud.com/server/latest/admin_manual/configuration_server/background_jobs_configuration.html#cron

What’s the output of: crontab -u www-data -l ?

1 Like

Ah, I didn’t realize you need to setup a cronjob. I made a cron job following the docs and it seems to work. Thanks!

1 Like