Skip to content

[Bug]: Memory of doctrine/dbal/src/Query/QueryBuilder.php reached 5GB #59018

@adriansev

Description

@adriansev

⚠️ This issue respects the following points: ⚠️

Bug description

I just updated the server installation to 33.0.0 (and moved to php 8.4) and in a fresh log i see this:

{"reqId":"lqNNNSYTxVEHwLn16NWi","level":3,"time":"2026-03-17T23:35:35+02:00","remoteAddr":"","user":"--","app":"PHP","method":"","url":"--","scriptName":"./cron.php","message":"Allowed memory size of 5368709120 bytes exhausted (tried to allocate 20480 bytes) at /var/www/nextcloud/3rdparty/doctrine/dbal/src/Query/QueryBuilder.php#1536","userAgent":"--","version":"33.0.0.16","occ_command":["./cron.php"],"data":{"app":"PHP"}}
{"reqId":"lqNNNSYTxVEHwLn16NWi","level":4,"time":"2026-03-17T23:35:35+02:00","remoteAddr":"","user":"--","app":"core","method":"","url":"--","scriptName":"./cron.php","message":"Request used 4.9 GB of memory. Memory limit: 5G","userAgent":"--","version":"33.0.0.16","occ_command":["./cron.php"],"data":{"app":"core"}}

Steps to reproduce

  1. I just updated the server (and moved to php 8.4)

Expected behavior

It's first time that i see this kind of messages .. the number of users is around 60, and i have this server for some time and i did not had memory errors.

Nextcloud Server version

33

Operating system

RHEL/CentOS

PHP engine version

PHP 8.4

Web server

Apache (supported)

Database engine version

MariaDB

Is this bug present after an update or on a fresh install?

Upgraded to a MAJOR version (ex. 31 to 32)

Are you using the Nextcloud Server Encryption module?

Encryption is Disabled

What user-backends are you using?

  • Default user-backend (database)
  • LDAP/ Active Directory
  • SSO - SAML
  • Other

Configuration report

{
    "system": {
        "maintenance": false,
        "installed": true,
        "instanceid": "***REMOVED SENSITIVE VALUE***",
        "serverid": 999,
        "passwordsalt": "***REMOVED SENSITIVE VALUE***",
        "secret": "***REMOVED SENSITIVE VALUE***",
        "version": "33.0.0.16",
        "overwrite.cli.url": "https:\/\/isscloud.spacescience.ro",
        "trusted_domains": [
            "localhost",
            "isscloud.spacescience.ro",
            "colloffice.spacescience.ro",
            "46.243.114.245"
        ],
        "datadirectory": "***REMOVED SENSITIVE VALUE***",
        "htaccess.RewriteBase": "\/",
        "dbtype": "mysql",
        "dbuser": "***REMOVED SENSITIVE VALUE***",
        "dbpassword": "***REMOVED SENSITIVE VALUE***",
        "dbname": "***REMOVED SENSITIVE VALUE***",
        "dbhost": "***REMOVED SENSITIVE VALUE***",
        "dbport": "",
        "dbtableprefix": "oc_",
        "mysql.utf8mb4": true,
        "default_language": "en",
        "default_locale": "ro",
        "default_phone_region": "RO",
        "default_timezone": "Europe\/Bucharest",
        "mail_domain": "***REMOVED SENSITIVE VALUE***",
        "mail_from_address": "***REMOVED SENSITIVE VALUE***",
        "allow_local_remote_servers": true,
        "trashbin_retention_obligation": "30,90",
        "log_type": "file",
        "logfile": "\/var\/log\/nextcloud.log",
        "logfile_audit": "\/var\/log\/nextcloud_audit.log",
        "loglevel": 3,
        "loglevel_frontend": 2,
        "logtimezone": "Europe\/Bucharest",
        "defaultapp": "dashboard,files",
        "enable_previews": false,
        "maintenance_window_start": 1,
        "memcache.local": "\\OC\\Memcache\\APCu",
        "memcache.distributed": "\\OC\\Memcache\\Redis",
        "memcache.locking": "\\OC\\Memcache\\Redis",
        "redis": {
            "host": "***REMOVED SENSITIVE VALUE***",
            "port": 6379,
            "timeout": 0,
            "read_timeout": 0,
            "user": "",
            "password": "***REMOVED SENSITIVE VALUE***",
            "dbindex": 0
        },
        "sharing.enable_mail_link_password_expiration": false,
        "sharing.mail_link_password_expiration_interval": 3600,
        "tempdirectory": "\/nextcloud\/tmp",
        "updatedirectory": "\/nextcloud\/update",
        "mail_smtpmode": "smtp",
        "mail_smtphost": "***REMOVED SENSITIVE VALUE***",
        "mail_sendmailmode": "smtp",
        "mail_smtpport": "587",
        "mail_smtpauth": true,
        "mail_smtpname": "***REMOVED SENSITIVE VALUE***",
        "mail_smtppassword": "***REMOVED SENSITIVE VALUE***",
        "app_install_overwrite": [],
        "theme": "",
        "trusted_proxies": "***REMOVED SENSITIVE VALUE***",
        "mail_smtpstreamoptions": {
            "ssl": {
                "allow_self_signed": false,
                "verify_peer": true,
                "verify_peer_name": true
            }
        }
    }
}

List of activated Apps

Enabled:
  - activity: 6.0.0-dev.0
  - admin_audit: 1.23.0
  - announcementbanner: 2.1.0
  - announcementcenter: 7.3.0
  - approval: 3.2.0
  - bookmarks: 16.1.3
  - bruteforcesettings: 6.0.0-dev.0
  - calendar: 6.2.1
  - calendar_resource_management: 0.11.0
  - circles: 33.0.0
  - cloud_federation_api: 1.17.0
  - comments: 1.23.0
  - contacts: 8.4.1
  - contactsinteraction: 1.14.1
  - dashboard: 7.13.0
  - dav: 1.36.0
  - deck: 1.17.0
  - drawio: 4.2.3
  - event_update_notification: 2.8.0
  - external: 8.0.0
  - federatedfilesharing: 1.23.0
  - files: 2.5.0
  - files_accesscontrol: 4.0.0
  - files_automatedtagging: 4.0.0
  - files_downloadlimit: 5.1.0-dev.0
  - files_external: 1.25.1
  - files_lock: 33.0.1
  - files_pdfviewer: 6.0.0-dev.0
  - files_reminders: 1.6.0
  - files_sharing: 1.25.2
  - files_trashbin: 1.23.0
  - files_versions: 1.26.0
  - files_zip: 2.3.0
  - firstrunwizard: 6.0.0-dev.0
  - flow_notifications: 4.0.0
  - forms: 5.2.5
  - fulltextsearch: 33.0.0
  - group_default_quota: 0.1.14
  - groupfolders: 21.0.6
  - groupquota: 0.2.4
  - integration_github: 3.2.2
  - integration_gitlab: 4.0.0
  - intros: 1.2.1
  - logcleaner: 1.3.4
  - logreader: 6.0.0
  - lookup_server_connector: 1.21.0
  - mail: 5.7.3
  - nextcloud_announcements: 5.0.0
  - notes: 4.13.0
  - notifications: 6.0.0
  - notify_push: 1.3.1
  - oauth2: 1.21.0
  - ownershiptransfer: 1.4.0
  - password_policy: 5.0.0-dev.0
  - passwords: 2026.2.20
  - photos: 6.0.0-dev.0
  - privacy: 5.0.0-dev.0
  - profile: 1.2.0
  - provisioning_api: 1.23.0
  - quota_warning: 1.23.0
  - recommendations: 6.0.0-dev.0
  - registration: 2.9.0
  - richdocuments: 10.1.0
  - serverinfo: 5.0.0-dev.0
  - settings: 1.16.0
  - sharebymail: 1.23.0
  - sharereview: 2.1.0
  - spreed: 23.0.1
  - support: 5.0.0
  - survey_client: 5.0.0-dev.0
  - suspicious_login: 11.0.0-dev.0
  - systemtags: 1.23.0
  - tables: 2.0.1
  - tasks: 0.17.1
  - text: 7.0.0-dev.3
  - theming: 2.8.0
  - twofactor_backupcodes: 1.22.0
  - twofactor_totp: 15.0.0-dev.0
  - updatenotification: 1.23.0
  - user_status: 1.13.0
  - user_usage_report: 4.0.0
  - viewer: 6.0.0-dev.0
  - weather_status: 1.13.0
  - webhook_listeners: 1.5.0
  - workflow_script: 4.0.0
  - workflowengine: 2.15.0
Disabled:
  - app_api: 33.0.0 (installed 32.0.0)
  - encryption: 2.21.0
  - federation: 1.23.0 (installed 1.20.0)
  - related_resources: 4.0.0-dev.0 (installed 1.5.0)
  - twofactor_nextcloud_notification: 7.0.0 (installed 6.0.0-dev.0)
  - user_ldap: 1.24.0

Nextcloud Signing status

Technical information
=====================
The following list covers which files have failed the integrity check. Please read
the previous linked documentation to learn more about the errors and how to fix
them.

Results
=======
- core
	- INVALID_HASH
		- core/js/mimetypelist.js

Raw output
==========
Array
(
    [core] => Array
        (
            [INVALID_HASH] => Array
                (
                    [core/js/mimetypelist.js] => Array
                        (
                            [expected] => cb945c6402e12d9e7d42d0359acf95a6e9a9b0c1f3bd8528f598a7fb1694e5ae34c80cf44ef6c8901eac1bfdd152de3315fc7eac007efee0f33f09ed3e518b6a
                            [current] => aae4144b8e0cd02180fd16f090cc7e7e5adc54b98963a14e4ab272ee3847f70ebece4f2dc658fb367bf84ae55926c4e9c938256a6a0801911300b53998b3f30f
                        )

                )

        )

)

Nextcloud Logs

{"reqId":"lqNNNSYTxVEHwLn16NWi","level":3,"time":"2026-03-17T23:35:35+02:00","remoteAddr":"","user":"--","app":"PHP","method":"","url":"--","scriptName":"./cron.php","message":"Allowed memory size of 5368709120 bytes exhausted (tried to allocate 20480 bytes) at /var/www/nextcloud/3rdparty/doctrine/dbal/src/Query/QueryBuilder.php#1536","userAgent":"--","version":"33.0.0.16","occ_command":["./cron.php"],"data":{"app":"PHP"}}
{"reqId":"lqNNNSYTxVEHwLn16NWi","level":4,"time":"2026-03-17T23:35:35+02:00","remoteAddr":"","user":"--","app":"core","method":"","url":"--","scriptName":"./cron.php","message":"Request used 4.9 GB of memory. Memory limit: 5G","userAgent":"--","version":"33.0.0.16","occ_command":["./cron.php"],"data":{"app":"core"}}

Additional info

With the major update i switched from php 8.3 to 8.4

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions