Nexcloud in docker on raspberrypi 4 (with 8GB mem) - preview generator memory error message

Hi all,

I installed the latest version of nexcloud in docker and try to make preview generator work to handle my photo library smoothly because without it it is just damn slow and unusable.
But I bump into memory issue while I have the following parameter in my docker compose file:
- PHP_MEMORY_LIMIT=1024M

version of nextcloud:
Nextcloud Hub (25.0.3)

and the error message I get is the following:

root@06a6ff06b76e:/var/www/html# sudo -u www-data /var/www/html/occ preview:generate-all
Warning: Failed to set memory limit to 0 bytes (Current memory usage is 2097152 bytes) in Unknown on line 0
The current PHP memory limit is below the recommended value of 512MB.

and after a dozens of pics being processed I get the following and it stops:
PHP Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 12288 bytes) in /var/www/html/lib/private/legacy/OC_Image.php on line 530

I searched everywhere still could not find a solution for that issue, any help would be greatly appreciated.

Did you try sudo -u www-data -E php /var/www/html/occ preview:generate-all

excellent that was that easy!!! :grin: Thx
works now, it does not through any error and scan my folders.

Only thing is that I may have missunderstood what preview generator does even though the name is quite explicit.

But looks like it does not improve loading time of thumbnails either in folder view or photo view so not sure if there is anything else I need to do to tell the app to look somewhere for thumbnails that are preloaded???

Check this string against previous solutions on the forum.

https://help.nextcloud.com/search?context=topic&context_id=154118&q=The%20current%20PHP%20memory%20limit%20is%20below%20the%20recommended%20value%20of%20512MB.&skip_context=true