Fatal Memory (OOM) while upgrading to 30.X

Nextcloud version (eg, 29.0.5): 30.0.2
Operating system and version (eg, Ubuntu 24.04): docker

The issue you are facing:

Is this the first time you’ve seen this error? (Y/N): Y

Steps to replicate it:

  1. Started the Upgrade via ./occ upgrade
  2. Failed with “Killed”
  3. Started the ./occ maintaince:repair
  4. Fails with OOM Error

When updating nextcloud with the occ upgrade command the upgrade fails after some time with the error “Killed”. Running the ./occ maintaince:repair shows output until “- Clean tags and favorites”, and stays there while consuming more and more RAM until the command breaks with this error:

PHP Fatal error: Allowed memory size of 4294967296 bytes exhausted (tried to allocate 262144 bytes) in /var/www/html/lib/private/AppFramework/Utility/SimpleContainer.php on line 120` PHP Fatal error: Allowed memory size of 4294967296 bytes exhausted (tried to allocate 262144 bytes) in /var/www/html/lib/private/Log/ErrorHandler.php on line 36

The container is limited to 4GB, which was already upped from 2GB to midigate the issue but it did not help.

Any idea why that step is consuming so much RAM?

It reminds me of an issue I recently faced on my Ubuntu server. Unfortunately, I don’t know the other details of how you have it set up. However, I managed to resolve it, as I mentioned in this thread.

Without more info we’re just making wild guesses. You seem to have removed a few sections of the support template.

  • What Docker image are running Nextcloud in?
  • What is your config (occ config:list system)?
  • What apps do you have installed (occ app:list)?
  • What PHP version?
  • Where during the occ upgrade run is this occurring?

The image and version:
image: nextcloud:30

The config (some information removed due to privacy resons:

Nextcloud or one of the apps require upgrade - only a limited number of commands are available
You may use your browser or the occ upgrade command to do the upgrade
{
    "system": {
        "htaccess.RewriteBase": "\/",
        "memcache.local": "\\OC\\Memcache\\APCu",
        "apps_paths": [
            {
                "path": "\/var\/www\/html\/apps",
                "url": "\/apps",
                "writable": false
            },
            {
                "path": "\/var\/www\/html\/custom_apps",
                "url": "\/custom_apps",
                "writable": true
            }
        ],
        "memcache.distributed": "\\OC\\Memcache\\Redis",
        "memcache.locking": "\\OC\\Memcache\\Redis",
        "redis": {
            "host": "***REMOVED SENSITIVE VALUE***",
            "password": "***REMOVED SENSITIVE VALUE***",
            "port": 6379
        },
        "overwriteprotocol": "https",
        "trusted_proxies": "***REMOVED SENSITIVE VALUE***",
        "passwordsalt": "***REMOVED SENSITIVE VALUE***",
        "secret": "***REMOVED SENSITIVE VALUE***",
        "trusted_domains": {
            "0": "localhost",
            "2": "app_13689",
            "1": "cloud.redacted-for-privacy.de"
        },
        "datadirectory": "***REMOVED SENSITIVE VALUE***",
        "dbtype": "mysql",
        "version": "29.0.5.1",
        "overwrite.cli.url": "https:\/\/cloud.redacted-for-privacy.de",
        "dbname": "***REMOVED SENSITIVE VALUE***",
        "dbhost": "***REMOVED SENSITIVE VALUE***",
        "dbport": "",
        "dbtableprefix": "oc_",
        "mysql.utf8mb4": true,
        "dbuser": "***REMOVED SENSITIVE VALUE***",
        "dbpassword": "***REMOVED SENSITIVE VALUE***",
        "installed": true,
        "instanceid": "***REMOVED SENSITIVE VALUE***",
        "mail_smtpmode": "smtp",
        "mail_smtphost": "***REMOVED SENSITIVE VALUE***",
        "mail_smtpport": "25",
        "mail_smtpauthtype": "LOGIN",
        "mail_from_address": "***REMOVED SENSITIVE VALUE***",
        "mail_domain": "***REMOVED SENSITIVE VALUE***",
        "default_locale": "de_DE",
        "default_language": "de",
        "default_phone_region": "DE",
        "auth.bruteforce.protection.enabled": "false",
        "simpleSignUpLink.shown": false,
        "maintenance": true,
        "logLevel": "2",
        "log_type": "file",
        "logfile": "\/data\/nextcloud.log",
        "loglevel": 0,
        "ldapProviderFactory": "OCA\\User_LDAP\\LDAPProviderFactory",
        "mail_sendmailmode": "smtp",
        "mail_smtpauth": 1,
        "mail_smtpname": "***REMOVED SENSITIVE VALUE***",
        "mail_smtppassword": "***REMOVED SENSITIVE VALUE***",
        "skeletondirectory": "",
        "app_install_overwrite": [
            "xwiki"
        ],
        "maintenance_window_start": 1,
        "theme": ""
    },
    "apps": {
        "activity": {
            "enabled": "yes",
            "installed_version": "3.0.0",
            "types": "filesystem"
        },
        "analytics": {
            "enabled": "[\"admin\"]",
            "installed_version": "5.0.1",
            "types": ""
        },
        "app_api": {
            "enabled": "yes",
            "installed_version": "4.0.0",
            "types": ""
        },
        "appointments": {
            "enabled": "[\"Nextcloud-Admins\",\"admin\"]",
            "hk": "03b884938660891ea5fb85ddb517e651fb457caea793e6a999db9459890fdb1c",
            "installed_version": "2.1.12",
            "tiv": "94f68611e2e1d8eebf32adccbf9c6bf4",
            "types": "dav"
        },
        "audioplayer": {
            "enabled": "yes",
            "installed_version": "3.4.1",
            "types": "filesystem"
        },
        "backgroundjob": {
            "lastjob": "19989"
        },
        "bruteforcesettings": {
            "enabled": "yes",
            "installed_version": "3.0.0",
            "types": ""
        },
        "calendar": {
            "enabled": "no",
            "installed_version": "4.7.16",
            "types": ""
        },
        "circles": {
            "enabled": "yes",
            "installed_version": "30.0.0",
            "loopback_tmp_scheme": "https",
            "maintenance_run": "0",
            "maintenance_update": "{\"3\":1731325855,\"2\":1731328252,\"1\":1731328252}",
            "migration_22": "1",
            "migration_run": "0",
            "types": "filesystem,dav"
        },
        "cloud_federation_api": {
            "enabled": "yes",
            "installed_version": "1.13.0",
            "types": "filesystem"
        },
        "comments": {
            "enabled": "yes",
            "installed_version": "1.20.1",
            "types": "logging"
        },
        "contacts": {
            "enabled": "no",
            "installed_version": "6.0.0",
            "types": "dav"
        },
        "contactsinteraction": {
            "enabled": "yes",
            "installed_version": "1.11.0",
            "types": "dav"
        },
        "cookbook": {
            "enabled": "[\"Nextcloud-Admins\"]",
            "installed_version": "0.11.2",
            "types": ""
        },
        "core": {
            "backgroundjobs_mode": "cron",
            "emailTestSuccessful": "1",
            "files_metadata_installed": "1",
            "installedat": "1680090880.9656",
            "lastcron": 1731328259,
            "lastupdateResult": "{\"version\":\"29.0.9.2\",\"versionstring\":\"Nextcloud 29.0.9\",\"url\":\"https:\\\/\\\/download.nextcloud.com\\\/server\\\/releases\\\/nextcloud-29.0.9.zip\",\"web\":\"https:\\\/\\\/docs.nextcloud.com\\\/server\\\/29\\\/admin_manual\\\/maintenance\\\/upgrade.html\",\"changes\":\"https:\\\/\\\/updates.nextcloud.com\\\/changelog_server\\\/?version=29.0.9\",\"autoupdater\":\"1\",\"eol\":\"0\"}",
            "lastupdatedat": 1731318433,
            "metadataGenerationDone": true,
            "moveavatarsdone": "yes",
            "previewsCleanedUp": "1",
            "public_files": "files_sharing\/public.php",
            "public_webdav": "dav\/appinfo\/v1\/publicwebdav.php",
            "updater.secret.created": "1687509500",
            "vendor": "nextcloud",
            "files_metadata": {
                "photos-original_date_time": {
                    "value": null,
                    "type": "int",
                    "etag": "",
                    "indexed": true,
                    "editPermission": 0
                },
                "photos-size": {
                    "value": null,
                    "type": "array",
                    "etag": "",
                    "indexed": false,
                    "editPermission": 0
                },
                "photos-exif": {
                    "value": null,
                    "type": "array",
                    "etag": "",
                    "indexed": false,
                    "editPermission": 0
                },
                "photos-ifd0": {
                    "value": null,
                    "type": "array",
                    "etag": "",
                    "indexed": false,
                    "editPermission": 0
                },
                "photos-gps": {
                    "value": null,
                    "type": "array",
                    "etag": "",
                    "indexed": false,
                    "editPermission": 0
                },
                "photos-place": {
                    "value": null,
                    "type": "string",
                    "etag": "",
                    "indexed": true,
                    "editPermission": 0
                },
                "blurhash": {
                    "value": null,
                    "type": "string",
                    "etag": "b8d19659b1ef3db5f7025469d186d420",
                    "indexed": false,
                    "editPermission": 0
                },
                "files-live-photo": {
                    "value": null,
                    "type": "string",
                    "etag": "",
                    "indexed": false,
                    "editPermission": 1
                }
            },
            "oc.integritycheck.checker": []
        },
    }
}

The apps:

Enabled:
  - activity: 3.0.0
  - analytics: 5.0.1
  - app_api: 4.0.0
  - appointments: 2.1.12
  - audioplayer: 3.4.1
  - bruteforcesettings: 3.0.0
  - circles: 30.0.0
  - cloud_federation_api: 1.13.0
  - comments: 1.20.1
  - contactsinteraction: 1.11.0
  - cookbook: 0.11.2
  - dashboard: 7.10.0
  - dav: 1.31.1
  - drawio: 3.0.3
  - federatedfilesharing: 1.20.0
  - federation: 1.20.0
  - files: 2.2.0
  - files_downloadlimit: 3.0.0
  - files_pdfviewer: 3.0.0
  - files_reminders: 1.3.0
  - files_sharing: 1.22.0
  - files_trashbin: 1.20.1
  - files_versions: 1.23.0
  - firstrunwizard: 3.0.0
  - forms: 4.3.3
  - logreader: 3.0.0
  - lookup_server_connector: 1.18.0
  - mail: 4.0.2
  - nextcloud_announcements: 2.0.0
  - notes: 4.11.0
  - notifications: 3.0.0
  - notify_push: 0.7.0
  - oauth2: 1.18.1
  - passman: 2.4.11
  - password_policy: 2.0.0
  - photos: 3.0.2
  - polls: 7.2.4
  - privacy: 2.0.0
  - provisioning_api: 1.20.0
  - quota_warning: 1.20.0
  - recommendations: 3.0.0
  - related_resources: 1.5.0
  - serverinfo: 2.0.0
  - settings: 1.13.0
  - sharebymail: 1.20.0
  - support: 2.0.0
  - survey_client: 2.0.0
  - systemtags: 1.20.0
  - tasks: 0.16.1
  - text: 4.1.0
  - theming: 2.5.0
  - twofactor_backupcodes: 1.19.0
  - updatenotification: 1.20.0
  - user_ldap: 1.21.0
  - user_status: 1.10.0
  - viewer: 3.0.0
  - weather_status: 1.10.0
  - webhook_listeners: 1.1.0-dev
  - workflowengine: 2.12.0
Disabled:
  - admin_audit: 1.20.0
  - calendar: 4.7.16 (installed 4.7.16)
  - contacts: 6.0.0 (installed 6.0.0)
  - deck: 1.13.2 (installed 1.13.2)
  - encryption: 2.18.0
  - external: 5.4.1 (installed 5.4.1)
  - files_external: 1.22.0
  - files_rightclick: 0.15.1 (installed 1.6.0)
  - groupfolders: 17.0.5 (installed 17.0.5)
  - richdocuments: 8.4.8 (installed 8.4.8)
  - spreed: 19.0.11 (installed 19.0.11)
  - suspicious_login: 8.0.0
  - twofactor_nextcloud_notification: 4.0.0
  - twofactor_totp: 12.0.0-dev

The php version:
PHP 8.2.25 (cli) (built: Oct 28 2024 22:10:56) (NTS)

The Update seems to stop directly after:
Updated database

Without any clue in the logs what was going wrong i decided to restore the database container files from backup. After restoring from backup the upgrade process worked just fine within a few minutes.

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