Skip to content

disabling the background job does not disable the preview generation in cron.php #676

Description

@BernieO

The README.md recommends to disable the default background job in case a custom system cron entry with occ preview:pre-generate is configured. I have a systemd-service which runs every 10 minutes occ preview:pre-generate - so I disabled the default background job with:

occ config:app:set --value=true --type=boolean previewgenerator job_disabled

Despite that, when I upload a picture to my Nextcloud 33.0.9 the background job from cron.php still creates a preview (if it runs before the occ preview:pre-generate systemd-service).

Steps to reproduce

  1. make sure the background job is disabled
  2. verify the preview-queue is empty
  3. upload a picture right after a run of the systemd-service occ preview:pre-generate
  4. verify that there is now a picture in the preview-queue
  5. run cron.php
  6. the background job of cron.php sends the picture to imaginary and creates a preview

The terminal output below reflects these steps.

Expected behaviour

the background job to create previews in cron.php should be disabled

Actual behaviour

the background job to create previews in cron.php should be disabled

Server configuration

Nextcloud 33.0.9 with previewgenerator app enabled and configured
Imaginary set up

I don't think that more details are needed, but I'll happily provide the configs if needed.

Details **Webserver:** nginx

Database: MariaDB

PHP version: 8.4

Nextcloud version: 33.0.9

Operating system: Debian Trixie

Terminal for the steps described before:

user@host:~# mysql -e "SELECT * FROM nextcloud.oc_appconfig WHERE appid = 'previewgenerator' AND configkey = 'job_disabled';"
+------------------+--------------+-------------+------+------+
| appid            | configkey    | configvalue | type | lazy |
+------------------+--------------+-------------+------+------+
| previewgenerator | job_disabled | 1           |   32 |    0 |
+------------------+--------------+-------------+------+------+
user@host:~# occ preview:queue-stats
+-----------------------+-----------------+
| Age                   | Queued previews |
+-----------------------+-----------------+
| Less than 10 minutes  | 0               |
| Less than 30 minutes  | 0               |
| Less than one hour    | 0               |
| Less than three hours | 0               |
| Less than a day       | 0               |
| Less than a week      | 0               |
| All                   | 0               |
+-----------------------+-----------------+
user@host:~# occ preview:queue-stats
+-----------------------+-----------------+
| Age                   | Queued previews |
+-----------------------+-----------------+
| Less than 10 minutes  | 1               |
| Less than 30 minutes  | 1               |
| Less than one hour    | 1               |
| Less than three hours | 1               |
| Less than a day       | 1               |
| Less than a week      | 1               |
| All                   | 1               |
+-----------------------+-----------------+
user@host:~# date; sudo -u www-data php -f /media/ssd/nginx/bc.dedyn.io/cron.php
Sat Sep 12 08:58:11 PM CEST 2026

user@host:~# journalctl -n 10
Sep 12 20:57:19 host sudo[3197]:     root : TTY=pts/0 ; PWD=/root ; USER=www-data ; COMMAND=/usr/bin/php /nextcloud/occ preview:queue-stats
Sep 12 20:57:19 host sudo[3197]: pam_unix(sudo:session): session opened for user www-data(uid=33) by root(uid=0)
Sep 12 20:57:19 host sudo[3197]: pam_unix(sudo:session): session closed for user www-data
Sep 12 20:57:34 host sudo[3215]:     root : TTY=pts/0 ; PWD=/root ; USER=www-data ; COMMAND=/usr/bin/php /nextcloud/occ preview:queue-stats
Sep 12 20:57:34 host sudo[3215]: pam_unix(sudo:session): session opened for user www-data(uid=33) by root(uid=0)
Sep 12 20:57:35 host sudo[3215]: pam_unix(sudo:session): session closed for user www-data
Sep 12 20:58:11 host sudo[3226]:     root : TTY=pts/0 ; PWD=/root ; USER=www-data ; COMMAND=/usr/bin/php -f /nextcloud/cron.php
Sep 12 20:58:11 host sudo[3226]: pam_unix(sudo:session): session opened for user www-data(uid=33) by root(uid=0)
Sep 12 20:58:11 host imaginary[868]: 127.0.0.1 - - [12/Sep/2026 18:58:11] "POST /pipeline?operations=%5B%7B%22operation%22%3A%22autorotate%22%7D%2C%7B%22operation%22[...]
Sep 12 20:58:11 host sudo[3226]: pam_unix(sudo:session): session closed for user www-data
user@host:~# 

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions