PHP memory problem when updating

The Basics

  • Nextcloud Server version (e.g., 29.x.x):
    • Nextcloud Hub 8 (29.0.4)
  • Operating system and version (e.g., Ubuntu 24.04):
    • Debian 12.10
  • Web server and version (e.g, Apache 2.4.25):
    • httpd 2.4.62-1~deb12u2
  • Reverse proxy and version _(e.g. nginx 1.27.2)
    • nginx 1.26.2-v.debian.12+p18.0.67.3+t250217.0844
  • PHP version (e.g, 8.3):
    • 8.3.19-debian.12.250314.0835
  • Is this the first time you’ve seen this error? (Yes / No):
    • yes
  • Are you using CloudfIare, mod_security, or similar? (Yes / No)
    • no

Summary of the issue you are facing:

When I launch :

sudo -u laurent /opt/plesk/php/8.3/bin/php --define apc.enable_cli=1 /var/www/vhosts/madonie.org/subdomains/nuage/updater/updater.phar

I get this error message

Verify integrity …PHP Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 250207432 bytes) in phar:///var/www/vhosts/madonie.org/subdomains/nuage/updater/updater.phar/lib/Updater.php on line 674

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.

{"reqId":"IlbEfI84YAlUo8mQpTtC","level":3,"time":"2023-09-26T11:45:01+00:00","remoteAddr":"","user":"--","app":"cron","method":"","url":"--","message":"Not installed","userAgent":"--","version":"","exception":{"Exception":"Exception","Message":"Not installed","Code":0,"Trace":[{"file":"/var/www/vhosts/madonie.org/subdomains/nuage/lib/base.php","line":709,"function":"checkInstalled","class":"OC","type":"::"},{"file":"/var/www/vhosts/madonie.org/subdomains/nuage/lib/base.php","line":1196,"function":"init","class":"OC","type":"::"},{"file":"/var/www/vhosts/madonie.org/subdomains/nuage/cron.php","line":43,"args":["/var/www/vhosts/madonie.org/subdomains/nuage/lib/base.php"],"function":"require_once"}],"File":"/var/www/vhosts/madonie.org/subdomains/nuage/lib/base.php","Line":283,"CustomMessage":"--"}}
{"reqId":"7kWlOuEerdghOmb0xSJj","level":3,"time":"2023-09-26T12:00:01+00:00","remoteAddr":"","user":"--","app":"cron","method":"","url":"--","message":"Not installed","userAgent":"--","version":"","exception":{"Exception":"Exception","Message":"Not installed","Code":0,"Trace":[{"file":"/var/www/vhosts/madonie.org/subdomains/nuage/lib/base.php","line":709,"function":"checkInstalled","class":"OC","type":"::"},{"file":"/var/www/vhosts/madonie.org/subdomains/nuage/lib/base.php","line":1196,"function":"init","class":"OC","type":"::"},{"file":"/var/www/vhosts/madonie.org/subdomains/nuage/cron.php","line":43,"args":["/var/www/vhosts/madonie.org/subdomains/nuage/lib/base.php"],"function":"require_once"}],"File":"/var/www/vhosts/madonie.org/subdomains/nuage/lib/base.php","Line":283,"CustomMessage":"--"}}

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!):

The current PHP memory limit is below the recommended value of 512MB.
{
    "system": {
        "passwordsalt": "***REMOVED SENSITIVE VALUE***",
        "secret": "***REMOVED SENSITIVE VALUE***",
        "trusted_domains": [
            "localhost",
            "nuage.madonie.org"
        ],
        "datadirectory": "***REMOVED SENSITIVE VALUE***",
        "dbtype": "mysql",
        "version": "29.0.4.1",
        "overwrite.cli.url": "http:\/\/localhost",
        "dbname": "***REMOVED SENSITIVE VALUE***",
        "dbhost": "***REMOVED SENSITIVE VALUE***",
        "dbport": "",
        "dbtableprefix": "oc_",
        "dbuser": "***REMOVED SENSITIVE VALUE***",
        "dbpassword": "***REMOVED SENSITIVE VALUE***",
        "installed": true,
        "instanceid": "***REMOVED SENSITIVE VALUE***",
        "default_phone_region": "FR",
        "maintenance": false,
        "theme": "",
        "loglevel": 0,
        "app_install_overwrite": [
            "occweb"
        ],
        "mail_smtpmode": "smtp",
        "mail_sendmailmode": "smtp",
        "mail_from_address": "***REMOVED SENSITIVE VALUE***",
        "mail_domain": "***REMOVED SENSITIVE VALUE***",
        "mail_smtpauthtype": "LOGIN",
        "mail_smtpauth": 1,
        "mail_smtphost": "***REMOVED SENSITIVE VALUE***",
        "mail_smtpname": "***REMOVED SENSITIVE VALUE***",
        "mail_smtppassword": "***REMOVED SENSITIVE VALUE***",
        "mail_smtpport": "993",
        "mail_smtpsecure": "ssl"
    }
}

PHP :
Version : 8.3.19
Limite de mémoire : 512 MB
Temps d’exécution maximal : 3600
Taille de téléversement maximale : 500 MB
Fréquence de revalidation de l’OPcache : 2
Extensions : Core, date, libxml, openssl, pcre, zlib, bz2, calendar, ctype, hash, filter, ftp, gettext, gmp, json, iconv, SPL, random, Reflection, session, standard, mbstring, SimpleXML, sockets, tokenizer, xml, cgi-fcgi, mysqlnd, bcmath, curl, dba, dom, enchant, fileinfo, gd, imagick, imap, intl, ldap, exif, mysqli, odbc, PDO, pdo_mysql, PDO_ODBC, pdo_pgsql, pdo_sqlite, pgsql, Phar, posix, pspell, redis, soap, sodium, sqlite3, sysvmsg, sysvsem, sysvshm, tidy, xmlreader, xmlwriter, xsl, zip, Zend OPcache

More details here :

Apps

Enabled:

  • activity: 2.21.1
  • circles: 29.0.0-dev
  • cloud_federation_api: 1.12.0
  • comments: 1.19.0
  • contactsinteraction: 1.10.0
  • dashboard: 7.9.0
  • dav: 1.30.1
  • federatedfilesharing: 1.19.0
  • federation: 1.19.0
  • files: 2.1.0
  • files_downloadlimit: 2.0.0
  • files_pdfviewer: 2.10.0
  • files_reminders: 1.2.0
  • files_sharing: 1.21.0
  • files_trashbin: 1.19.0
  • files_versions: 1.22.0
  • firstrunwizard: 2.18.0
  • forms: 4.2.4
  • logreader: 2.14.0
  • lookup_server_connector: 1.17.0
  • nextcloud_announcements: 1.18.0
  • notifications: 2.17.0
  • oauth2: 1.17.0
  • password_policy: 1.19.0
  • photos: 2.5.0
  • privacy: 1.13.0
  • provisioning_api: 1.19.0
  • recommendations: 2.1.0
  • related_resources: 1.4.0
  • serverinfo: 1.19.0
  • settings: 1.12.0
  • sharebymail: 1.19.0
  • support: 1.12.0
  • survey_client: 1.17.0
  • systemtags: 1.19.0
  • tasks: 0.16.0
  • text: 3.10.1
  • theming: 2.4.0
  • twofactor_backupcodes: 1.18.0
  • updatenotification: 1.19.1
  • user_status: 1.9.0
  • viewer: 2.3.0
  • weather_status: 1.9.0
  • workflowengine: 2.11.0
    Disabled:
  • admin_audit: 1.19.0
  • bruteforcesettings: 2.9.0
  • deck: 1.13.1 (installed 1.13.1)
  • encryption: 2.17.0
  • files_accesscontrol: 1.19.1 (installed 1.19.1)
  • files_external: 1.21.0
  • files_rightclick: 0.15.1 (installed 1.6.0)
  • groupfolders: 17.0.1 (installed 17.0.1)
  • occweb: 0.2.0 (installed 0.2.0)
  • suspicious_login: 7.0.0
  • twofactor_totp: 11.0.0-dev
  • user_ldap: 1.20.0

For the command line version, you normally have a different php.ini which in your case is set to a much lower value (128 MiB).

sudo -u laurent /opt/plesk/php/8.3/bin/php --ini

I’ve changed the memory_limit in /opt/plesk/php/8.3/etc/php.ini from 128M to 512M, and upgrade has worked. In fact I’ve made a first update of version 29, then an upgrade to version 30, and now I’m told I have version 31 available. Thank you for your help.

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