Uploading/viewing photos crashes Nextcloud Box

I am running a nextcloud box with RPI3 model B and the 29 march image. When viewing photos that have recently been uploaded, and for which no thumbnail has been generated yet, the box crashes or at least becomes completely unresponsive (not even a response to a Ping). Rebooting is the only solution.

In these cases, the last log entry (via Admin menu) is a PHP error indicating that memory was exhausted. For example:

Allowed memory size of 134217728 bytes exhausted (tried to allocate 12288 bytes) at /snap/nextcloud/1422/htdocs/lib/private/legacy/image.php#450

In some cases, the log also contains error indicating that the SQL server has crashed:

Doctrine\DBAL\Exception\DriverException: An exception occurred while executing 'SELECT `uid`, `displayname` FROM `oc_users` WHERE LOWER(`uid`) = LOWER(?)' with params ["peter"]: SQLSTATE[HY000]: General error: 2006 MySQL server has gone away

The only solution in these cases is to manually reboot the Box by cycling the power. This memory issue makes it unfit for purpose. Is there anything that can be done or reconfigured to prevent these freezes/crashes from happening?

Besides using the preview generator app to generate picture previews in the background automatically rather than on viewing the image, not really. The snap is still mostly read-only.

Thanks Jason, I’ll try and see whether that fixes it. If this is a common problem with the specs of the RPI, wouldn’t it make sense to include it in the standard configuration of the snap when installed on a Nextcloud box?

Last I checked it wasn’t an “official” app for some reason. It also requires adding a cronjob to ensure it runs, so it’s not so straightforward.

Good feedback to submit to github though if you like.