Skip to content

Excessive memory allocation in 20.0.6 #25343

Description

@ebogaard

After upgrading from 19.0.7 to 20.0.6, we started running into all kinds of issues with the files app, the settings page, the weather item on the desktop and syncing using the Desktop application.
These items would just give a 500 error or otherwise show a blank page.

Other apps, like the new desktop itself, photos, user page, et cetera, would work as expected.

This only occurred on one of our Nextcloud installs. On two other installs these problems aren't experienced and the mentioned features do work. These were upgraded to a 20.0.x version before upgrading to 20.0.6, though. I'm not sure if that matters.

In the logfile I see a number of memory allocation issues, so I increased the php max memory option from 512 MB to 768 MB, but that did not change things. Still php-fpm seems to crash.

See attached logs and app list below.

Steps to reproduce

  1. Upgrade from 19.0.7 to 20.0.6
  2. Open the features mentioned in the introduction

Expected behaviour

These should show the relevant information.

Actual behaviour

Blank pages are shown and a lot of issues in the browser console.

Server configuration

Operating system:
Centos 7 x64

Web server:
httpd 2.4.46.

Database:
MariaDB 10.3

PHP version:
7.4.17

Nextcloud version: (see Nextcloud admin page)
20.0.6

Updated from an older Nextcloud/ownCloud or fresh install:
19.0.7

**Where did you install Nextcloud from:If you have access to your command line run e.g.:
sudo -u www-data php occ app:list
from within your Nextcloud installation folder

Manually, with the bzip-archive

Signing status:

Signing status
Login as admin user into your Nextcloud and access 
http://example.com/index.php/settings/integrity/failed 
paste the results here.

List of activated apps:

App list
Enabled:
  - accessibility: 1.6.0
  - activity: 2.13.4
  - admin_audit: 1.10.0
  - cloud_federation_api: 1.3.0
  - comments: 1.10.0
  - contactsinteraction: 1.1.0
  - dashboard: 7.0.0
  - dav: 1.16.2
  - deck: 1.2.3If you have access to your command line run e.g.:
sudo -u www-data php occ app:list
from within your Nextcloud installation folder
  - drawio: 0.9.8
  - federatedfilesharing: 1.10.2
  - files: 1.15.0
  - files_fulltextsearch: 20.0.0
  - files_markdown: 2.3.1
  - files_pdfviewer: 2.0.1
  - files_rightclick: 0.17.0
  - files_sharing: 1.12.1
  - files_trashbin: 1.10.1
  - files_versions: 1.13.0
  - files_videoplayer: 1.9.0
  - fulltextsearch: 20.0.0
  - fulltextsearch_elasticsearch: 20.0.0
  - impersonate: 1.7.0
  - lookup_server_connector: 1.8.0
  - nextcloud_announcements: 1.9.0
  - notes: 4.0.2
  - notifications: 2.8.0
  - oauth2: 1.8.0
  - password_policy: 1.10.1
  - photos: 1.2.1
  - privacy: 1.4.0
  - provisioning_api: 1.10.0
  - recommendations: 0.8.0
  - richdocuments: 3.7.11
  - serverinfo: 1.10.0
  - settings: 1.2.0
  - sharebymail: 1.10.0
  - spreed: 10.0.5
  - support: 1.3.0
  - systemtags: 1.10.0
  - text: 3.1.0
  - theming: 1.11.0
  - twofactor_backupcodes: 1.9.0
  - updatenotification: 1.10.0
  - user_ldap: 1.10.2
  - user_saml: 3.3.3
  - user_status: 1.0.1
  - viewer: 1.4.0
  - weather_status: 1.0.0
  - workflow_pdf_converter: 1.5.1
  - workflowengine: 2.2.0
Disabled:
  - encryption
  - federation
  - files_external
  - firstrunwizard
  - logreader
  - survey_client

Nextcloud configuration:

Config report
If you have access to your command line run e.g.:
sudo -u www-data php occ config:list system
from within your Nextcloud installation folder

or 

Insert your config.php content here. 
Make sure to remove all sensitive content such as passwords. (e.g. database password, passwordsalt, secret, smtp password, …)

Are you using external storage, if yes which one: local/smb/sftp/...
no

Are you using encryption: yes/no
no

Are you using an external user-backend, if yes which one: LDAP/ActiveDirectory/Webdav/...
LDAP + SAML

Logs

Web server error log

Web server error log
# PHP-FPM LOG
[26-Jan-2021 23:24:59] WARNING: [pool www] child 846048 exited on signal 11 (SIGSEGV) after 4.775973 seconds from start
[26-Jan-2021 23:28:57] WARNING: [pool www] child 846096 exited on signal 11 (SIGSEGV) after 238.130298 seconds from start
[26-Jan-2021 23:30:00] WARNING: [pool www] child 844879 exited on signal 11 (SIGSEGV) after 749.179765 seconds from start
[26-Jan-2021 23:30:45] WARNING: [pool www] child 845338 exited on signal 11 (SIGSEGV) after 513.518508 seconds from start

[26-Jan-2021 22:21:52 UTC] PHP Fatal error:  Allowed memory size of 805306368 bytes exhausted (tried to allocate 63700217028 bytes) in /var/www/html/nextcloud-20.0.6/3rdparty/guzzlehttp/guzzle/src/functions.php on line 3185760160
[26-Jan-2021 22:25:03 UTC] PHP Fatal error:  Allowed memory size of 805306368 bytes exhausted (tried to allocate 25587398412 bytes) in /var/www/html/nextcloud-20.0.6/3rdparty/guzzlehttp/guzzle/src/functions.php on line 3185760160
[26-Jan-2021 22:25:09 UTC] PHP Fatal error:  Allowed memory size of 805306368 bytes exhausted (tried to allocate 146288530508 bytes) in /var/www/html/nextcloud-20.0.6/3rdparty/guzzlehttp/guzzle/src/functions.php on line 3185760160

# HTTPD ERROR-LOG
[Tue Jan 26 23:28:57.644443 2021] [proxy_fcgi:error] [pid 845600:tid 140468415313664] (104)Connection reset by peer: [client xxx:28436] AH01075: Error dispatching request to :
[Tue Jan 26 23:30:00.130119 2021] [proxy_fcgi:error] [pid 845600:tid 140468499240704] [client xxx:28506] AH01067: Failed to read FastCGI header
[Tue Jan 26 23:30:00.130208 2021] [proxy_fcgi:error] [pid 845600:tid 140468499240704] (104)Connection reset by peer: [client xxx:28506] AH01075: Error dispatching request to :
[Tue Jan 26 23:30:45.238423 2021] [proxy_fcgi:error] [pid 845600:tid 140468398528256] [client xxx:28584] AH01067: Failed to read FastCGI header

Nextcloud log (data/nextcloud.log)

Nextcloud log
{"reqId":"YBCUadtdwL7FeBl5b945vAAAAIY","level":2,"time":"2021-01-26 23:15:05","remoteAddr":"xxx","user":"admin@xxx","app":"fulltextsearch","method":"GET","url":"/ocs/v2.php/search/providers/fulltextsearch/search?term=saml&from=%2Fsettings%2Fapps","message":"FullTextSearchPlatform OCA\\FullTextSearch_ElasticSearch\\Platform\\ElasticSearchPlatform is not available","userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:84.0) Gecko/20100101 Firefox/84.0","version":"20.0.6.1"}
{"reqId":"YBCUadtdwL7FeBl5b945wgAAAII","level":3,"time":"2021-01-26 23:15:06","remoteAddr":"xxx","user":"admin@xxx","app":"PHP","method":"GET","url":"/ocs/v2.php/search/providers/settings/search?term=saml&from=%2Fsettings%2Fapps","message":"Allowed memory size of 805306368 bytes exhausted (tried to allocate 137438953444 bytes) at /var/www/html/nextcloud-20.0.6/3rdparty/guzzlehttp/guzzle/src/functions.php#1037071968","userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:84.0) Gecko/20100101 Firefox/84.0","version":"20.0.6.1"}
{"reqId":"YBCWAD3j70Hux9fEgkbZcwAAAMY","level":3,"time":"2021-01-26 23:21:52","remoteAddr":"xxx","user":"admin@xxx","app":"PHP","method":"GET","url":"/settings/user","message":"Allowed memory size of 805306368 bytes exhausted (tried to allocate 63700217028 bytes) at /var/www/html/nextcloud-20.0.6/3rdparty/guzzlehttp/guzzle/src/functions.php#-1109207136","userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:84.0) Gecko/20100101 Firefox/84.0","version":"20.0.6.1"}
{"reqId":"YBCWv3vNYEZc6yd4l61Y7AAAAg4","level":3,"time":"2021-01-26 23:25:03","remoteAddr":"xxx","user":"admin@xxx","app":"PHP","method":"GET","url":"/apps/files/","message":"Allowed memory size of 805306368 bytes exhausted (tried to allocate 25587398412 bytes) at /var/www/html/nextcloud-20.0.6/3rdparty/guzzlehttp/guzzle/src/functions.php#-1109207136","userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:84.0) Gecko/20100101 Firefox/84.0","version":"20.0.6.1"}
{"reqId":"YBCWxHvNYEZc6yd4l61Y@QAAAgk","level":3,"time":"2021-01-26 23:25:09","remoteAddr":"xxx","user":"admin@xxx","app":"PHP","method":"GET","url":"/ocs/v2.php/apps/weather_status/api/v1/location","message":"Allowed memory size of 805306368 bytes exhausted (tried to allocate 146288530508 bytes) at /var/www/html/nextcloud-20.0.6/3rdparty/guzzlehttp/guzzle/src/functions.php#-1109207136","userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:84.0) Gecko/20100101 Firefox/84.0","version":"20.0.6.1"}

Browser log

Browser log
Insert your browser log here, this could for example include:

a) The javascript console log
b) The network log
c) ...

Activity

  1. added
    0. Needs triagePending check for reproducibility or if it fits our roadmap
    on Jan 27, 2021
  2. iw0nderhow commented on Jan 31, 2021

    @iw0nderhow

    Happens on my system too. When I deactivate "offending" apps, the error persists and some other line takes its place in the error message:

    [Sun Jan 31 13:20:53.831135 2021] [proxy_fcgi:error] [pid 4339] [client 92.209.132.247:1027] AH01071: Got error 'PHP message: PHP Fatal error:  Allowed memory size of 805306368 bytes exhausted (tried to allocate 53248 bytes) in /var/www/html/apps/ransomware_protection/lib/Analyzer.php on line 351'
    [Sun Jan 31 13:23:19.951712 2021] [proxy_fcgi:error] [pid 6732] [client 92.209.132.247:1024] AH01071: Got error 'PHP message: PHP Fatal error:  Allowed memory size of 805306368 bytes exhausted (tried to allocate 53248 bytes) in /var/www/html/lib/private/Diagnostics/QueryLogger.php on line 65'
    

    This must have broken in 20.0.5->20.0.6, as Nextcloud was running quite stably before the upgrade.

    My environment:
    NC 20.0.6
    PHP 7.4.13 (fpm)
    Apache2 2.4.38-3+deb10u4
    OS: Armbian buster
    Activated apps:

    Details
      - accessibility: 1.6.0
      - activity: 2.13.4
      - admin_audit: 1.10.0
      - announcementcenter: 4.0.1
      - apporder: 0.11.0
      - audioplayer: 3.0.0
      - audioplayer_editor: 0.3.0
      - bookmarks: 4.0.8
      - bruteforcesettings: 2.0.1
      - calendar: 2.1.3
      - camerarawpreviews: 0.7.10
      - checksum: 1.0.1
      - cloud_federation_api: 1.3.0
      - comments: 1.10.0
      - contacts: 3.4.3
      - contactsinteraction: 1.1.0
      - cospend: 1.2.9
      - dashboard: 7.0.0
      - data_request: 1.7.0
      - dav: 1.16.2
      - drawio: 0.9.8
      - dropit: 0.4.0
      - event_update_notification: 1.2.0
      - external: 3.7.2
      - extract: 1.3.0
      - federatedfilesharing: 1.10.2
      - federation: 1.10.1
      - files: 1.15.0
      - files_downloadactivity: 1.9.0
      - files_external: 1.11.1
      - files_linkeditor: 1.1.3
      - files_markdown: 2.3.1
      - files_pdfviewer: 2.0.1
      - files_rightclick: 0.17.0
      - files_sharing: 1.12.2
      - files_texteditor: 2.10.0
      - files_trashbin: 1.10.1
      - files_versions: 1.13.0
      - files_videoplayer: 1.9.0
      - firstrunwizard: 2.9.0
      - flowupload: 1.1.2
      - gpxmotion: 0.1.0
      - groupfolders: 8.2.0
      - guests: 1.6.2
      - integration_mastodon: 0.0.11
      - issuetemplate: 0.7.0
      - logreader: 2.5.0
      - lookup_server_connector: 1.8.0
      - maps: 0.1.8
      - metadata: 0.12.0
      - news: 15.1.1
      - nextcloud_announcements: 1.9.0
      - notes: 4.0.2
      - notifications: 2.8.0
      - oauth2: 1.8.0
      - ocdownloader: 1.7.10
      - password_policy: 1.10.1
      - phonetrack: 0.6.5
      - photos: 1.2.3
      - polls: 1.6.3
      - previewgenerator: 3.1.1
      - privacy: 1.4.0
      - provisioning_api: 1.10.0
      - qownnotesapi: 20.9.0
      - ransomware_protection: 1.8.0
      - recommendations: 0.8.0
      - richdocuments: 3.7.14
      - serverinfo: 1.10.0
      - settings: 1.2.0
      - sharebymail: 1.10.0
      - side_menu: 1.21.0
      - socialsharing_email: 2.1.0
      - spreed: 10.0.5
      - support: 1.3.0
      - survey_client: 1.8.0
      - systemtags: 1.10.0
      - tasks: 0.13.6
      - telephoneprovider: 1.0.3
      - text: 3.1.0
      - theming: 1.11.0
      - twofactor_admin: 3.0.0
      - twofactor_backupcodes: 1.9.0
      - twofactor_nextcloud_notification: 3.1.0
      - twofactor_totp: 5.0.0
      - twofactor_webauthn: 0.2.6
      - twofactor_yubikey: 0.4.1
      - updatenotification: 1.10.0
      - user_status: 1.0.1
      - viewer: 1.4.0
      - weather_status: 1.0.0
      - workflow_script: 1.5.1
      - workflowengine: 2.2.0
    Disabled:
      - deck
      - encryption
      - files_accesscontrol
      - gpxedit
      - sharerenamer
      - sociallogin
      - user_ldap
      - user_saml
    
    Integrity check does not fail

    My configuration:

    Details
    {
        "system": {
            "instanceid": "***REMOVED SENSITIVE VALUE***",
            "passwordsalt": "***REMOVED SENSITIVE VALUE***",
            "secret": "***REMOVED SENSITIVE VALUE***",
            "trusted_domains": [ "*** removed 7 domains ***",
            ],
            "datadirectory": "***REMOVED SENSITIVE VALUE***",
            "overwrite.cli.url": "https:\/\/cloud.teutsch.me",
            "htaccess.RewriteBase": "\/",
            "dbtype": "mysql",
            "version": "20.0.6.1",
            "dbname": "***REMOVED SENSITIVE VALUE***",
            "dbhost": "***REMOVED SENSITIVE VALUE***",
            "dbport": "",
            "dbtableprefix": "oc_",
            "dbuser": "***REMOVED SENSITIVE VALUE***",
            "dbpassword": "***REMOVED SENSITIVE VALUE***",
            "installed": true,
            "mail_smtpmode": "smtp",
            "mail_smtpauthtype": "LOGIN",
            "memcache.local": "\\OC\\Memcache\\APCu",
            "filelocking.enabled": true,
            "memcache.locking": "\\OC\\Memcache\\Redis",
            "redis": {
                "host": "***REMOVED SENSITIVE VALUE***",
                "port": 0,
                "timeout": 0
            },
            "loglevel": 1,
            "mail_smtpsecure": "ssl",
            "maintenance": false,
            "theme": "",
            "mysql.utf8mb4": true,
            "updater.release.channel": "stable",
            "enable_previews": true,
            "enabledPreviewProviders": [
                "OC\\Preview\\BMP",
                "OC\\Preview\\GIF",
                "OC\\Preview\\HEIC",
                "OC\\Preview\\JPEG",
                "OC\\Preview\\MarkDown",
                "OC\\Preview\\MP3",
                "OC\\Preview\\PNG",
                "OC\\Preview\\TXT",
                "OC\\Preview\\XBitmap",
                "OC\\Preview\\OpenDocument",
                "OC\\Preview\\Krita",
                "OC\\Preview\\Movie",
                "OC\\Preview\\TIFF",
                "OC\\Preview\\Font",
                "OC\\Preview\\PDF",
                "OC\\Preview\\MSOffice2007"
            ],
            "mail_from_address": "***REMOVED SENSITIVE VALUE***",
            "mail_domain": "***REMOVED SENSITIVE VALUE***",
            "mail_smtphost": "***REMOVED SENSITIVE VALUE***",
            "mail_smtpport": "465",
            "mail_smtpauth": 1,
            "mail_smtpname": "***REMOVED SENSITIVE VALUE***",
            "mail_smtppassword": "***REMOVED SENSITIVE VALUE***",
            "debug": true,
            "data-fingerprint": "492f75b5a90a929e7bff3609193fb862",
            "app_install_overwrite": [
                "photosphereviewer",
                "twofactor_yubikey",
                "dropit",
                "files_texteditor",
                "telephoneprovider"
            ]
        }
    }
    
  3. Reonaydo commented on Feb 10, 2021

    @Reonaydo

    Same problem with nextcloud server 20.0.7.1 configured with LDAP user backend

    PHP message: PHP Fatal error:  Allowed memory size of 4294967296 bytes exhausted (tried to allocate 1581804040 bytes) in /vaw/www/nextcloud/lib/private/Log/File.php on line 89
    
  4. ebogaard commented on Apr 12, 2021

    @ebogaard
    Author

    I followed the release notes about any memory-leak-influencing issues fixed, but saw none so far.

    Is this issue, which has been reported by several separate users now, accepted as valid bij Nextcloud, or is this issue seen as an edge case which warrants no further action?

  5. skuizy commented on Apr 12, 2021

    @skuizy

    Same here with nc 21.0.1 when trying to sync android news app with my server :

    Allowed memory size of 536870912 bytes exhausted (tried to allocate 69632 bytes) at /var/www/html/nextcloud/apps/news/lib/Db/Item.php#323
    
  6. szaimen commented on Jul 7, 2021

    @szaimen
    Contributor

    Is this Issue still valid in NC21.0.3? If not, please close this issue. Thanks! :)

  7. ebogaard commented on Jul 7, 2021

    @ebogaard
    Author

    For us, it seems this issue doesn't appear in 21.0.3 anymore.

  8. szaimen commented on Jul 8, 2021

    @szaimen
    Contributor

    Great, thanks for the feedback!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    0. Needs triagePending check for reproducibility or if it fits our roadmapbugneeds info

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions