crazy-max / docker-nextcloud

Nextcloud Docker image
MIT License
245 stars 47 forks source link

After Cronjob UI will error "File not found" / All shares are reset #38

Closed aronmgv closed 4 years ago

aronmgv commented 4 years ago

Behaviour

After cronjob is executed UI will reset all sahres links and when still on the page it will error file not found and returns you to the homepage.

Steps to reproduce this issue

  1. Basic install.
  2. Share file via link.
  3. Wait after cron job will be executed.
  4. UI will pop up error message File not foud
  5. All shares via link are lost..

Configuration

docker-compose.yml:

version: "3.7"

services:
  nextcloud:
    container_name: nextcloud.524
    image: crazymax/nextcloud:latest
    restart: always
    ports:
      - 52480:8000
    depends_on:
      - postgres
      - redis
    volumes:
      - "$PWD/nextcloud:/data"
      - "/lvm/raid/public/nextcloud/data/:/data/data"
      - "/lvm/raid/private/backups/:/mnt/private/backups"
      - "/lvm/raid/private/data/:/mnt/private/data"
      - "/lvm/raid/private/drive/:/mnt/private/drive"
      - "/lvm/raid/private/media/:/mnt/private/media"
      - "/lvm/raid/public/backups/:/mnt/public/backups"
      - "/lvm/raid/public/drive/:/mnt/public/drive"
      - "/lvm/raid/public/ftp/:/mnt/public/ftp"
    labels:
      - "com.ouroboros.enable=true"
      - "traefik.enable=true"
      - "traefik.port=8000"
      - "traefik.frontend.entryPoints=https"
      - "traefik.frontend.rule=Host:cloud.example.com"
      - "traefik.frontend.redirect.permanent=true"
      - "traefik.frontend.redirect.regex=https://(.*)/.well-known/(card|cal)dav"
      - "traefik.frontend.redirect.replacement=https://$$1/remote.php/dav/"
      - "traefik.backend=nextcloud.524"
      - "traefik.frontend.headers.forceSTSHeader=true"
      - "traefik.frontend.headers.STSSeconds=315360000"
      - "traefik.frontend.headers.STSIncludeSubdomains=true"
      - "traefik.frontend.headers.STSPreload=true"
    environment:
      - PUID=1000
      - PGID=994
    env_file:
      - "./nextcloud.env"

  postgres:
    container_name: nextcloud.524.postgres
    image: postgres:latest
    restart: always
    expose:
      - 5432
    volumes:
      - $PWD/postgres:/var/lib/postgresql/data
    environment:
      - PUID=1000
      - PGID=994
      - POSTGRES_DB=nextcloud
      - POSTGRES_USER=nextcloud
      - POSTGRES_PASSWORD=****************************

  adminer:
    container_name: nextcloud.524.adminer.82
    image: adminer
    restart: always
    ports:
      - 52482:8080

  redis:
    container_name: nextcloud.524.redis
    image: redis:4.0-alpine
    restart: always

  collabora:
    container_name: nextcloud.524.collabora
    image: collabora/code
    restart: always
    cap_add:
      - MKNOD
    expose:
      - 9980
    labels:
      - "com.ouroboros.enable=true"
      - "traefik.enable=true"
      - "traefik.port=9980"
      - "traefik.frontend.entryPoints=https"
      - "traefik.frontend.rule=Host:collabora.cloud.example.com"
      - "traefik.backend=nextcloud.524.collabora"
      - "traefik.frontend.headers.forceSTSHeader=true"
      - "traefik.frontend.headers.STSSeconds=315360000"
      - "traefik.frontend.headers.STSIncludeSubdomains=true"
      - "traefik.frontend.headers.STSPreload=true"
    environment:
      - "domain=cloud.example.com"
      - "DONT_GEN_SSL_CERT=true"
      - "extra_params=--disable-ssl"
      #- "extra_params=--o:ssl.enable=false"

  cron:
    container_name: nextcloud.524.cron
    image: crazymax/nextcloud:latest
    restart: always
    depends_on:
      - nextcloud
    volumes:
      - "$PWD/nextcloud:/data"
      - "/lvm/raid/public/nextcloud/data/:/data/data"
    #command:
    #  - "/usr/local/bin/cron"
    env_file:
      - "./nextcloud.env"
    environment:
      - "SIDECAR_CRON=1"
      - "CRON_PERIOD=*/15 * * * *"

  news_updater:
    container_name: nextcloud.524.news_updater
    image: crazymax/nextcloud:latest
    depends_on:
      - nextcloud
    volumes:
      - "$PWD/nextcloud:/data"
      - "/lvm/raid/public/nextcloud/data/:/data/data"
    env_file:
      - "./nextcloud.env"
    environment:
      - "SIDECAR_NEWSUPDATER=1"
      - "NC_NEWSUPDATER_THREADS=10"
      - "NC_NEWSUPDATER_TIMEOUT=300"
      - "NC_NEWSUPDATER_INTERVAL=900"
      - "NC_NEWSUPDATER_LOGLEVEL=error"
    restart: always

nextcloud.env:

TZ=Europe/Prague

PUID=1000
PGID=994

MEMORY_LIMIT=4096M
UPLOAD_MAX_SIZE=10G
OPCACHE_MEM_SIZE=1024
APC_SHM_SIZE=1024M

REAL_IP_FROM=0.0.0.0/32
REAL_IP_HEADER=X-Forwarded-For
LOG_IP_VAR=http_x_forwarded_for

HSTS_HEADER=max-age=15768000; includeSubDomains
RP_HEADER=strict-origin
SUBDIR=

DB_TYPE=pgsql
DB_HOST=postgres
DB_NAME=nextcloud
DB_USER=nextcloud
DB_PASSWORD=****************************

Thank you, Michal

crazy-max commented 4 years ago

@MacGyver27

After cronjob is executed UI will reset all sahres links and when still on the page it will error file not found and returns you to the homepage.

I cannot reproduce your issue with the provided examples. I have also updated the Traefik example with Traefik v2 if you want to try it. Also your issue seems more related to Nextcloud itself than to this image. I suggest you open an issue on the official repo.

aronmgv commented 4 years ago

I have traefik2 as well as a separate service.. Will try to test it later again. Actually what is the purpose of that cronjob ? I see it in Nextcloud as well - complaining if it didnt run for some time.. thx.

crazy-max commented 4 years ago

@MacGyver27

complaining if it didnt run for some time.. thx.

You should change - "CRON_PERIOD=*/15 * * * *" to - "CRON_PERIOD=*/5 * * * *". I will update the examples.