Skip to content

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

@waja

Description

@waja

⚠️ This issue respects the following points: ⚠️

  • This is a bug, not a question or a configuration/webserver/proxy issue.
    This issue is not already reported on Github (I've searched it).
    Nextcloud Server is up to date. See Maintenance and Release Schedule for supported versions.
    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?

  • 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 pulsejet/nextcloud-oidc-login#133 (comment) seems also work for us.

It might also be related to #23429 (comment)

Activity

added
0. Needs triagePending check for reproducibility or if it fits our roadmap
on May 16, 2022
CarlSchwan

CarlSchwan commented on Jun 21, 2022

@CarlSchwan
Member

This is potentially fixed with 891c10d @waja could you try to patch your server with this patch and confirm?

waja

waja commented on Jun 21, 2022

@waja
Author

Could it be, that this is already part of 24.0.2?

waja

waja commented on Jun 21, 2022

@waja
Author

Looks like the version from 24.0.2 differs in the following way:

--- ExceptionSerializer.php.24.0.2	2022-06-20 17:01:33.000000000 +0200
+++ ExceptionSerializer.php	2022-06-21 17:06:01.668852037 +0200
@@ -42,8 +42,6 @@
 use OCP\HintException;
 
 class ExceptionSerializer {
-	public const SENSITIVE_VALUE_PLACEHOLDER = '*** sensitive parameters replaced ***';
-
 	public const methodsWithSensitiveParameters = [
 		// Session/User
 		'completeLogin',
@@ -182,7 +180,7 @@
 		if (isset($traceLine['args'])) {
 			$sensitiveValues = array_merge($sensitiveValues, $traceLine['args']);
 		}
-		$traceLine['args'] = [self::SENSITIVE_VALUE_PLACEHOLDER];
+		$traceLine['args'] = ['*** sensitive parameters replaced ***'];
 		return $traceLine;
 	}
 
@@ -213,7 +211,7 @@
 		$workArgs = [];
 		foreach ($args as $arg) {
 			if (in_array($arg, $values, true)) {
-				$arg = self::SENSITIVE_VALUE_PLACEHOLDER;
+				$arg = '*** sensitive parameter replaced ***';
 			} elseif (is_array($arg)) {
 				$arg = $this->removeValuesFromArgs($arg, $values);
 			}
waja

waja commented on Jun 21, 2022

@waja
Author

This issue seems still present when creating a user present in a group and with mail and display name:

{"reqId":"spSXyDTGLqAu7cnpKZk6","level":3,"time":"2022-06-21T15:21:06+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#213","userAgent":"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/102.0.5005.61 Safari/537.36","version":"24.0.2.1"}
dsec-be

dsec-be commented on Jun 29, 2022

@dsec-be

As additional information, it was working in 22.2.5, not anymore in 22.2.7 and above.
If not possible to revert to code from previous version, is there any upgrade path that would solve that issue?

elkangaroo

elkangaroo commented on Jun 30, 2022

@elkangaroo

This is potentially fixed with 891c10d @waja could you try to patch your server with this patch and confirm?

I just tried this patch on our installation, but unfortunately this did not fix the issue. Still got the "Nesting level too deep" fatal error when creating a new user with group membership, just on line 213 instead of 212 now.

dsec-be

dsec-be commented on Jul 15, 2022

@dsec-be

With 2k issues in the pipe, what's the chance to get this one addressed soon? I can understand that it's not the highest priority as it's not blocking or security related. But it's seriously impacting the use of the whole system.
Is there really people creating users without any group? Also users set as admin for a group doesn't have the choice, new users that they create, always come with that group assigned.

ChristophWurst

ChristophWurst commented on Aug 10, 2022

@ChristophWurst
added
1. to developAccepted and waiting to be taken care of
and removed
0. Needs triagePending check for reproducibility or if it fits our roadmap
on Aug 10, 2022

84 remaining items

Loading
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

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      Participants

      @tebruno99@Verequies@samtuke@rawtaz@PhrozenByte

      Issue actions

        [Bug]: PHP Fatal error: Nesting level too deep - recursive dependency? · Issue #32432 · nextcloud/server