Nextcloud: PHP Fatal error

I’m getting the following message sent to me at least once a day:

PHP Fatal error: Allowed memory size of 536870912 bytes exhausted (tried to allocate 20480 bytes) in /usr/share/nextcloud/apps/files_external/3rdparty/icewind/smb/src/Native/NativeFileInfo.php on line 46

beside this message I dont notice any problems.
nevertheless, can I do anything about this?

Could be an old bug, is your Nethserver up to date? Which Nextcloud version are you using?

Here’s another thread with a similar error about no space left in /tmp.

NethServer 7.9.2009, aplying all updates automaticaly.
Nextcloud 1.18.0

Maybe it’s a problem with the cron job?

would be worth a try. where would I find the php.ini for the nextcloud?

Nextcloud specific php is configured in /etc/opt/rh/rh-php73/php-fpm.d/000-nextcloud.conf, the general php.ini is in /etc/opt/rh/rh-php73/php.ini

there is already apc.enable_cli=1 on the crontab call, does it make sens to rise the memory limit: memory_limit=512M

You may try it.

Are there Nextcloud app updates? Maybe some 3rd party app needs an update that fixes the issue…

Did not change anything. There where some updates to apply but the error keeps coming. Still once or twice a day.

The error seems related to Nextcloud SMB/CIFS external storage. If you don’t use external storage, disabling the app may solve the issue.

Can you reproduce the error on command line when running following command?

sudo -u apache /usr/bin/scl enable rh-php73 -- php -d memory_limit=512M -d apc.enable_cli=1 -f /usr/share/nextcloud/cron.php

I use external storage.

No error when running the command from the cli

Please check configuration if there are old/unused shares. Are there older devices involved (ie. NAS)?

Is it always the same time when the error occurs? Are there other file operations running at this time?

What do you mean older devices? yes there is a NAS involved its a uptodate freenas.

ist always the same times, twice a day around 3 am and 3 pm.

There were issues with older NAS or Systems that still used SMBv1.

You may also check logfiles like /var/log/messages to hopefully get more information about the error.

Sorry, I’m out of ideas. Maybe reinstalling/reconfiguring the external storage app?