Preview generate-all fails and requires restarting frequently

Nextcloud version 22.1.1
Operating system and version CENTOS 8
Apache or nginx version Apache/2.4.37 (centos)
PHP version 7.4.24

The issue you are facing:

Hi guys. I’m running a nextcloud instance for a small team of magazine staff, we have a few thousand jpegs and PNGs on here. Everything works great, however, each time I run the preview generate-all command, all files which already have previews are successfully scanned, between 10 and 100 new previews are generated, but then the command gives a no permitted exception, saying it can’t create a folder.

My apache web user 100% has read/write access to the folder, and I know this isnt the issue as it continues from where it left off just fine when entering the command again!
There is no mention of ANY of this in httpd log, nextcloud log, php-fpm log. PHP mem limit is 512MB.

The pre-generate command does nothing on my instance for some reason. I installed this nextcloud the other day so no previews are on the ‘old’ system. (I used the repair command to confirm this) AND there are no quotas, limits on my drive. file system is XFS.

I’m assuming this is some sort of error to do with hitting a memory limit, or the script being blocked from creating a folder for SOME reason?

My preview generator has been set to ONLY generate square preview size 32*32, and 512 size width and 512 size length. JPEG quality is 50. IE like this;

occ config:app:set previewgenerator squareSizes --value=“32”

occ config:app:set previewgenerator widthSizes --value=“512”

occ config:app:set previewgenerator heightSizes --value=“512”

Any help would be much appreciated, thanks! Currently needing to reinput the command every couple of minutes to generate all these previews -_-.

Blockquote
2021-10-01T12:19:26+00:00 Exception trace:
2021-10-01T12:19:26+00:00 at /home/cloud/public_html/lib/private/Files/Node/Folder.php:173
2021-10-01T12:19:26+00:00 OC\Files\Node\Folder->newFolder() at /home/cloud/public_html/lib/private/Files/AppData/AppData.php:156
2021-10-01T12:19:26+00:00 OC\Files\AppData\AppData->newFolder() at /home/cloud/public_html/lib/private/Preview/Storage/Root.php:74
2021-10-01T12:19:26+00:00 OC\Preview\Storage\Root->newFolder() at /home/cloud/public_html/lib/private/Preview/Generator.php:472
2021-10-01T12:19:26+00:00 OC\Preview\Generator->getPreviewFolder() at /home/cloud/public_html/lib/private/Preview/Generator.php:132
2021-10-01T12:19:26+00:00 OC\Preview\Generator->generatePreviews() at /home/cloud/public_html/lib/private/PreviewManager.php:204
2021-10-01T12:19:26+00:00 OC\PreviewManager->generatePreviews() at /home/cloud/public_html/apps/previewgenerator/lib/Command/Generate.php:203
2021-10-01T12:19:26+00:00 OCA\PreviewGenerator\Command\Generate->parseFile() at /home/cloud/public_html/apps/previewgenerator/lib/Command/Generate.php:174
2021-10-01T12:19:26+00:00 OCA\PreviewGenerator\Command\Generate->parseFolder() at /home/cloud/public_html/apps/previewgenerator/lib/Command/Generate.php:172
2021-10-01T12:19:26+00:00 OCA\PreviewGenerator\Command\Generate->parseFolder() at /home/cloud/public_html/apps/previewgenerator/lib/Command/Generate.php:172
2021-10-01T12:19:26+00:00 OCA\PreviewGenerator\Command\Generate->parseFolder() at /home/cloud/public_html/apps/previewgenerator/lib/Command/Generate.php:155
2021-10-01T12:19:26+00:00 OCA\PreviewGenerator\Command\Generate->generateUserPreviews() at /home/cloud/public_html/apps/previewgenerator/lib/Command/Generate.php:123
2021-10-01T12:19:26+00:00 OCA\PreviewGenerator\Command\Generate->OCA\PreviewGenerator\Command{closure}() at /home/cloud/public_html/lib/private/User/Manager.php:646
2021-10-01T12:19:26+00:00 OC\User\Manager->callForSeenUsers() at /home/cloud/public_html/apps/previewgenerator/lib/Command/Generate.php:124
2021-10-01T12:19:26+00:00 OCA\PreviewGenerator\Command\Generate->execute() at /home/cloud/public_html/3rdparty/symfony/console/Command/Command.php:255
2021-10-01T12:19:26+00:00 Symfony\Component\Console\Command\Command->run() at /home/cloud/public_html/3rdparty/symfony/console/Application.php:1009
2021-10-01T12:19:26+00:00 Symfony\Component\Console\Application->doRunCommand() at /home/cloud/public_html/3rdparty/symfony/console/Application.php:273
2021-10-01T12:19:26+00:00 Symfony\Component\Console\Application->doRun() at /home/cloud/public_html/3rdparty/symfony/console/Application.php:149
2021-10-01T12:19:26+00:00 Symfony\Component\Console\Application->run() at /home/cloud/public_html/lib/private/Console/Application.php:209
2021-10-01T12:19:26+00:00 OC\Console\Application->run() at /home/cloud/public_html/console.php:99
2021-10-01T12:19:26+00:00 require_once() at /home/cloud/public_html/occ:11
2021-10-01T12:19:26+00:00
2021-10-01T12:19:26+00:00 preview:generate-all [-p|–path [PATH]] [–] [<user_id>]