server icon indicating copy to clipboard operation
server copied to clipboard

[Bug]: PHP Fatal error: Nesting level too deep - recursive dependency?

Open waja opened this issue 2 years ago • 66 comments

⚠️ This issue respects the following points: ⚠️

  • [X] This is a bug, not a question or a configuration/webserver/proxy issue.
  • [X] This issue is not already reported on Github (I've searched it).
  • [X] Nextcloud Server is up to date. See Maintenance and Release Schedule for supported versions.
  • [X] I agree to follow Nextcloud's Code of Conduct.

Bug description

When creating a user which is part of any group, there is an error thrown in the UI: "An error occurred during the request. Unable to proceed.". nextcloud.log has PHP Fatal error: Nesting level too deep - recursive dependency? in /var/www/html/lib/private/Log/ExceptionSerializer.php on line 212. Creating a user without being part of a group works as expected.

If you try this again, this fails cause the user is already present. Reloading the page you see the user and it's part of the group, but any other user information is missing.

See this on a new instance of latest 22.x, 23.x and 24.0. With 21.x and below we do not face this issue.

Steps to reproduce

  1. Login to Nextcloud instance with privileged account
  2. Navigate to /settings/users
  3. Click on "New User"
  4. Fill in the users information including e-mail, password, group (this is important to trigger the bug) and display name
  5. Click "Add new user"
  6. Error appears on the upper right corner: "An error occurred during the request. Unable to proceed."
  7. Refresh webpage
  8. After that, the user is present in the users list and the admin account can edit the user's information as expected and the welcome e-mail will be sent

Expected behavior

Created user with details when user is part of a group when creating.

Installation method

Other

Operating system

Debian/Ubuntu

PHP engine version

PHP 8.0

Web server

Nginx

Database engine version

MariaDB

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

Updated to a major version (ex. 22.2.3 to 23.0.1)

Are you using the Nextcloud Server Encryption module?

No response

What user-backends are you using?

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

Configuration report

{
    "system": {
        "datadirectory": "***REMOVED SENSITIVE VALUE***",
        "apps_paths": [
            {
                "path": "\/nextcloud\/apps",
                "url": "\/apps",
                "writable": false
            },
            {
                "path": "\/nextcloud\/apps2",
                "url": "\/apps2",
                "writable": true
            }
        ],
        "memcache.local": "\\OC\\Memcache\\APCu",
        "instanceid": "***REMOVED SENSITIVE VALUE***",
        "passwordsalt": "***REMOVED SENSITIVE VALUE***",
        "secret": "***REMOVED SENSITIVE VALUE***",
        "trusted_domains": [
            "nextcloud.test.org"
        ],
        "dbtype": "mysql",
        "version": "24.0.0.12",
        "overwrite.cli.url": "http:\/\/nextcloud.test.org",
        "dbname": "***REMOVED SENSITIVE VALUE***",
        "dbhost": "***REMOVED SENSITIVE VALUE***",
        "dbport": "",
        "dbtableprefix": "oc_",
        "mysql.utf8mb4": true,
        "dbuser": "***REMOVED SENSITIVE VALUE***",
        "dbpassword": "***REMOVED SENSITIVE VALUE***",
        "installed": true,
        "redis": {
            "port": 6379,
            "host": "***REMOVED SENSITIVE VALUE***"
        },
        "memcache.distributed": "\\OC\\Memcache\\Redis",
        "memcache.locking": "\\OC\\Memcache\\Redis",
        "overwriteprotocol": "https",
        "default_phone_region": "DE",
        "mail_domain": "***REMOVED SENSITIVE VALUE***",
        "theme": "",
        "loglevel": 2,
        "maintenance": false
    }
}

List of activated Apps

Enabled:
  - accessibility: 1.10.0
  - activity: 2.16.0
  - bruteforcesettings: 2.4.0
  - circles: 24.0.0
  - cloud_federation_api: 1.7.0
  - comments: 1.14.0
  - contactsinteraction: 1.5.0
  - dashboard: 7.4.0
  - dav: 1.22.0
  - federatedfilesharing: 1.14.0
  - federation: 1.14.0
  - files: 1.19.0
  - files_pdfviewer: 2.5.0
  - files_rightclick: 1.3.0
  - files_sharing: 1.16.2
  - files_trashbin: 1.14.0
  - files_versions: 1.17.0
  - files_videoplayer: 1.13.0
  - logreader: 2.9.0
  - lookup_server_connector: 1.12.0
  - nextcloud_announcements: 1.13.0
  - notifications: 2.12.0
T  - oauth2: 1.12.0
  - password_policy: 1.14.0
  - photos: 1.6.0
  - privacy: 1.8.0
  - provisioning_api: 1.14.0
  - recommendations: 1.3.0
  - serverinfo: 1.14.0
  - settings: 1.6.0
  - sharebymail: 1.14.0
  - support: 1.7.0
  - survey_client: 1.12.0
  - systemtags: 1.14.0
  - text: 3.5.1
  - theming: 1.15.0
  - twofactor_backupcodes: 1.13.0
  - updatenotification: 1.14.0
  - user_status: 1.4.0
  - viewer: 1.8.0
  - weather_status: 1.4.0
  - workflowengine: 2.6.0
Disabled:
  - admin_audit
  - encryption
  - files_external
  - firstrunwizard: 2.12.0
  - user_ldap

Nextcloud Signing status

No errors have been found.

Nextcloud Logs

{"reqId":"VhqXg7aIKAOoQCHZZLyW","level":3,"time":"2022-05-16T11:52:16+00:00","remoteAddr":"172.19.0.2","user":"admin","app":"PHP","method":"POST","url":"/ocs/v2.php/cloud/users","message":"Nesting level too deep - recursive dependency? at /nextcloud/lib/private/Log/ExceptionSerializer.php#212","userAgent":"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/101.0.4951.64 Safari/537.36","version":"24.0.0.12","id":"62823b928edc0"}

Additional info

This seems also be an issue with the official helm chart. The suggested dirty fix in https://github.com/pulsejet/nextcloud-oidc-login/issues/133#issuecomment-1102459032 seems also work for us.

It might also be related to https://github.com/nextcloud/server/issues/23429#issuecomment-708901668

waja avatar May 16 '22 12:05 waja