Cron problem docker not working and working at the same time

EDIT: I just saw lots of problems regarding cron in the 29 update, but i dont have any apps installed (i skipped the apps installation)

Nextcloud version Nextcloud Hub 8 (29.0.0)
Operating system and version (eg, Ubuntu 20.04): docker
Apache or nginx version (eg, Apache 2.4.25): default, apache
PHP version (eg, 7.4): the docker one

The issue you are facing:
Cron jobs appear like they are running () but not seems like because of the message in the admin panel.

Im using the cron (recommended) option, running a kuma hitting the URL https://nextcloud.my-domain.com/cron.php and now it appears that its returning a 200 but the nextcloud > admin panel > basic settings > background jobs message is this one
Some jobs have not been executed since 2 days ago. Please consider increasing the execution frequency.

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

Steps to replicate it:

  1. install docker
  2. launch the docker- compose files
  3. add the nginx configuration
  4. add the nextcloud config

The output of your Nextcloud log in Admin > Logging:
These logins has nothing to do with the problem they were because of the well-known problem that i just fixed

{"reqId":"F28aQ5ARzMl9BDBnvA5e","level":1,"time":"2024-05-06T15:21:21+00:00","remoteAddr":"192.168.10.160","user":"admin","app":"no app in context","method":"GET","url":"/settings/ajax/checksetup","message":"Unable to generate a URL for the named route \"heartbeat\" as such route does not exist.","userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/124.0.0.0 Safari/537.36","version":"29.0.0.19","exception":{"Exception":"Symfony\\Component\\Routing\\Exception\\RouteNotFoundException","Message":"Unable to generate a URL for the named route \"heartbeat\" as such route does not exist.","Code":0,"Trace":[{"file":"/var/www/html/lib/private/Route/Router.php","line":410,"function":"generate","class":"Symfony\\Component\\Routing\\Generator\\UrlGenerator","type":"->","args":["heartbeat",[],1]},{"file":"/var/www/html/lib/private/Route/CachingRouter.php","line":65,"function":"generate","class":"OC\\Route\\Router","type":"->","args":["heartbeat",[],false]},{"file":"/var/www/html/lib/private/URLGenerator.php","line":103,"function":"generate","class":"OC\\Route\\CachingRouter","type":"->","args":["heartbeat",[]]},{"file":"/var/www/html/apps/settings/lib/SetupChecks/SecurityHeaders.php","line":60,"function":"linkToRoute","class":"OC\\URLGenerator","type":"->","args":["heartbeat"]},{"file":"/var/www/html/lib/private/SetupCheck/SetupCheckManager.php","line":51,"function":"run","class":"OCA\\Settings\\SetupChecks\\SecurityHeaders","type":"->","args":[]},{"file":"/var/www/html/apps/settings/lib/Controller/CheckSetupController.php","line":179,"function":"runAll","class":"OC\\SetupCheck\\SetupCheckManager","type":"->","args":[]},{"file":"/var/www/html/lib/private/AppFramework/Http/Dispatcher.php","line":232,"function":"check","class":"OCA\\Settings\\Controller\\CheckSetupController","type":"->","args":[]},{"file":"/var/www/html/lib/private/AppFramework/Http/Dispatcher.php","line":138,"function":"executeController","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->","args":[["OCA\\Settings\\Controller\\CheckSetupController"],"check"]},{"file":"/var/www/html/lib/private/AppFramework/App.php","line":184,"function":"dispatch","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->","args":[["OCA\\Settings\\Controller\\CheckSetupController"],"check"]},{"file":"/var/www/html/lib/private/Route/Router.php","line":338,"function":"main","class":"OC\\AppFramework\\App","type":"::","args":["OCA\\Settings\\Controller\\CheckSetupController","check",["OC\\AppFramework\\DependencyInjection\\DIContainer"],["settings.checksetup.check"]]},{"file":"/var/www/html/lib/base.php","line":1050,"function":"match","class":"OC\\Route\\Router","type":"->","args":["/settings/ajax/checksetup"]},{"file":"/var/www/html/index.php","line":49,"function":"handleRequest","class":"OC","type":"::","args":[]}],"File":"/var/www/html/3rdparty/symfony/routing/Generator/UrlGenerator.php","Line":144,"message":"Unable to generate a URL for the named route \"heartbeat\" as such route does not exist.","exception":{},"CustomMessage":"Unable to generate a URL for the named route \"heartbeat\" as such route does not exist."}}
{"reqId":"s1MBI2RvQSksIzu3BJ84","level":1,"time":"2024-05-06T17:00:19+00:00","remoteAddr":"192.168.10.160","user":"admin","app":"no app in context","method":"GET","url":"/settings/ajax/checksetup","message":"Unable to generate a URL for the named route \"heartbeat\" as such route does not exist.","userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/124.0.0.0 Safari/537.36","version":"29.0.0.19","exception":{"Exception":"Symfony\\Component\\Routing\\Exception\\RouteNotFoundException","Message":"Unable to generate a URL for the named route \"heartbeat\" as such route does not exist.","Code":0,"Trace":[{"file":"/var/www/html/lib/private/Route/Router.php","line":410,"function":"generate","class":"Symfony\\Component\\Routing\\Generator\\UrlGenerator","type":"->","args":["heartbeat",[],1]},{"file":"/var/www/html/lib/private/Route/CachingRouter.php","line":65,"function":"generate","class":"OC\\Route\\Router","type":"->","args":["heartbeat",[],false]},{"file":"/var/www/html/lib/private/URLGenerator.php","line":103,"function":"generate","class":"OC\\Route\\CachingRouter","type":"->","args":["heartbeat",[]]},{"file":"/var/www/html/apps/settings/lib/SetupChecks/SecurityHeaders.php","line":60,"function":"linkToRoute","class":"OC\\URLGenerator","type":"->","args":["heartbeat"]},{"file":"/var/www/html/lib/private/SetupCheck/SetupCheckManager.php","line":51,"function":"run","class":"OCA\\Settings\\SetupChecks\\SecurityHeaders","type":"->","args":[]},{"file":"/var/www/html/apps/settings/lib/Controller/CheckSetupController.php","line":179,"function":"runAll","class":"OC\\SetupCheck\\SetupCheckManager","type":"->","args":[]},{"file":"/var/www/html/lib/private/AppFramework/Http/Dispatcher.php","line":232,"function":"check","class":"OCA\\Settings\\Controller\\CheckSetupController","type":"->","args":[]},{"file":"/var/www/html/lib/private/AppFramework/Http/Dispatcher.php","line":138,"function":"executeController","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->","args":[["OCA\\Settings\\Controller\\CheckSetupController"],"check"]},{"file":"/var/www/html/lib/private/AppFramework/App.php","line":184,"function":"dispatch","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->","args":[["OCA\\Settings\\Controller\\CheckSetupController"],"check"]},{"file":"/var/www/html/lib/private/Route/Router.php","line":338,"function":"main","class":"OC\\AppFramework\\App","type":"::","args":["OCA\\Settings\\Controller\\CheckSetupController","check",["OC\\AppFramework\\DependencyInjection\\DIContainer"],["settings.checksetup.check"]]},{"file":"/var/www/html/lib/base.php","line":1050,"function":"match","class":"OC\\Route\\Router","type":"->","args":["/settings/ajax/checksetup"]},{"file":"/var/www/html/index.php","line":49,"function":"handleRequest","class":"OC","type":"::","args":[]}],"File":"/var/www/html/3rdparty/symfony/routing/Generator/UrlGenerator.php","Line":144,"message":"Unable to generate a URL for the named route \"heartbeat\" as such route does not exist.","exception":{},"CustomMessage":"Unable to generate a URL for the named route \"heartbeat\" as such route does not exist."}}
{"reqId":"IOxdQoQUVeOaYqvAjBFI","level":1,"time":"2024-05-06T17:03:39+00:00","remoteAddr":"192.168.10.160","user":"admin","app":"text","method":"PUT","url":"/apps/text/session/48/create","message":"Create new document of 48","userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/124.0.0.0 Safari/537.36","version":"29.0.0.19","data":{"app":"text"}}
{"reqId":"3kmZFSkNVElUCe7ZwBHI","level":1,"time":"2024-05-06T17:18:57+00:00","remoteAddr":"192.168.10.160","user":"admin","app":"no app in context","method":"GET","url":"/settings/ajax/checksetup","message":"Unable to generate a URL for the named route \"heartbeat\" as such route does not exist.","userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/124.0.0.0 Safari/537.36","version":"29.0.0.19","exception":{"Exception":"Symfony\\Component\\Routing\\Exception\\RouteNotFoundException","Message":"Unable to generate a URL for the named route \"heartbeat\" as such route does not exist.","Code":0,"Trace":[{"file":"/var/www/html/lib/private/Route/Router.php","line":410,"function":"generate","class":"Symfony\\Component\\Routing\\Generator\\UrlGenerator","type":"->","args":["heartbeat",[],1]},{"file":"/var/www/html/lib/private/Route/CachingRouter.php","line":65,"function":"generate","class":"OC\\Route\\Router","type":"->","args":["heartbeat",[],false]},{"file":"/var/www/html/lib/private/URLGenerator.php","line":103,"function":"generate","class":"OC\\Route\\CachingRouter","type":"->","args":["heartbeat",[]]},{"file":"/var/www/html/apps/settings/lib/SetupChecks/SecurityHeaders.php","line":60,"function":"linkToRoute","class":"OC\\URLGenerator","type":"->","args":["heartbeat"]},{"file":"/var/www/html/lib/private/SetupCheck/SetupCheckManager.php","line":51,"function":"run","class":"OCA\\Settings\\SetupChecks\\SecurityHeaders","type":"->","args":[]},{"file":"/var/www/html/apps/settings/lib/Controller/CheckSetupController.php","line":179,"function":"runAll","class":"OC\\SetupCheck\\SetupCheckManager","type":"->","args":[]},{"file":"/var/www/html/lib/private/AppFramework/Http/Dispatcher.php","line":232,"function":"check","class":"OCA\\Settings\\Controller\\CheckSetupController","type":"->","args":[]},{"file":"/var/www/html/lib/private/AppFramework/Http/Dispatcher.php","line":138,"function":"executeController","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->","args":[["OCA\\Settings\\Controller\\CheckSetupController"],"check"]},{"file":"/var/www/html/lib/private/AppFramework/App.php","line":184,"function":"dispatch","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->","args":[["OCA\\Settings\\Controller\\CheckSetupController"],"check"]},{"file":"/var/www/html/lib/private/Route/Router.php","line":338,"function":"main","class":"OC\\AppFramework\\App","type":"::","args":["OCA\\Settings\\Controller\\CheckSetupController","check",["OC\\AppFramework\\DependencyInjection\\DIContainer"],["settings.checksetup.check"]]},{"file":"/var/www/html/lib/base.php","line":1050,"function":"match","class":"OC\\Route\\Router","type":"->","args":["/settings/ajax/checksetup"]},{"file":"/var/www/html/index.php","line":49,"function":"handleRequest","class":"OC","type":"::","args":[]}],"File":"/var/www/html/3rdparty/symfony/routing/Generator/UrlGenerator.php","Line":144,"message":"Unable to generate a URL for the named route \"heartbeat\" as such route does not exist.","exception":{},"CustomMessage":"Unable to generate a URL for the named route \"heartbeat\" as such route does not exist."}}

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

<?php
$CONFIG = array (
  'htaccess.RewriteBase' => '/',
  'memcache.local' => '\\OC\\Memcache\\APCu',
  'apps_paths' => 
  array (
    0 => 
    array (
      'path' => '/var/www/html/apps',
      'url' => '/apps',
      'writable' => false,
    ),
    1 => 
    array (
      'path' => '/var/www/html/custom_apps',
      'url' => '/custom_apps',
      'writable' => true,
    ),
  ),
  'memcache.distributed' => '\\OC\\Memcache\\Redis',
  'memcache.locking' => '\\OC\\Memcache\\Redis',
  'redis' => 
  array (
    'host' => 'redis',
    'password' => '2330812',
    'port' => 6379,
  ),
  'upgrade.disable-web' => true,
  'instanceid' => 'oc00axv6vzvq',
  'passwordsalt' => '520xqyJfe9Yg+W0S9iDbMFYLjNuzbC',
  'secret' => 'SKMXv6JWFx4CgPOJ8lR5ZHmMQMLVf83FYkmHenKBbvoOZGOL',
  'trusted_domains' => 
  array (
    0 => 'nextcloud.my-domain.com',
  ),
  'datadirectory' => '/var/www/html/data',
  'dbtype' => 'mysql',
  'version' => '29.0.0.19',
  'overwrite.cli.url' => 'https://nextcloud.my-domain.com',
  'dbname' => 'nexcloud',
  'dbhost' => 'nextcloud_db',
  'dbport' => '',
  'dbtableprefix' => 'oc_',
  'mysql.utf8mb4' => true,
  'dbuser' => 'nextcloud',
  'dbpassword' => '2330812',
  'installed' => true,
  'overwriteprotocol' => 'https',
  'default_phone_region' => 'ES',
  'loglevel' => 1,
  'maintenance_window_start' => 1,
  'maintenance' => false,
);

The output of your Apache/nginx/system log in /var/log/____:
/var/log/apache2/access and error are device file and cannot be read
/var/log/lastlog its empty

docker compose npm
services:
  app:
    image: 'jc21/nginx-proxy-manager:latest'
    restart: unless-stopped
    container_name: npm_app
    ports:
      # These ports are in format <host-port>:<container-port>
      - '80:80' # Public HTTP Port
      - '443:443' # Public HTTPS Port
      - '81:81' # Admin Web Port
      # Add any other Stream port you want to expose
      # - '21:21' # FTP

    # Uncomment the next line if you uncomment anything in the section
    # environment:
      # Uncomment this if you want to change the location of
      # the SQLite DB file within the container
      # DB_SQLITE_FILE: "/data/database.sqlite"

      # Uncomment this if IPv6 is not enabled on your host
      # DISABLE_IPV6: 'true'

    networks:
      - frontend
    volumes:
      - $PWD_NAS_DOCKER_VOLUMES/volumes/npm/data:/data
      - $PWD_NAS_DOCKER_VOLUMES/volumes/npm/letsencrypt:/etc/letsencrypt


networks:
  frontend:
    external: true
docker compose kuma
version: '3.3'

volumes:
uptimekuma:

services:
uptime-kuma:
 image: louislam/uptime-kuma
 container_name: uptime-kuma
 restart: always
 volumes:
   - uptimekuma:/app/data
 ports:
   - 3001:3001
 networks:
   - frontend

networks:
frontend:
 external: true
docker compose nextcloud
version: "3"

services:
  nextcloud_app:
    depends_on:
      - nextcloud_db
    container_name: nextcloud
    environment:
      - MYSQL_PASSWORD=$MYSQL_PASSWORD_NEXT
      - MYSQL_DATABASE=$MYSQL_DATABASE_NEXT
      - MYSQL_USER=$MYSQL_USER_NEXT
      - MYSQL_HOST=$MYSQL_HOST_NEXT
      - REDIS_HOST=$REDIS_HOST_NEXT
      - REDIS_HOST_PASSWORD=$REDIS_HOST_PASSWORD_NEXT
    image: nextcloud
    labels:
      - io.portainer.accesscontrol.public
    networks:
      - frontend
      - nextcloud
    links:
      - nextcloud_db
    #ports:
    #  - "8080:80"
    restart: always
    volumes:
      - "$PWD_NAS_DOCKER_VOLUMES/volumes/nextcloud/nextcloud_html:/var/www/html"
      - "$PWD_NAS_DOCKER_VOLUMES/volumes/nextcloud/nextcloud_apps:/var/www/html/custom_apps"
      - "$PWD_NAS_DOCKER_VOLUMES/volumes/nextcloud/nextcloud_config:/var/www/html/config"
      - "$PWD_NAS_DOCKER_VOLUMES/volumes/nextcloud/nextcloud_data:/var/www/html/data"
      - "$PWD_NAS_DOCKER_VOLUMES/volumes/nextcloud/nextcloud_theme:/var/www/html/themes/"



  nextcloud_db:
    command: "--transaction-isolation=READ-COMMITTED --binlog-format=ROW"
    environment:
      - MYSQL_ROOT_PASSWORD=$MYSQL_PASSWORD_NEXT
      - MYSQL_PASSWORD=$MYSQL_PASSWORD_NEXT
      - MYSQL_DATABASE=$MYSQL_DATABASE_NEXT
      - MYSQL_USER=$MYSQL_USER_NEXT
    image: "mariadb:10.5"
    restart: always
    labels:
      - io.portainer.accesscontrol.public
    networks:
      - nextcloud
    volumes:
      - "$PWD_NAS_DOCKER_VOLUMES/volumes/nextcloud/nextcloud_mariadb:/var/lib/mysql"


  #go-vod:
  #  image: radialapps/go-vod
  #  restart: always
  #  depends_on:
  #    - nextcloud_app
  #  environment:
  #    - NEXTCLOUD_HOST=https://nextcloud.my-domain.com
      # - NEXTCLOUD_ALLOW_INSECURE=1 # (self-signed certs or no HTTPS)
  #    - NVIDIA_VISIBLE_DEVICES=all
  #  devices:
  #    - /dev/dri:/dev/dri # VA-API (omit for NVENC)
  #  volumes:
  #    - $PWD_NAS_DOCKER_VOLUMES/volumes/nextcloud/nextcloud_html:/var/www/html:ro
    # runtime: nvidia # (NVENC)


  redis:
    container_name: nc-redis
    image: "redis:alpine"
    command: redis-server --requirepass ${REDIS_HOST_PASSWORD_NEXT}
    labels:
      - io.portainer.accesscontrol.public
    ports:
      - "6379:6379"
    volumes:
      - "nextcloud_redis_data:/var/lib/redis"
      - "nextcloud_redis_conf:/usr/local/etc/redis/redis.conf"
    environment:
      - REDIS_REPLICATION_MODE=$REDIS_REPLICATION_MODE_NEXT
    networks:
      - nextcloud


volumes:
  nextcloud_redis_data:
    external: true
  nextcloud_redis_conf:
    external: true


networks:
  nextcloud:
  frontend:
    external: true

Thank you so much for any help, my apologies if i forgot to add something, please tell me anything that i can provide

have you seen this posting?

maybe your problem is mentioned there…

I just checked that, my cron seems like its working (check the kuma picture, its returning 200 answers) but not fully because on the menu says that some crons were not runned

Okay I just ran this command

docker exec -u 33 nextcloud php -f /var/www/html/cron.php

It got stuck but in the admin pannel says this:

The thing is that gets stuck and i dont think that is normal.

May i help in any other way?

I don’t see any cron container do you have one?

Docker .examples
docker-compose-setup-with-notify-push-2024

I have a uptime kuma that will do
https://nextcloud.my-domain.com/cron.php each 60 seconds

In the previous setup was working properly, i just migrated from cloudflare tunnels to nginx proxy manager

I never used /cron.php… this is a “Webcron” variant… definitely not “Cron (recommended)” which is either relies on sidecar container or cron command running from container host. You can try the other one but afaik webcron is less reliable …

so far i managed to use the sudo crontab with
*/6 * * * * timeout 1m docker exec -u 33 nextcloud php -f /var/www/html/cron.php

The problem with this is that i dont have a verification that is running using kuma i can set up a mail alert or telegram bot.

I obtained the idea from this tutorial

So in summay its working but i dont think this is a nice and clean approach.