Cron not running despite seemingly correct access rights

Nextcloud version (eg, 20.0.5): 27.1.4
Operating system and version (eg, Ubuntu 20.04): 22.04
Apache or nginx version (eg, Apache 2.4.25): nginx/1.25.3
PHP version (eg, 7.4): 8.2.13

The issue you are facing:

Hey i have setup nextcloud with docker compose. The cloud is running an working but the cron is not. When looking at the docker logs it seems that the access rights are configured wrong.

$ docker logs a8f11daac10f
crond: crond (busybox 1.36.1) started, log level 8
crond: USER www-data pid   7 cmd php -f /var/www/html/cron.php
Cannot write into "config" directory!
This can usually be fixed by giving the web server write access to the config directory.
But, if you prefer to keep config.php file read only, set the option "config_is_read_only" to true in it.
See https://docs.nextcloud.com/server/27/go.php?to=admin-config

but when i check the setup the configuration seems alright:

drwxr-xr-x  2 www-data www-data      12 Dez  5 14:07 config
-rw-r-----  1 www-data www-data  1632 Dez  9 19:04 config.php

this is my docker compse file:

version: '2'

services:
  db:
    image: mariadb:10.6
    restart: always
    command: --transaction-isolation=READ-COMMITTED --log-bin=binlog --binlog-format=ROW
    volumes:
      - db:/var/lib/mysql
    environment:
      - MYSQL_ROOT_PASSWORD=secret   
      - MYSQL_PASSWORD=secret  
      - MYSQL_DATABASE=nextcloud
      - MYSQL_USER=nextcloud
  
  cron:
    image: nextcloud:fpm-alpine
    restart: always
    volumes:
      - nextcloud:/var/www/html
    entrypoint: /cron.sh
    depends_on:
      - db
      - redis

  redis:
    image: redis:alpine
    restart: always

  app:
    image: nextcloud:fpm
    restart: always
    links:
      - db
      - redis
    volumes:
      - nextcloud:/var/www/html
    environment:
      - MYSQL_PASSWORD=secret   
      - MYSQL_DATABASE=nextcloud
      - MYSQL_USER=nextcloud
      - MYSQL_HOST=db
      - REDIS_HOST=redis
      - TRUSTED_PROXIES=web
      - APACHE_DISABLE_REWRITE_IP = true
      - NEXTCLOUD_TRUSTED_DOMAINS=cloud.site.com   
      - OVERWRITEHOST=cloud.site.com
      - OVERWRITEPROTOCOL=https
      - OVERWRITECLIURL=https://cloud.site.com

  web:
    image: nginx
    restart: always
    labels:
      - "traefik.enable=true"
      - "traefik.http.routers.nextcloud.rule=Host(`cloud.site.com`)"   
      - "traefik.http.services.nextcloud.loadbalancer.server.port=80"
      - "traefik.http.routers.nextcloud.tls=true"
      - "traefik.http.routers.nextcloud.tls.certresolver=letsencrypt"
      - "traefik.http.routers.nextcloud.entrypoints=websecure"
      - "traefik.nextcloud.redirect.permanent='true'"
      - "traefik.nextcloud.redirect.regex='https://(.*)/.well-known/(?:card|cal)dav'"
      - "traefik.nextcloud.redirect.replacement='https://$$1/remote.php/dav'"
    links:
      - app
    volumes:
      - ./nginx.conf:/etc/nginx/nginx.conf:ro
    volumes_from:
      - app

networks: 
  default:
    external: true
    name: external

volumes:
  nextcloud:
    driver_opts:
      type: "zfs"
      device: "karla/nextcloud/nextcloud"
  db:
    driver_opts:
      type: "zfs"
      device: "karla/nextcloud/db"

can someone help me out? I cant spot the error.

Your cron and app containers are not running the same image. Your cron image should be running the same one was your app image so change it to nextcloud:fpm.

1 Like

Thank You!

1 Like

This topic was automatically closed 8 days after the last reply. New replies are no longer allowed.