Impossible to access after upgrade to 25, latest Docker

Hi,
I am using Nextcloud docker version on a Raspberry Pi.
All was working with version 24 until I upgraded to latest docker version and so moving to version 25.
I get the login page but after entering my login/password I get a 500 error.

Here is latest log line (even if I am not sure it is helpfull) :
{“reqId”:“EmVyXN4Hb82yn3leoG1t”,“level”:3,“time”:“2022-10-20T20:29:18+00:00”,“remoteAddr”:“172.18.0.3”,“user”:“username”,“app”:“PHP”,“method”:“POST”,“url”:“/nextcloud/index.php/login”,“message”:“Nesting level too deep - recursive dependency? at /var/www/html/lib/private/Log/ExceptionSerializer.php#215”,“userAgent”:“Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/106.0.0.0 Safari/537.36 Edg/106.0.1370.47”,“version”:“25.0.0.18”,“data”:{“app”:“PHP”}}

Any idea where to search ?

Thanks
Regards

What version of raspberry pi are you using?

If you run dpkg --print-architecture what’s the output?

If it says armhf you’ve found the issue, NC 25 does not have support for 32bit architecture

I received the same error as well after the upgrade. I’m also using the Docker image. After commenting the recursive code in ExceptionSerializer.php#215, I was able to see the original message. My installation still contained the deprecated u2f 2fa provider, even though I didn’t have the app installed anymore. On login, the system failed to load that provider.
I followed trumee’s steps here and it worked again: https://www.reddit.com/r/NextCloud/comments/wyuwze/locked_out_due_to_u2f_error_upgrading_from_v23_to/
It may very well be that you’ve got a different issue, in that case I also recommend commenting the arg serialization code so you’ll see the underlying exception.

2 Likes

I am using 64bits version. It’s not thé problem.

I finaly decided to reinstall everything wirh another docker image. Now all is running using LinuxServer version which is lighter than the official.

Regards
Stéphane

How exactly is it lighter?

Hi,
I changed to linuxserver version because :

  • Image is 100MB lighter
  • It’s using NGinx, that I prefer. In my point of view it’s using less RAM than Apache
  • It’s based on Alpine/
  • Natively you can define UID for files inside volumes
  • It has svg support

And I am using other images from them (MariaDB, Swag (Nging reverse proxy with letsencrypt)). They update their images regularly so you get the latest version of software.

On the contrary there is no php-fpm version and no Collabora support.

Regards
Stéphane

Before reinstalling, I tried to disable all 2fa provider with no luck.

I do now have the same problem after the migration from 24.0.6.1 to 25.0.0.18 (docker containers).
It is working fine for the users that were logged in.
But for the users that were not logged in they get the white page in Firefox or the http error 500 in Edge.
In the docker logfile I do also see
2022/10/28 15:57:24 [error] 30#30: *284 FastCGI sent in stderr: “PHP message: PHP Fatal error: Nesting level too deep - recursive dependency? in /var/www/html/lib/private/Log/ExceptionSerializer.php on line 215” while reading response header from upstream, client:

@2LdPtS8 did you just comment one line or the whole encodeArg function?

@GuidoD searched your error and found this:

Possibly helpful comment: the issue was that new php did not have sodium module installed.

And, users stating the issue cropped up with using the OIDC plugin when they should be using GitHub - zorn-v/nextcloud-social-login

1 Like

well the social login app cannot be activated since it would make the server unstabie.
So nextcloud does not allow to activate it.

And the PHP version is as far as I know part of the next docker image, so it would mean that there is an error then in that image if I am not wrong with my assumption.

@GuidoD I commented out the loop, which does the recursive call. The return of that method will be an empty array, so no args will be logged. But you’ll still see the error message.

1 Like

thanks.
This is what I did now and all users could then login sucessfully again.

        private function encodeArg($arg, $nestingLevel = 5) {
                if (is_object($arg)) {
#                       if ($nestingLevel === 0) {
#                               return [
#                                       '__class__' => get_class($arg),
#                                       '__properties__' => 'Encoding skipped as the maximum nesting level was reached',
#                               ];
                        }

                        $objectInfo = [ '__class__' => get_class($arg) ];
                        $objectVars = get_object_vars($arg);
                        return array_map(function ($arg) use ($nestingLevel) {
                                return $this->encodeArg($arg, $nestingLevel - 1);
                        }, array_merge($objectInfo, $objectVars));
                }

                if (is_array($arg)) {
#                       if ($nestingLevel === 0) {
#                               return ['Encoding skipped as the maximum nesting level was reached'];
#                       }

                        // Only log the first 5 elements of an array unless we are on debug
                        if ((int)$this->systemConfig->getValue('loglevel', 2) !== 0) {
                                $elemCount = count($arg);
                                if ($elemCount > 5) {
                                        $arg = array_slice($arg, 0, 5);
                                        $arg[] = 'And ' . ($elemCount - 5) . ' more entries, set log level to debug to see all entries';
                                }
                        }
                        return array_map(function ($e) use ($nestingLevel) {
                                return $this->encodeArg($e, $nestingLevel - 1);
                        }, $arg);
                }

                return $arg;
        }

With the developer tools (F12 in the browser) I then found out that the plugins " Plain text editor" (files_texteditor) and “Text” (text) did create problems.
I did now deactivate these two plugins.
The console does now show no more errors.

But when I do uncomment the lines again, the problem is still there with the http error 500.
So for now I will leave the lines commented until I found the root cause.

Hello all,
Just upgraded to 25 and it was working fine for me but then my wife reported that her local client showed a 500 and no sync. I saw white pages and 500 when she was connecting on web UI whereas I had no problem in a week of usage.
I’m not using Social Login but I tried removing the “Impresonnate” plugin which I suspected and it seemed that it worked again but after a short time we both were unable to login.

I did GuidoD’s fix and now everything’s fine on nextcloud:fpm latest

In my case, the server would respond with a 500 upon login for all users that are member of a group. The server would log the following error:

PHP Fatal error:  Nesting level too deep - recursive dependency? in /var/www/html/lib/private/Log/ExceptionSerializer.php on line 215

GuidoD’s fix did not help in my case (Docker, NC 25.0.1). It also looks as if the line containing the closing curly brace (after the five commented lines) should’ve been commented, too; this does not properly close the block.

Instead of GuidoD’s fix, I only disabled the code raising the exception on line 215 by directly returning from the function:

        private function removeValuesFromArgs($args, $values) {
                // added to fix login exception, 2022-11-09
                return $args;
                // ^^^^^

                $workArgs = [];
                foreach ($args as $arg) {
                        if (in_array($arg, $values, true)) {
                                $arg = self::SENSITIVE_VALUE_PLACEHOLDER;
                        } elseif (is_array($arg)) {
                                $arg = $this->removeValuesFromArgs($arg, $values);
                        }
                        $workArgs[] = $arg;
                }
                return $workArgs;
        }

Users can now log in again. But this “fix” might cause other issues, such as logging sensitive values. I still don’t know what the underlying issue is.

For our instance the solution was to disable the circles app.
The solution was found here: https://github.com/nextcloud/server/issues/32432#issuecomment-1296280426

5 Likes

Had this error when logging in (instead of being logged in, getting a 500 and blank page) with a 25.0.1 instance, no special configuration, and disabling the Circles app made it work again. Did not debug it further than that.

2 Likes

I just had the error again after the update to 25.0.2.3 since of course my changes were gone.
And yes, just disabling the circles app solved the problem.
I am really wondering that Nextcloud has by default that app enabled which does create such big problems to existing installations.

3 Likes

Hi guys.
I also disabled circle apps and my nextcloud starts working. Thanks for your help. I am very appreciated. :slight_smile:

1 Like

Same here, occ app:disable circles solved evrything
(NC 25.0.1).

What’s strange is that I was unable to connect from my desktop (firefox and chromium) but from my android phone (firefox too) it was OK so the access to the following log

“Nesting level too deep - recursive dependency? at /var/www/html/lib/private/Log/ExceptionSerializer.php#215”

However on my phone, my sync services were down. (DavX5).

At least, it works now.

Thx everybody

At least, I know wher to look on my next blank screen.