Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Infinite loop in ExceptionSerializer::removeValuesFromArgs() (NC 19) #23429

Closed
sm8ps opened this issue Oct 14, 2020 · 9 comments
Closed

Infinite loop in ExceptionSerializer::removeValuesFromArgs() (NC 19) #23429

sm8ps opened this issue Oct 14, 2020 · 9 comments
Labels
0. Needs triage Pending check for reproducibility or if it fits our roadmap bug needs info

Comments

@sm8ps
Copy link

sm8ps commented Oct 14, 2020

Steps to reproduce

  1. Upgrade NC with cms_pico 1.0.10 from 19.0.3 to 19.0.4
  2. Have all apps updated via occ app:update
  3. Create new sample_pico-site named test-a as admin
  4. Open that Pico-site

Expected behaviour

The site should show its content.

Actual behaviour

After a very long time, a HTTP-500 error (internal server error) is shown. The site data has been indeed created in the files. Checking with top, a process php-fpm has started running on one CPU core at 100% whose virtual memory increases continuously even after the request has been canceled from the client side.

Comments

This issue was originally reported as nextcloud/cms_pico#145. This issue is not about cms_pico but about the infinite loop caused by ExceptionSerializer::removeValuesFromArgs() (cf. the Nextcloud log) although there might be connections that I am unaware of.

Server configuration detail

Operating system: Linux 4.15.0-118-generic #119~16.04.1-Ubuntu SMP Tue Sep 8 14:54:40 UTC 2020 x86_64

Webserver: nginx/1.19.2 (fpm-fcgi)

Database: mysql 10.3.24

PHP version:

7.2.24-0ubuntu0.18.04.6
Modules loaded: Core, date, libxml, openssl, pcre, zlib, filter, hash, Reflection, SPL, sodium, session, standard, cgi-fcgi, mysqlnd, PDO, xml, apcu, apc, bcmath, bz2, calendar, ctype, curl, dom, mbstring, fileinfo, ftp, gd, gettext, gmp, iconv, igbinary, imagick, inotify, intl, json, exif, mysqli, OAuth, pdo_mysql, Phar, posix, readline, redis, shmop, SimpleXML, sockets, sysvmsg, sysvsem, sysvshm, tokenizer, wddx, xmlreader, xmlwriter, xsl, zip, Zend OPcache

Nextcloud version: 19.0.4 - 19.0.4.2

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

Where did you install Nextcloud from: unknown

Signing status

Array
(
)

List of activated apps
Enabled:
 - accessibility: 1.5.0
 - activity: 2.12.1
 - admin_audit: 1.9.0
 - apporder: 0.11.0
 - audioplayer: 2.12.0
 - bruteforcesettings: 2.0.1
 - calendar: 2.0.4
 - carnet: 0.22.3
 - cloud_federation_api: 1.2.0
 - cms_pico: 1.0.10
 - comments: 1.9.0
 - contacts: 3.4.0
 - contactsinteraction: 1.0.0
 - dav: 1.15.0
 - deck: 1.1.1
 - documentserver_community: 0.1.8
 - federatedfilesharing: 1.9.0
 - federation: 1.9.0
 - files: 1.14.0
 - files_external: 1.10.0
 - files_fulltextsearch: 1.4.3
 - files_fulltextsearch_tesseract: 1.4.2
 - files_inotify: 0.1.8
 - files_markdown: 2.3.1
 - files_pdfviewer: 1.8.0
 - files_rightclick: 0.16.0
 - files_sharing: 1.11.0
 - files_trashbin: 1.9.0
 - files_versions: 1.12.0
 - files_videoplayer: 1.8.0
 - firstrunwizard: 2.8.0
 - forms: 2.0.4
 - fulltextsearch: 1.4.2
 - fulltextsearch_elasticsearch: 1.5.2
 - groupfolders: 7.1.0
 - guests: 1.6.0
 - impersonate: 1.6.1
 - logreader: 2.4.0
 - lookup_server_connector: 1.7.0
 - news: 14.2.2
 - nextcloud_announcements: 1.8.0
 - notes: 3.6.4
 - notifications: 2.7.0
 - oauth2: 1.7.0
 - onlyoffice: 6.0.2
 - password_policy: 1.9.1
 - photos: 1.1.0
 - polls: 1.5.4
 - privacy: 1.3.0
 - provisioning_api: 1.9.0
 - qownnotesapi: 20.9.0
 - quota_warning: 1.8.0
 - ransomware_detection: 0.8.0
 - serverinfo: 1.9.0
 - settings: 1.1.0
 - sharebymail: 1.9.0
 - spreed: 9.0.4
 - support: 1.2.1
 - survey_client: 1.7.0
 - suspicious_login: 3.2.1
 - systemtags: 1.9.0
 - tasks: 0.13.4
 - theming: 1.10.0
 - twofactor_backupcodes: 1.8.0
 - twofactor_totp: 5.0.0
 - unsplash: 1.1.6
 - updatenotification: 1.9.0
 - viewer: 1.3.0
 - workflowengine: 2.1.0
Disabled:
 - encryption
 - ownpad
 - recommendations
 - text
 - user_ldap

Configuration (config/config.php)
{
    "instanceid": "***REMOVED SENSITIVE VALUE***",
    "passwordsalt": "***REMOVED SENSITIVE VALUE***",
    "secret": "***REMOVED SENSITIVE VALUE***",
    "trusted_domains": [
        "lxcnextcloud.okunterhof5.ch",
        "lxcNextCloud",
        "nextcloud.wildi.name",
        "lxcnextcloud"
    ],
    "datadirectory": "***REMOVED SENSITIVE VALUE***",
    "overwrite.cli.url": "http:\/\/lxcnextcloud.okunterhof5.ch",
    "dbtype": "mysql",
    "version": "19.0.4.2",
    "dbname": "***REMOVED SENSITIVE VALUE***",
    "dbhost": "***REMOVED SENSITIVE VALUE***",
    "dbport": "",
    "dbtableprefix": "oc_",
    "dbuser": "***REMOVED SENSITIVE VALUE***",
    "dbpassword": "***REMOVED SENSITIVE VALUE***",
    "installed": true,
    "memcache.local": "\\OC\\Memcache\\APCu",
    "logtimezone": "Europe\/Zurich",
    "loglevel": "2",
    "log_rotate_size": 10485760,
    "skeletondirectory": "",
    "share_folder": "\/Mit mir geteilt",
    "mail_smtpmode": "smtp",
    "mail_smtpauthtype": "LOGIN",
    "mail_from_address": "***REMOVED SENSITIVE VALUE***",
    "mail_domain": "***REMOVED SENSITIVE VALUE***",
    "mail_smtphost": "***REMOVED SENSITIVE VALUE***",
    "mail_smtpsecure": "tls",
    "mail_smtpauth": 1,
    "mail_smtpport": "587",
    "mail_smtpname": "***REMOVED SENSITIVE VALUE***",
    "mail_smtppassword": "***REMOVED SENSITIVE VALUE***",
    "force_language": "de",
    "default_locale": "de-ch",
    "defaultapp": "apporder",
    "trashbin_retention_obligation": "disabled",
    "versions_retention_obligation": "disabled",
    "trusted_proxies": "***REMOVED SENSITIVE VALUE***",
    "auth.bruteforce.protection.enabled": true,
    "maintenance": false,
    "filelocking.enabled": "true",
    "memcache.locking": "\\OC\\Memcache\\Redis",
    "redis": {
        "host": "***REMOVED SENSITIVE VALUE***",
        "port": 0,
        "timeout": 0
    },
    "theme": "",
    "app_install_overwrite": [
        "ownpad",
        "issuetemplate"
    ],
    "mysql.utf8mb4": true,
    "has_rebuilt_cache": true
}

Are you using external storage, if yes which one: local

Are you using encryption:

Are you using an external user-backend, if yes which one:

Client configuration

Browser: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:81.0) Gecko/20100101 Firefox/81.0

Operating system: Ubuntu 20.04

Logs

Web server error log
n.a.
Nextcloud log
"app":"PHP","method":"GET","url":"/index.php/apps/cms_pico/pico/test-a","message":"Allowed memory size of 1073741824 bytes exhausted (tried to allocate 20480 bytes) at /var/www/nextcloud/lib/private/Log/ExceptionSerializer.php#137","userAgent":"Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:80.0) Gecko/20100101 Firefox/80.0","version":"19.0.4.2"}
Browser log

n.a.

@sm8ps sm8ps added 0. Needs triage Pending check for reproducibility or if it fits our roadmap bug labels Oct 14, 2020
@sm8ps
Copy link
Author

sm8ps commented Oct 14, 2020

As explained in nextcloud/cms_pico#149 I will close this issue. It turned out to be a red herring. Sorry for the noise!

@sm8ps sm8ps closed this as completed Oct 14, 2020
@PhrozenByte
Copy link
Contributor

PhrozenByte commented Oct 15, 2020

@sm8ps I'll reopen this, that ExceptionSerializer::removeValuesFromArgs() can cause infinite loops with arrays using references is still a bug in Nextcloud 😉

@PhrozenByte PhrozenByte reopened this Oct 15, 2020
@sm8ps
Copy link
Author

sm8ps commented Oct 15, 2020

I agree, the faulty behavior is indeed real. When I replace the new and working version of 'appdata_###/cms_pico' with the old one, the error crops up in a reproducible fashion. So the bug does seem in some way related to cms_pico.

If anybody wants to try it out then I can provide a copy of the broken 'cms_pico/'. My capabilities in trouble shooting are too limited to produce any further insights.

@PhrozenByte
Copy link
Contributor

Yes, the infinite loop is related to Pico without any doubt, however, the underlying issue with the infinite loop is not Pico, but the fact that the exception serializer isn't capable of handling recursive references in arrays. That is an error in Nextcloud that must be fixed.

After the error in Nextcloud has been fixed we should see the actual exception that has been thrown - allowing us to investiage the issue. However, if you want to you can provide a copy of your appdata_*/cms_pico and I'll try to reproduce it as soon as I find time to (unfortunately time is very limited lately). Please head over to nextcloud/cms_pico#149 to do so - this issue should solely be about the issue with ExceptionSerializer::removeValuesFromArgs().

@sm8ps
Copy link
Author

sm8ps commented Oct 15, 2020

I am perfectly with you on everything. From a trouble shooting point of view it would be good to check reproducibility.

@skjnldsv
Copy link
Member

skjnldsv commented Nov 7, 2020

So is it related to server or cms_pico?

@PhrozenByte
Copy link
Contributor

PhrozenByte commented Nov 8, 2020

Yes, the infinite loop is related [in terms of: throwing the exception] to Pico without any doubt, however, the underlying issue with the infinite loop is not Pico, but the fact that the exception serializer isn't capable of handling recursive references in arrays. That is an error in Nextcloud that must be fixed.

@skjnldsv

@PhrozenByte PhrozenByte changed the title Infinite loop after upgrade to 19.0.4 Infinite loop in ExceptionSerializer::removeValuesFromArgs() (NC 19) Nov 8, 2020
@skjnldsv skjnldsv added 1. to develop Accepted and waiting to be taken care of and removed 0. Needs triage Pending check for reproducibility or if it fits our roadmap needs info labels Nov 8, 2020
@derMart
Copy link

derMart commented Dec 13, 2022

This issue is still existing in NC25 with cms_pico 1.0.21 modified to be used with Pico 3. What is the status of the issue?

@szaimen
Copy link
Contributor

szaimen commented Jan 23, 2023

Hi, please update to 24.0.9 or better 25.0.3 and report back if it fixes the issue. Thank you!

My goal is to add a label like e.g. 25-feedback to this ticket of an up-to-date major Nextcloud version where the bug could be reproduced. However this is not going to work without your help. So thanks for all your effort!

If you don't manage to reproduce the issue in time and the issue gets closed but you can reproduce the issue afterwards, feel free to create a new bug report with up-to-date information by following this link: https://github.com/nextcloud/server/issues/new?assignees=&labels=bug%2C0.+Needs+triage&template=BUG_REPORT.yml&title=%5BBug%5D%3A+

@szaimen szaimen added needs info 0. Needs triage Pending check for reproducibility or if it fits our roadmap and removed 1. to develop Accepted and waiting to be taken care of labels Jan 23, 2023
@szaimen szaimen closed this as completed Mar 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0. Needs triage Pending check for reproducibility or if it fits our roadmap bug needs info
Projects
None yet
Development

No branches or pull requests

5 participants