PHP Fatal error: Allowed memory size of 134217728 bytes exhausted /lib/private/App/AppStore/Fetcher/Fetcher.php on line 100

Some or all of the below information will be requested if it isn’t supplied; for fastest response please provide as much as you can. :heart:

The Basics

  • Nextcloud Server version (e.g., 29.x.x):
    • Nextcloud Hub 10 (31.0.4)
  • Operating system and version (e.g., Ubuntu 24.04):
    • Ubuntu 22.04.5 LTS
  • Web server and version (e.g, Apache 2.4.25):
    • Apache 2.4
  • Reverse proxy and version _(e.g. nginx 1.27.2)
    • nginx
  • PHP version (e.g, 8.3):
    • PHP 8.4
  • Is this the first time you’ve seen this error? (Yes / No):
    • yes
  • When did this problem seem to first start?
    • 9 may 2025
  • Installation method (e.g. AlO, NCP, Bare Metal/Archive, etc.)
    • web setup
  • Are you using CloudfIare, mod_security, or similar? (Yes / No)
    • no

Summary of the issue you are facing:

At about 5:30 AM Europe/Rome I receive an email alert about cronjob error:

PHP Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 20480 bytes) in /nextcloud/lib/private/App/AppStore/Fetcher/Fetcher.php on line 100

I setup the PHP memory from 256 MB to be 1 GB but the issue persist.

Log entries

Nextcloud

Please provide the log entries from your Nextcloud log that are generated during the time of problem (via the Copy raw option from Administration settings->Logging screen or from your nextcloud.log located in your data directory). Feel free to use a pastebin/gist service if necessary.

PASTE HERE

Web Browser

If the problem is related to the Web interface, open your browser inspector Console and Network tabs while refreshing (reloading) and reproducing the problem. Provide any relevant output/errors here that appear.

Firefox

Web server / Reverse Proxy

The output of your Apache/nginx/system log in /var/log/____:

PASTE HERE

Configuration

Nextcloud

The output of occ config:list system or similar is best, but, if not possible, the contents of your config.php file from /path/to/nextcloud is fine (make sure to remove any identifiable information!):

PASTE HERE

Apps

The output of occ app:list (if possible).

The current PHP memory limit is below the recommended value of 512MB.
Enabled:
  - activity: 4.0.0
  - app_api: 5.0.2
  - bruteforcesettings: 4.0.0
  - calendar: 5.2.3
  - circles: 31.0.0
  - cloud_federation_api: 1.14.0
  - comments: 1.21.0
  - contacts: 7.0.6
  - contactsinteraction: 1.12.0
  - dashboard: 7.11.0
  - dav: 1.33.0
  - federatedfilesharing: 1.21.0
  - federation: 1.21.0
  - files: 2.3.1
  - files_automatedtagging: 2.0.0
  - files_downloadlimit: 4.0.0
  - files_pdfviewer: 4.0.0
  - files_reminders: 1.4.0
  - files_retention: 2.0.1
  - files_sharing: 1.23.1
  - files_trashbin: 1.21.0
  - files_versions: 1.24.0
  - firstrunwizard: 4.0.0
  - logreader: 4.0.0
  - lookup_server_connector: 1.19.0
  - nextcloud_announcements: 3.0.0
  - notes: 4.12.0
  - notifications: 4.0.0
  - oauth2: 1.19.1
  - password_policy: 3.0.0
  - passwords: 2025.4.20
  - photos: 4.0.0-dev.1
  - privacy: 3.0.0
  - profile: 1.0.0
  - provisioning_api: 1.21.0
  - recommendations: 4.0.0
  - related_resources: 2.0.0
  - richdocuments: 8.6.4
  - richdocumentscode: 24.4.1303
  - serverinfo: 3.0.0
  - settings: 1.14.0
  - sharebymail: 1.21.0
  - spreed: 21.0.4
  - support: 3.0.0
  - survey_client: 3.0.0
  - suspicious_login: 9.0.1
  - systemtags: 1.21.1
  - text: 5.0.0
  - theming: 2.6.1
  - theming_customcss: 1.18.0
  - twofactor_backupcodes: 1.20.0
  - twofactor_totp: 13.0.0-dev.0
  - twofactor_webauthn: 2.1.0
  - updatenotification: 1.21.0
  - user_status: 1.11.0
  - viewer: 4.0.0
  - weather_status: 1.11.0
  - webhook_listeners: 1.2.0
  - workflowengine: 2.13.0
Disabled:
  - admin_audit: 1.21.0
  - encryption: 2.19.0
  - files_external: 1.23.0
  - twofactor_nextcloud_notification: 5.0.0 (installed 3.10.0)
  - user_ldap: 1.22.0

How can I set a higher php memory?
I tried the command sudo snap set nextcloud php.memory-limit=512M run on the root directory from the root user but gives the error : error: snap "nextcloud" not found

On the page index.php/settings/admin/serverinfo I can see PHP memory limit is 1000

Seems you don’t using the Nextcloud Snap then. How exactley did you install Nextcloud?

The cron script uses the PHP command line interface, which has a separate configuration file. In case you installed Nextcloud manually on Linux with a LAMP/LEMP stack, you can either edit the value in the respective php.ini file…

The following command should open the correct file in nano:

PHP_VERSION=$(php -r 'echo PHP_MAJOR_VERSION . "." . PHP_MINOR_VERSION;') && \
sudo nano /etc/php/"$PHP_VERSION"/cli/php.ini

…or you could add the following argument to your cronjob:

-d memory_limit=512M

Example:

*/5 * * * * php -d memory_limit=512M -f /var/www/html/nextcloud/cron.php
1 Like

Thank you for your kind and very detailed reply!

I installed using the PHP script web install from the community.

The command

PHP_VERSION=$(php -r 'echo PHP_MAJOR_VERSION . "." . PHP_MINOR_VERSION;') && \
sudo nano /etc/php/"$PHP_VERSION"/cli/php.ini

Just open a not existing directory, maybe because I’m using Plesk and PHP is given by Plesk.

I will try to add

-d memory_limit=512M

to the cronjob.

Example:

*/5 * * * * php -d memory_limit=512M -f /var/www/html/nextcloud/cron.php

Thanks for the example, very useful.

I found on Plesk I need to go on Tool & Settings, PHP settings then open the current 8.4 PHP and in the php.ini tab edit the memory from 128 to be more high value.

Now the memory alert when run occ app:list is no more showed.

1 Like

Yes, Plesk keeps configuration files somewhere else, and I’m also not sure if you are supposed to edit them directly.

Glad you figured it out :+1:

Thank you very much for your precious help!
:folded_hands:t4::heart::partying_face:

1 Like

This topic was automatically closed 8 days after the last reply. New replies are no longer allowed.