Missing recommended PHP modules bz2 & Last job execution ran XX hours ago

Dear all

I am running a Nextcloud under Docker. The containers were created by the following docker-compose:

docker-compose:
version: '3.2'

services:
  db:
    image: postgres
    restart: always
    volumes:
      - /mnt/docker/nextcloud/postgresql:/var/lib/postgresql/data
    environment:
      - POSTGRES_DB_FILE=/run/secrets/postgres_db
      - POSTGRES_USER_FILE=/run/secrets/postgres_user
      - POSTGRES_PASSWORD_FILE=/run/secrets/postgres_password
    secrets:
      - postgres_db
      - postgres_password
      - postgres_user

  app:
    image: nextcloud
    restart: always
    ports:
      - 8281:80
    volumes:
      - /mnt/docker/nextcloud/nextcloud:/var/www/html
      - /mnt/docker/nextcloud/apps:/var/www/html/custom_apps
      - /mnt/docker/nextcloud/config:/var/www/html/config
      - /mnt/docker/nextcloud/data:/var/www/html/data
    environment:
      - POSTGRES_HOST=db
      - POSTGRES_DB_FILE=/run/secrets/postgres_db
      - POSTGRES_USER_FILE=/run/secrets/postgres_user
      - POSTGRES_PASSWORD_FILE=/run/secrets/postgres_password
      - NEXTCLOUD_ADMIN_PASSWORD_FILE=/run/secrets/nextcloud_admin_password
      - NEXTCLOUD_ADMIN_USER_FILE=/run/secrets/nextcloud_admin_user
      - REDIS_HOST=redis

    depends_on:
      - db
    secrets:
      - nextcloud_admin_password
      - nextcloud_admin_user
      - postgres_db
      - postgres_password
      - postgres_user

  redis:
    image: redis:alpine
    restart: always
    volumes:
      - /mnt/docker/nextcloud/redisdata:/data

secrets:
  nextcloud_admin_password:
    file: /mnt/docker/nextcloud/secret_nextcloud_admin_password.txt
  nextcloud_admin_user:
    file: /mnt/docker/nextcloud/secret_nextcloud_admin_user.txt
  postgres_db:
    file: /mnt/docker/nextcloud/secret_postgres_db.txt
  postgres_password:
    file: /mnt/docker/nextcloud/secret_postgres_password.txt
  postgres_user:
    file: /mnt/docker/nextcloud/secret_postgres_user.txt

Everything works so far. However, the message irritates me:

" * This instance is missing some recommended PHP modules. For improved performance and better compatibility it is highly recommended to install them: bz2. For more details see the documentation :arrow_upper_right:."

I use a ready-made Docker image including PHP which was created directly by Nextcloud (Docker). Why is the bz2 module not included there?

I also get the message “Last job execution ran XX hours ago”. I have created an entry in the cron (/etc/crontab) on my Docker host, which looks like this:

*/5 * * * *                     root docker exec --user www-data -it nextcloud-app-1 php /var/www/html/cron.php > /dev/null 2>&1

If the command is executed manually, it works, but not via cron. Cron does not display any errors:

Does anyone know the problem? Or is there a better solution for running cronjobs? I also tried another container, but unfortunately that didn’t work either.

  cron:
    image: nextcloud
    restart: always
    volumes:
      - /mnt/docker/nextcloud/nextcloud:/var/www/html
      - /mnt/docker/nextcloud/apps:/var/www/html/custom_apps
      - /mnt/docker/nextcloud/config:/var/www/html/config
      - /mnt/docker/nextcloud/data:/var/www/html/data
    entrypoint: /cron.sh
    depends_on:
      - app

Thanks for your help and best regards

About the bz2 PHP module: There are already discussions about it. In the end [and as far as I know] Nextcloud says it needs this module, but in reality it is not absolutely necessary. The error is not that it is not integrated, but that Nextcloud says that an “important” module is missing.

1 Like

Dear XHyperDEV

Many thanks for the answer! I have not noticed any restrictions regarding the functionality of the bz2 module. I am more surprised that the module is not included, although the Docker image used comes directly from Nextcloud.

Regarding the cron, I was able to solve it this way (I had to mount all volumes as well):

  cron:
    image: nextcloud
    restart: always
    volumes:
      - /mnt/docker/nextcloud/nextcloud:/var/www/html
      - /mnt/docker/nextcloud/apps:/var/www/html/custom_apps
      - /mnt/docker/nextcloud/config:/var/www/html/config
      - /mnt/docker/nextcloud/data:/var/www/html/data
    entrypoint: /cron.sh
    depends_on:
      - app

Thanks and BR

Just a quick tip here (came here for the missing modules stuff but couldn’t help noticing).
For the cron stuff I use a minimal image: rcdailey/nextcloud-cronjob which does only that. See the image docs for how to use it, but it’s pretty simple and effortless. Just throw it a bunch of environment variables so it can find the nextcloud container and it will do the job.
I wouldn’t run a second instance of the nextcloud image just for cron.

Regarding the cronjob, I used this command in the HOST crontab (my docker runs on a QNAP NAS):

*/5 * * * * /share/CE_CACHEDEV1_DATA/.qpkg/container-station/bin/docker exec -u 33 nextcloud-28-1 /usr/local/bin/php -f /var/www/html/cron.php

Of course you would have to check and amend directories to your environment.

Now with the latest update the bz2 module seems to be included :slight_smile:

They didn’t include it, Nextcloud removed the check that generated the warning: [stable28] Remove disputed bz2 check by backportbot[bot] · Pull Request #43013 · nextcloud/server · GitHub

1 Like

ahhh… alright. Thanks for the clarification!