nextcloud / nextcloud/previewgenerator

preview:generate-all crashses without an error

Open
#641 9 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug needs info
Dominant language
PHP
Stars
520
Forks
55
PR merge metrics
No merged PRs in 30d

Description

While running "preview:generate-all", the app crashes without an error.

I usually read the output of "-vv" and check manually if the last file processed is working or not.
If the file is corrupted, I delete it through the browser (update database), and run the command again, only to crash on a different file

I tried to run the command using --workers=100, but eventually they all crash, quite on the same time
Perhaps they all try to process the same file?
(EDIT: Running 25 tasks, output log shows each worker died on a different file)

My suggestion is to change the forking mechanism to a "per media file" worker

  1. The main worker lists all media files;
  2. Main thread creates a child process;
  3. Handle the media file to child (path argument);
  4. Child generate preview;
  5. Child die;
  6. Return to 2 until list is empty;

--workers defaults to 1; user can input a greater value.
This logic will allow to process all files, without crashing the full queue and needing restart the process.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing preview:generate-all with -vv and different --workers values, then trace the command's worker and media-file processing flow. Done means a failure in one media file does not crash the full queue, remaining files continue processing, and the behavior is covered by an appropriate test or reproducible check.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
backend, cli
Issue type
Bug
Difficulty
5/5
Estimated time
Over a week
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.