nextcloud / nextcloud/previewgenerator
disabling the background job does not disable the preview generation in `cron.php`
Nobody has claimed this yet.
- Dominant language
- PHP
- Stars
- 520
- Forks
- 55
- PR merge metrics
- No merged PRs in 30d
Description
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
- make sure the background job is disabled
- verify the preview-queue is empty
- upload a picture right after a run of the systemd-service
occ preview:pre-generate - verify that there is now a picture in the preview-queue
- run
cron.php - the background job of
cron.phpsends 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.
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:~#
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with cron.php and the README.md section describing previewgenerator job_disabled, then trace how the cron background job reads that setting. Reproduce with preview:queue-stats, an uploaded picture, and cron.php while the setting is enabled. Done means cron.php no longer creates or processes a preview when the default job is disabled.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- php
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 68/100