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

[Bug]: Login not working after upgrading to 22.2.8/23.0.5 from 22.2.7 (LDAP/External Storage/SessionCredentials) #32598

Closed
6 of 8 tasks
phreaker0 opened this issue May 25, 2022 · 13 comments · Fixed by #32685
Closed
6 of 8 tasks
Assignees
Labels
3. to review Waiting for reviews bug

Comments

@phreaker0
Copy link
Contributor

phreaker0 commented May 25, 2022

⚠️ 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

We have a working nextcloud instance at version 22.2.7 with php7.3.
LDAP against a samba4 AD domain is used for user authentication.
SMB External Storage with Session Credentials is used.

After the upgrade to 22.2.8 (and for testing 23.0.5) the login won't work any more for all user types (ldap and root user).
The raised exceptions are listed in the Nextcloud Logs section.

Steps to reproduce

  1. working nextcloud instance v22.2.7 with LDAP/External SMB Storage with Session Credentials Authentication
  2. upgrade to v22.2.8/v23.0.5
  3. login doens't work anymore with above exceptions

Expected behavior

login still works after the upgrade

Installation method

Manual installation

Operating system

Debian/Ubuntu

PHP engine version

PHP 7.3

Web server

Apache (supported)

Database engine version

MariaDB

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

Updated from a minor version (ex. 22.2.3 to 22.2.4)

Are you using the Nextcloud Server Encryption module?

no

What user-backends are you using?

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

Configuration report

{
    "system": {
        "instanceid": "***REMOVED SENSITIVE VALUE***",
        "passwordsalt": "***REMOVED SENSITIVE VALUE***",
        "secret": "***REMOVED SENSITIVE VALUE***",
        "trusted_domains": [
            "***REMOVED SENSITIVE VALUE***"
        ],
        "datadirectory": "***REMOVED SENSITIVE VALUE***",
        "dbtype": "mysql",
        "default_phone_region": "AT",
        "version": "23.0.5.1",
        "overwrite.cli.url": "https:\/\/***REMOVED SENSITIVE VALUE***",
        "dbname": "***REMOVED SENSITIVE VALUE***",
        "dbhost": "***REMOVED SENSITIVE VALUE***",
        "dbport": "",
        "dbtableprefix": "oc_",
        "mysql.utf8mb4": true,
        "dbuser": "***REMOVED SENSITIVE VALUE***",
        "dbpassword": "***REMOVED SENSITIVE VALUE***",
        "installed": true,
        "ldapIgnoreNamingRules": false,
        "ldapProviderFactory": "\\OCA\\User_LDAP\\LDAPProviderFactory",
        "memcache.local": "\\OC\\Memcache\\APCu",
        "skeletondirectory": "",
        "loglevel": 2,
        "maintenance": false,
        "apps_paths": [
            {
                "path": "\/var\/www\/nextcloud\/apps",
                "url": "\/apps",
                "writable": false
            },
            {
                "path": "\/var\/www\/nextcloud\/apps2",
                "url": "\/apps2",
                "writable": true
            }
        ]
    }
}

List of activated Apps

Enabled:
  - bruteforcesettings: 2.4.0
  - cloud_federation_api: 1.6.0
  - dav: 1.21.0
  - extract: 1.3.5
  - federatedfilesharing: 1.13.0
  - files: 1.18.0
  - files_external: 1.15.0
  - files_pdfviewer: 2.4.0
  - files_rightclick: 1.2.0
  - logreader: 2.8.0
  - lookup_server_connector: 1.11.0
  - oauth2: 1.11.0
  - provisioning_api: 1.13.0
  - serverinfo: 1.13.0
  - settings: 1.5.0
  - text: 3.4.1
  - theming: 1.14.0
  - twofactor_backupcodes: 1.12.0
  - updatenotification: 1.13.0
  - user_ldap: 1.13.1
  - viewer: 1.7.0
  - workflowengine: 2.5.0
Disabled:
  - accessibility: 1.4.0
  - activity: 2.11.0
  - admin_audit
  - circles: 22.1.1
  - comments: 1.8.0
  - contactsinteraction: 1.2.0
  - dashboard: 7.0.0
  - encryption
  - federation: 1.8.0
  - files_sharing: 1.10.1
  - files_trashbin: 1.8.0
  - files_versions: 1.11.0
  - files_videoplayer: 1.7.0
  - firstrunwizard: 2.7.0
  - nextcloud_announcements: 1.7.0
  - notifications: 2.6.0
  - password_policy: 1.8.0
  - photos: 1.0.0
  - privacy: 1.2.0
  - recommendations: 0.6.0
  - sharebymail: 1.8.0
  - support: 1.1.0
  - survey_client: 1.6.0
  - systemtags: 1.8.0
  - user_status: 1.0.1
  - weather_status: 1.0.0

Nextcloud Signing status

login not working

Nextcloud Logs

**22.2.8**:

{
    "reqId": "N2EyP2STXilTGT6HbsfR",
    "level": 3,
    "time": "2022-05-25T14:21:57+00:00",
    "remoteAddr": "*** sensitive parameter replaced ***",
    "user": "root",
    "app": "index",
    "method": "POST",
    "url": "/login",
    "message": "Call to a member function setBackendOption() on string",
    "userAgent": "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:100.0) Gecko/20100101 Firefox/100.0",
    "version": "22.2.8.1",
    "exception": {
        "Exception": "Exception",
        "Message": "Call to a member function setBackendOption() on string",
        "Code": 0,
        "Trace": [{
            "file": "/var/www/nextcloud/lib/private/AppFramework/App.php",
            "line": 156,
            "function": "dispatch",
            "class": "OC\\AppFramework\\Http\\Dispatcher",
            "type": "->",
            "args": [{
                "__class__": "OC\\Core\\Controller\\LoginController"
            }, "tryLogin"]
        }, {
            "file": "/var/www/nextcloud/lib/private/Route/Router.php",
            "line": 302,
            "function": "main",
            "class": "OC\\AppFramework\\App",
            "type": "::",
            "args": ["OC\\Core\\Controller\\LoginController", "tryLogin", {
                "__class__": "OC\\AppFramework\\DependencyInjection\\DIContainer"
            }, {
                "_route": "core.login.tryLogin"
            }]
        }, {
            "file": "/var/www/nextcloud/lib/base.php",
            "line": 1008,
            "function": "match",
            "class": "OC\\Route\\Router",
            "type": "->",
            "args": ["/login"]
        }, {
            "file": "/var/www/nextcloud/index.php",
            "line": 36,
            "function": "handleRequest",
            "class": "OC",
            "type": "::",
            "args": []
        }],
        "File": "/var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php",
        "Line": 158,
        "Previous": {
            "Exception": "Error",
            "Message": "Call to a member function setBackendOption() on string",
            "Code": 0,
            "Trace": [{
                "file": "/var/www/nextcloud/apps/files_external/lib/Config/ConfigAdapter.php",
                "line": 94,
                "function": "manipulateStorageConfig",
                "class": "OCA\\Files_External\\Lib\\Auth\\Password\\SessionCredentials",
                "type": "->",
                "args": ["*** sensitive parameter replaced ***", "*** sensitive parameter replaced ***"]
            }, {
                "file": "/var/www/nextcloud/apps/files_external/lib/Config/ConfigAdapter.php",
                "line": 132,
                "function": "prepareStorageConfig",
                "class": "OCA\\Files_External\\Config\\ConfigAdapter",
                "type": "->",
                "args": ["*** sensitive parameter replaced ***", "*** sensitive parameter replaced ***"]
            }, {
                "function": "OCA\\Files_External\\Config\\{closure}",
                "class": "OCA\\Files_External\\Config\\ConfigAdapter",
                "type": "->",
                "args": ["*** sensitive parameters replaced ***"]
            }, {
                "file": "/var/www/nextcloud/apps/files_external/lib/Config/ConfigAdapter.php",
                "line": 130,
                "function": "array_map",
                "args": [{
                    "__class__": "Closure"
                }, {
                    "1": {
                        "__class__": "OCA\\Files_External\\Lib\\StorageConfig"
                    },
                    "2": {
                        "__class__": "OCA\\Files_External\\Lib\\StorageConfig"
                    },
                    "3": {
                        "__class__": "OCA\\Files_External\\Lib\\StorageConfig"
                    },
                    "6": {
                        "__class__": "OCA\\Files_External\\Lib\\StorageConfig"
                    },
                    "7": {
                        "__class__": "OCA\\Files_External\\Lib\\StorageConfig"
                    }
                }]
            }, {
                "file": "/var/www/nextcloud/lib/private/Files/Config/MountProviderCollection.php",
                "line": 108,
                "function": "getMountsForUser",
                "class": "OCA\\Files_External\\Config\\ConfigAdapter",
                "type": "->",
                "args": ["*** sensitive parameter replaced ***", {
                    "__class__": "OC\\Files\\Storage\\StorageFactory"
                }]
            }, {
                "file": "/var/www/nextcloud/lib/private/Files/Filesystem.php",
                "line": 424,
                "function": "addMountForUser",
                "class": "OC\\Files\\Config\\MountProviderCollection",
                "type": "->",
                "args": ["*** sensitive parameter replaced ***", {
                    "__class__": "OC\\Files\\Mount\\Manager"
                }]
            }, {
                "file": "/var/www/nextcloud/lib/private/Cache/File.php",
                "line": 57,
                "function": "initMountPoints",
                "class": "OC\\Files\\Filesystem",
                "type": "::",
                "args": ["*** sensitive parameter replaced ***"]
            }, {
                "file": "/var/www/nextcloud/lib/private/Cache/File.php",
                "line": 178,
                "function": "getStorage",
                "class": "OC\\Cache\\File",
                "type": "->",
                "args": []
            }, {
                "file": "/var/www/nextcloud/lib/base.php",
                "line": 816,
                "function": "gc",
                "class": "OC\\Cache\\File",
                "type": "->",
                "args": []
            }, {
                "function": "{closure}",
                "class": "OC",
                "type": "::",
                "args": ["*** sensitive parameters replaced ***"]
            }, {
                "file": "/var/www/nextcloud/lib/private/Hooks/EmitterTrait.php",
                "line": 106,
                "function": "call_user_func_array",
                "args": [{
                        "__class__": "Closure"
                    },
                    ["*** sensitive parameter replaced ***", "*** sensitive parameter replaced ***", "*** sensitive parameter replaced ***", "*** sensitive parameter replaced ***"]
                ]
            }, {
                "file": "/var/www/nextcloud/lib/private/Hooks/PublicEmitter.php",
                "line": 40,
                "function": "emit",
                "class": "OC\\Hooks\\BasicEmitter",
                "type": "->",
                "args": ["\\OC\\User", "postLogin", ["*** sensitive parameter replaced ***", "*** sensitive parameter replaced ***", "*** sensitive parameter replaced ***", "*** sensitive parameter replaced ***"]]
            }, {
                "file": "/var/www/nextcloud/lib/private/User/Session.php",
                "line": 411,
                "function": "emit",
                "class": "OC\\Hooks\\PublicEmitter",
                "type": "->",
                "args": ["\\OC\\User", "postLogin", ["*** sensitive parameter replaced ***", "*** sensitive parameter replaced ***", "*** sensitive parameter replaced ***", "*** sensitive parameter replaced ***"]]
            }, {
                "file": "/var/www/nextcloud/lib/private/Authentication/Login/CompleteLoginCommand.php",
                "line": 44,
                "function": "completeLogin",
                "class": "OC\\User\\Session",
                "type": "->",
                "args": ["*** sensitive parameters replaced ***"]
            }, {
                "file": "/var/www/nextcloud/lib/private/Authentication/Login/ALoginCommand.php",
                "line": 40,
                "function": "process",
                "class": "OC\\Authentication\\Login\\CompleteLoginCommand",
                "type": "->",
                "args": [{
                    "__class__": "OC\\Authentication\\Login\\LoginData"
                }]
            }, {
                "file": "/var/www/nextcloud/lib/private/Authentication/Login/LoggedInCheckCommand.php",
                "line": 60,
                "function": "processNextOrFinishSuccessfully",
                "class": "OC\\Authentication\\Login\\ALoginCommand",
                "type": "->",
                "args": [{
                    "__class__": "OC\\Authentication\\Login\\LoginData"
                }]
            }, {
                "file": "/var/www/nextcloud/lib/private/Authentication/Login/ALoginCommand.php",
                "line": 40,
                "function": "process",
                "class": "OC\\Authentication\\Login\\LoggedInCheckCommand",
                "type": "->",
                "args": [{
                    "__class__": "OC\\Authentication\\Login\\LoginData"
                }]
            }, {
                "file": "/var/www/nextcloud/lib/private/Authentication/Login/EmailLoginCommand.php",
                "line": 58,
                "function": "processNextOrFinishSuccessfully",
                "class": "OC\\Authentication\\Login\\ALoginCommand",
                "type": "->",
                "args": [{
                    "__class__": "OC\\Authentication\\Login\\LoginData"
                }]
            }, {
                "file": "/var/www/nextcloud/lib/private/Authentication/Login/ALoginCommand.php",
                "line": 40,
                "function": "process",
                "class": "OC\\Authentication\\Login\\EmailLoginCommand",
                "type": "->",
                "args": [{
                    "__class__": "OC\\Authentication\\Login\\LoginData"
                }]
            }, {
                "file": "/var/www/nextcloud/lib/private/Authentication/Login/UidLoginCommand.php",
                "line": 54,
                "function": "processNextOrFinishSuccessfully",
                "class": "OC\\Authentication\\Login\\ALoginCommand",
                "type": "->",
                "args": [{
                    "__class__": "OC\\Authentication\\Login\\LoginData"
                }]
            }, {
                "file": "/var/www/nextcloud/lib/private/Authentication/Login/ALoginCommand.php",
                "line": 40,
                "function": "process",
                "class": "OC\\Authentication\\Login\\UidLoginCommand",
                "type": "->",
                "args": [{
                    "__class__": "OC\\Authentication\\Login\\LoginData"
                }]
            }, {
                "file": "/var/www/nextcloud/lib/private/Authentication/Login/UserDisabledCheckCommand.php",
                "line": 58,
                "function": "processNextOrFinishSuccessfully",
                "class": "OC\\Authentication\\Login\\ALoginCommand",
                "type": "->",
                "args": [{
                    "__class__": "OC\\Authentication\\Login\\LoginData"
                }]
            }, {
                "file": "/var/www/nextcloud/lib/private/Authentication/Login/ALoginCommand.php",
                "line": 40,
                "function": "process",
                "class": "OC\\Authentication\\Login\\UserDisabledCheckCommand",
                "type": "->",
                "args": [{
                    "__class__": "OC\\Authentication\\Login\\LoginData"
                }]
            }, {
                "file": "/var/www/nextcloud/lib/private/Authentication/Login/PreLoginHookCommand.php",
                "line": 53,
                "function": "processNextOrFinishSuccessfully",
                "class": "OC\\Authentication\\Login\\ALoginCommand",
                "type": "->",
                "args": [{
                    "__class__": "OC\\Authentication\\Login\\LoginData"
                }]
            }, {
                "file": "/var/www/nextcloud/lib/private/Authentication/Login/Chain.php",
                "line": 108,
                "function": "process",
                "class": "OC\\Authentication\\Login\\PreLoginHookCommand",
                "type": "->",
                "args": [{
                    "__class__": "OC\\Authentication\\Login\\LoginData"
                }]
            }, {
                "file": "/var/www/nextcloud/core/Controller/LoginController.php",
                "line": 314,
                "function": "process",
                "class": "OC\\Authentication\\Login\\Chain",
                "type": "->",
                "args": [{
                    "__class__": "OC\\Authentication\\Login\\LoginData"
                }]
            }, {
                "file": "/var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php",
                "line": 217,
                "function": "tryLogin",
                "class": "OC\\Core\\Controller\\LoginController",
                "type": "->",
                "args": ["*** sensitive parameters replaced ***"]
            }, {
                "file": "/var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php",
                "line": 126,
                "function": "executeController",
                "class": "OC\\AppFramework\\Http\\Dispatcher",
                "type": "->",
                "args": [{
                    "__class__": "OC\\Core\\Controller\\LoginController"
                }, "tryLogin"]
            }, {
                "file": "/var/www/nextcloud/lib/private/AppFramework/App.php",
                "line": 156,
                "function": "dispatch",
                "class": "OC\\AppFramework\\Http\\Dispatcher",
                "type": "->",
                "args": [{
                    "__class__": "OC\\Core\\Controller\\LoginController"
                }, "tryLogin"]
            }, {
                "file": "/var/www/nextcloud/lib/private/Route/Router.php",
                "line": 302,
                "function": "main",
                "class": "OC\\AppFramework\\App",
                "type": "::",
                "args": ["OC\\Core\\Controller\\LoginController", "tryLogin", {
                    "__class__": "OC\\AppFramework\\DependencyInjection\\DIContainer"
                }, {
                    "_route": "core.login.tryLogin"
                }]
            }, {
                "file": "/var/www/nextcloud/lib/base.php",
                "line": 1008,
                "function": "match",
                "class": "OC\\Route\\Router",
                "type": "->",
                "args": ["/login"]
            }, {
                "file": "/var/www/nextcloud/index.php",
                "line": 36,
                "function": "handleRequest",
                "class": "OC",
                "type": "::",
                "args": []
            }],
            "File": "/var/www/nextcloud/apps/files_external/lib/Lib/Auth/Password/SessionCredentials.php",
            "Line": 60
        },
        "CustomMessage": "--"
    }
}

**23.0.5**:

{
    "reqId": "lxWjJnscVYZkgu32jh4Z",
    "level": 3,
    "time": "2022-05-25T14:32:00+00:00",
    "remoteAddr": "*** sensitive parameter replaced ***",
    "user": "root",
    "app": "index",
    "method": "POST",
    "url": "/login",
    "message": "Call to a member function setBackendOption() on string in file '/var/www/nextcloud/apps/files_external/lib/Lib/Auth/Password/SessionCredentials.php' line 60",
    "userAgent": "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:100.0) Gecko/20100101 Firefox/100.0",
    "version": "23.0.5.1",
    "exception": {
        "Exception": "Exception",
        "Message": "Call to a member function setBackendOption() on string in file '/var/www/nextcloud/apps/files_external/lib/Lib/Auth/Password/SessionCredentials.php' line 60",
        "Code": 0,
        "Trace": [{
            "file": "/var/www/nextcloud/lib/private/AppFramework/App.php",
            "line": 157,
            "function": "dispatch",
            "class": "OC\\AppFramework\\Http\\Dispatcher",
            "type": "->",
            "args": [{
                "__class__": "OC\\Core\\Controller\\LoginController"
            }, "tryLogin"]
        }, {
            "file": "/var/www/nextcloud/lib/private/Route/Router.php",
            "line": 302,
            "function": "main",
            "class": "OC\\AppFramework\\App",
            "type": "::",
            "args": ["OC\\Core\\Controller\\LoginController", "tryLogin", {
                "__class__": "OC\\AppFramework\\DependencyInjection\\DIContainer"
            }, {
                "_route": "core.login.tryLogin"
            }]
        }, {
            "file": "/var/www/nextcloud/lib/base.php",
            "line": 1008,
            "function": "match",
            "class": "OC\\Route\\Router",
            "type": "->",
            "args": ["/login"]
        }, {
            "file": "/var/www/nextcloud/index.php",
            "line": 36,
            "function": "handleRequest",
            "class": "OC",
            "type": "::",
            "args": []
        }],
        "File": "/var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php",
        "Line": 158,
        "Previous": {
            "Exception": "Error",
            "Message": "Call to a member function setBackendOption() on string",
            "Code": 0,
            "Trace": [{
                "file": "/var/www/nextcloud/apps/files_external/lib/Config/ConfigAdapter.php",
                "line": 94,
                "function": "manipulateStorageConfig",
                "class": "OCA\\Files_External\\Lib\\Auth\\Password\\SessionCredentials",
                "type": "->",
                "args": ["*** sensitive parameter replaced ***", "*** sensitive parameter replaced ***"]
            }, {
                "file": "/var/www/nextcloud/apps/files_external/lib/Config/ConfigAdapter.php",
                "line": 132,
                "function": "prepareStorageConfig",
                "class": "OCA\\Files_External\\Config\\ConfigAdapter",
                "type": "->",
                "args": ["*** sensitive parameter replaced ***", "*** sensitive parameter replaced ***"]
            }, {
                "function": "OCA\\Files_External\\Config\\{closure}",
                "class": "OCA\\Files_External\\Config\\ConfigAdapter",
                "type": "->",
                "args": ["*** sensitive parameters replaced ***"]
            }, {
                "file": "/var/www/nextcloud/apps/files_external/lib/Config/ConfigAdapter.php",
                "line": 130,
                "function": "array_map",
                "args": [{
                    "__class__": "Closure"
                }, {
                    "1": {
                        "__class__": "OCA\\Files_External\\Lib\\StorageConfig"
                    },
                    "2": {
                        "__class__": "OCA\\Files_External\\Lib\\StorageConfig"
                    },
                    "3": {
                        "__class__": "OCA\\Files_External\\Lib\\StorageConfig"
                    },
                    "6": {
                        "__class__": "OCA\\Files_External\\Lib\\StorageConfig"
                    },
                    "7": {
                        "__class__": "OCA\\Files_External\\Lib\\StorageConfig"
                    }
                }]
            }, {
                "file": "/var/www/nextcloud/lib/private/Files/Config/MountProviderCollection.php",
                "line": 108,
                "function": "getMountsForUser",
                "class": "OCA\\Files_External\\Config\\ConfigAdapter",
                "type": "->",
                "args": ["*** sensitive parameter replaced ***", {
                    "__class__": "OC\\Files\\Storage\\StorageFactory"
                }]
            }, {
                "file": "/var/www/nextcloud/lib/private/Files/Filesystem.php",
                "line": 424,
                "function": "addMountForUser",
                "class": "OC\\Files\\Config\\MountProviderCollection",
                "type": "->",
                "args": ["*** sensitive parameter replaced ***", {
                    "__class__": "OC\\Files\\Mount\\Manager"
                }]
            }, {
                "file": "/var/www/nextcloud/lib/private/Cache/File.php",
                "line": 57,
                "function": "initMountPoints",
                "class": "OC\\Files\\Filesystem",
                "type": "::",
                "args": ["*** sensitive parameter replaced ***"]
            }, {
                "file": "/var/www/nextcloud/lib/private/Cache/File.php",
                "line": 178,
                "function": "getStorage",
                "class": "OC\\Cache\\File",
                "type": "->",
                "args": []
            }, {
                "file": "/var/www/nextcloud/lib/base.php",
                "line": 816,
                "function": "gc",
                "class": "OC\\Cache\\File",
                "type": "->",
                "args": []
            }, {
                "function": "{closure}",
                "class": "OC",
                "type": "::",
                "args": ["*** sensitive parameters replaced ***"]
            }, {
                "file": "/var/www/nextcloud/lib/private/Hooks/EmitterTrait.php",
                "line": 106,
                "function": "call_user_func_array",
                "args": [{
                        "__class__": "Closure"
                    },
                    ["*** sensitive parameter replaced ***", "*** sensitive parameter replaced ***", "*** sensitive parameter replaced ***", "*** sensitive parameter replaced ***"]
                ]
            }, {
                "file": "/var/www/nextcloud/lib/private/Hooks/PublicEmitter.php",
                "line": 40,
                "function": "emit",
                "class": "OC\\Hooks\\BasicEmitter",
                "type": "->",
                "args": ["\\OC\\User", "postLogin", ["*** sensitive parameter replaced ***", "*** sensitive parameter replaced ***", "*** sensitive parameter replaced ***", "*** sensitive parameter replaced ***"]]
            }, {
                "file": "/var/www/nextcloud/lib/private/User/Session.php",
                "line": 411,
                "function": "emit",
                "class": "OC\\Hooks\\PublicEmitter",
                "type": "->",
                "args": ["\\OC\\User", "postLogin", ["*** sensitive parameter replaced ***", "*** sensitive parameter replaced ***", "*** sensitive parameter replaced ***", "*** sensitive parameter replaced ***"]]
            }, {
                "file": "/var/www/nextcloud/lib/private/Authentication/Login/CompleteLoginCommand.php",
                "line": 44,
                "function": "completeLogin",
                "class": "OC\\User\\Session",
                "type": "->",
                "args": ["*** sensitive parameters replaced ***"]
            }, {
                "file": "/var/www/nextcloud/lib/private/Authentication/Login/ALoginCommand.php",
                "line": 40,
                "function": "process",
                "class": "OC\\Authentication\\Login\\CompleteLoginCommand",
                "type": "->",
                "args": [{
                    "__class__": "OC\\Authentication\\Login\\LoginData"
                }]
            }, {
                "file": "/var/www/nextcloud/lib/private/Authentication/Login/LoggedInCheckCommand.php",
                "line": 60,
                "function": "processNextOrFinishSuccessfully",
                "class": "OC\\Authentication\\Login\\ALoginCommand",
                "type": "->",
                "args": [{
                    "__class__": "OC\\Authentication\\Login\\LoginData"
                }]
            }, {
                "file": "/var/www/nextcloud/lib/private/Authentication/Login/ALoginCommand.php",
                "line": 40,
                "function": "process",
                "class": "OC\\Authentication\\Login\\LoggedInCheckCommand",
                "type": "->",
                "args": [{
                    "__class__": "OC\\Authentication\\Login\\LoginData"
                }]
            }, {
                "file": "/var/www/nextcloud/lib/private/Authentication/Login/EmailLoginCommand.php",
                "line": 58,
                "function": "processNextOrFinishSuccessfully",
                "class": "OC\\Authentication\\Login\\ALoginCommand",
                "type": "->",
                "args": [{
                    "__class__": "OC\\Authentication\\Login\\LoginData"
                }]
            }, {
                "file": "/var/www/nextcloud/lib/private/Authentication/Login/ALoginCommand.php",
                "line": 40,
                "function": "process",
                "class": "OC\\Authentication\\Login\\EmailLoginCommand",
                "type": "->",
                "args": [{
                    "__class__": "OC\\Authentication\\Login\\LoginData"
                }]
            }, {
                "file": "/var/www/nextcloud/lib/private/Authentication/Login/UidLoginCommand.php",
                "line": 54,
                "function": "processNextOrFinishSuccessfully",
                "class": "OC\\Authentication\\Login\\ALoginCommand",
                "type": "->",
                "args": [{
                    "__class__": "OC\\Authentication\\Login\\LoginData"
                }]
            }, {
                "file": "/var/www/nextcloud/lib/private/Authentication/Login/ALoginCommand.php",
                "line": 40,
                "function": "process",
                "class": "OC\\Authentication\\Login\\UidLoginCommand",
                "type": "->",
                "args": [{
                    "__class__": "OC\\Authentication\\Login\\LoginData"
                }]
            }, {
                "file": "/var/www/nextcloud/lib/private/Authentication/Login/UserDisabledCheckCommand.php",
                "line": 58,
                "function": "processNextOrFinishSuccessfully",
                "class": "OC\\Authentication\\Login\\ALoginCommand",
                "type": "->",
                "args": [{
                    "__class__": "OC\\Authentication\\Login\\LoginData"
                }]
            }, {
                "file": "/var/www/nextcloud/lib/private/Authentication/Login/ALoginCommand.php",
                "line": 40,
                "function": "process",
                "class": "OC\\Authentication\\Login\\UserDisabledCheckCommand",
                "type": "->",
                "args": [{
                    "__class__": "OC\\Authentication\\Login\\LoginData"
                }]
            }, {
                "file": "/var/www/nextcloud/lib/private/Authentication/Login/PreLoginHookCommand.php",
                "line": 53,
                "function": "processNextOrFinishSuccessfully",
                "class": "OC\\Authentication\\Login\\ALoginCommand",
                "type": "->",
                "args": [{
                    "__class__": "OC\\Authentication\\Login\\LoginData"
                }]
            }, {
                "file": "/var/www/nextcloud/lib/private/Authentication/Login/Chain.php",
                "line": 108,
                "function": "process",
                "class": "OC\\Authentication\\Login\\PreLoginHookCommand",
                "type": "->",
                "args": [{
                    "__class__": "OC\\Authentication\\Login\\LoginData"
                }]
            }, {
                "file": "/var/www/nextcloud/core/Controller/LoginController.php",
                "line": 329,
                "function": "process",
                "class": "OC\\Authentication\\Login\\Chain",
                "type": "->",
                "args": [{
                    "__class__": "OC\\Authentication\\Login\\LoginData"
                }]
            }, {
                "file": "/var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php",
                "line": 217,
                "function": "tryLogin",
                "class": "OC\\Core\\Controller\\LoginController",
                "type": "->",
                "args": ["*** sensitive parameters replaced ***"]
            }, {
                "file": "/var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php",
                "line": 126,
                "function": "executeController",
                "class": "OC\\AppFramework\\Http\\Dispatcher",
                "type": "->",
                "args": [{
                    "__class__": "OC\\Core\\Controller\\LoginController"
                }, "tryLogin"]
            }, {
                "file": "/var/www/nextcloud/lib/private/AppFramework/App.php",
                "line": 157,
                "function": "dispatch",
                "class": "OC\\AppFramework\\Http\\Dispatcher",
                "type": "->",
                "args": [{
                    "__class__": "OC\\Core\\Controller\\LoginController"
                }, "tryLogin"]
            }, {
                "file": "/var/www/nextcloud/lib/private/Route/Router.php",
                "line": 302,
                "function": "main",
                "class": "OC\\AppFramework\\App",
                "type": "::",
                "args": ["OC\\Core\\Controller\\LoginController", "tryLogin", {
                    "__class__": "OC\\AppFramework\\DependencyInjection\\DIContainer"
                }, {
                    "_route": "core.login.tryLogin"
                }]
            }, {
                "file": "/var/www/nextcloud/lib/base.php",
                "line": 1008,
                "function": "match",
                "class": "OC\\Route\\Router",
                "type": "->",
                "args": ["/login"]
            }, {
                "file": "/var/www/nextcloud/index.php",
                "line": 36,
                "function": "handleRequest",
                "class": "OC",
                "type": "::",
                "args": []
            }],
            "File": "/var/www/nextcloud/apps/files_external/lib/Lib/Auth/Password/SessionCredentials.php",
            "Line": 60
        },
        "CustomMessage": "--"
    }
@phreaker0 phreaker0 added 0. Needs triage Pending check for reproducibility or if it fits our roadmap bug labels May 25, 2022
@phreaker0
Copy link
Contributor Author

I looked into the file "/var/www/nextcloud/apps/files_external/lib/Lib/Auth/Password/SessionCredentials.php" and added the following just before line 60:

error_log($storage);

After trying to login (v23.0.5), the log contains the literal string:

*** sensitive parameter replaced ***

@phreaker0
Copy link
Contributor Author

Trying this with the working v22.2.7 version I get the exception:

error_log() expects parameter 1 to be string, object given at /var/www/nextcloud/apps/files_external/lib/Lib/Auth/Password/SessionCredentials.php#60

which is expected, as the variable needs to be an object and not a string like with the later versions.

@Veneld509
Copy link

Veneld509 commented May 28, 2022

After updating to 23.0.5, I had the same issue:

{"reqId":"UpqVCncBIbSS3DQxF6mD","level":3,"time":"May 27, 2022 23:18:51","remoteAddr":"192.168.1.1","user":"Venel Valcourt","app":"index","method":"POST","url":"/index.php/login","message":"Call to a member function setBackendOption() on string in file '/volume1/web/nextcloud/apps/files_external/lib/Lib/Auth/Password/SessionCredentials.php' line 60","userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/101.0.4951.64 Safari/537.36 Edg/101.0.1210.53","version":"24.0.1.1","exception":{"Exception":"Exception","Message":"Call to a member function setBackendOption() on string in file '/volume1/web/nextcloud/apps/files_external/lib/Lib/Auth/Password/SessionCredentials.php' line 60","Code":0,"Trace":[{"file":"/volume1/web/nextcloud/lib/private/AppFramework/App.php","line":172,"function":"dispatch","class":"OC\AppFramework\Http\Dispatcher","type":"->","args":[{"class":"OC\Core\Controller\LoginController"},"tryLogin"]},{"file":"/volume1/web/nextcloud/lib/private/Route/Router.php","line":298,"function":"main","class":"OC\AppFramework\App","type":"::","args":["OC\Core\Controller\LoginController","tryLogin",{"class":"OC\AppFramework\DependencyInjection\DIContainer"},{"_route":"core.login.tryLogin"}]},{"file":"/volume1/web/nextcloud/lib/base.php","line":1023,"function":"match","class":"OC\Route\Router","type":"->","args":["/login"]},{"file":"/volume1/web/nextcloud/index.php","line":36,"function":"handleRequest","class":"OC","type":"::","args":[]}],"File":"/volume1/web/nextcloud/lib/private/AppFramework/Http/Dispatcher.php","Line":165,"Previous":{"Exception":"Error","Message":"Call to a member function setBackendOption() on string","Code":0,"Trace":[{"file":"/volume1/web/nextcloud/apps/files_external/lib/Config/ConfigAdapter.php","line":88,"function":"manipulateStorageConfig","class":"OCA\Files_External\Lib\Auth\Password\SessionCredentials","type":"->","args":["*** sensitive parameter replaced "," sensitive parameter replaced "]},{"file":"/volume1/web/nextcloud/apps/files_external/lib/Config/ConfigAdapter.php","line":124,"function":"prepareStorageConfig","class":"OCA\Files_External\Config\ConfigAdapter","type":"->","args":[" sensitive parameter replaced "," sensitive parameter replaced "]},{"function":"OCA\Files_External\Config\{closure}","class":"OCA\Files_External\Config\ConfigAdapter","type":"->","args":[" sensitive parameters replaced "]},{"file":"/volume1/web/nextcloud/apps/files_external/lib/Config/ConfigAdapter.php","line":122,"function":"array_map","args":[{"class":"Closure"},{"1":{"class":"OCA\Files_External\Lib\StorageConfig"},"2":{"class":"OCA\Files_External\Lib\StorageConfig"}}]},{"file":"/volume1/web/nextcloud/lib/private/Files/Config/MountProviderCollection.php","line":124,"function":"getMountsForUser","class":"OCA\Files_External\Config\ConfigAdapter","type":"->","args":[" sensitive parameter replaced ",{"class":"OC\Files\Storage\StorageFactory"}]},{"file":"/volume1/web/nextcloud/lib/private/Files/SetupManager.php","line":213,"function":"addMountForUser","class":"OC\Files\Config\MountProviderCollection","type":"->","args":[" sensitive parameter replaced ",{"class":"OC\Files\Mount\Manager"},{"class":"Closure"}]},{"file":"/volume1/web/nextcloud/lib/private/Files/SetupManager.php","line":302,"function":"OC\Files\{closure}","class":"OC\Files\SetupManager","type":"->","args":[" sensitive parameters replaced "]},{"file":"/volume1/web/nextcloud/lib/private/Files/SetupManager.php","line":214,"function":"setupForUserWith","class":"OC\Files\SetupManager","type":"->","args":[" sensitive parameter replaced ",{"class":"Closure"}]},{"file":"/volume1/web/nextcloud/lib/private/Files/Filesystem.php","line":379,"function":"setupForUser","class":"OC\Files\SetupManager","type":"->","args":[" sensitive parameter replaced "]},{"file":"/volume1/web/nextcloud/lib/private/Cache/File.php","line":57,"function":"initMountPoints","class":"OC\Files\Filesystem","type":"::","args":[" sensitive parameter replaced "]},{"file":"/volume1/web/nextcloud/lib/private/Cache/File.php","line":178,"function":"getStorage","class":"OC\Cache\File","type":"->","args":[]},{"file":"/volume1/web/nextcloud/lib/base.php","line":831,"function":"gc","class":"OC\Cache\File","type":"->","args":[]},{"function":"{closure}","class":"OC","type":"::","args":[" sensitive parameters replaced "]},{"file":"/volume1/web/nextcloud/lib/private/Hooks/EmitterTrait.php","line":106,"function":"call_user_func_array","args":[{"class":"Closure"},[" sensitive parameter replaced "," sensitive parameter replaced "," sensitive parameter replaced "," sensitive parameter replaced "]]},{"file":"/volume1/web/nextcloud/lib/private/Hooks/PublicEmitter.php","line":40,"function":"emit","class":"OC\Hooks\BasicEmitter","type":"->","args":["\OC\User","postLogin",[" sensitive parameter replaced "," sensitive parameter replaced "," sensitive parameter replaced "," sensitive parameter replaced "]]},{"file":"/volume1/web/nextcloud/lib/private/User/Session.php","line":400,"function":"emit","class":"OC\Hooks\PublicEmitter","type":"->","args":["\OC\User","postLogin",[" sensitive parameter replaced "," sensitive parameter replaced "," sensitive parameter replaced "," sensitive parameter replaced "]]},{"file":"/volume1/web/nextcloud/lib/private/Authentication/Login/CompleteLoginCommand.php","line":44,"function":"completeLogin","class":"OC\User\Session","type":"->","args":[" sensitive parameters replaced "]},{"file":"/volume1/web/nextcloud/lib/private/Authentication/Login/ALoginCommand.php","line":40,"function":"process","class":"OC\Authentication\Login\CompleteLoginCommand","type":"->","args":[{"class":"OC\Authentication\Login\LoginData"}]},{"file":"/volume1/web/nextcloud/lib/private/Authentication/Login/LoggedInCheckCommand.php","line":60,"function":"processNextOrFinishSuccessfully","class":"OC\Authentication\Login\ALoginCommand","type":"->","args":[{"class":"OC\Authentication\Login\LoginData"}]},{"file":"/volume1/web/nextcloud/lib/private/Authentication/Login/ALoginCommand.php","line":40,"function":"process","class":"OC\Authentication\Login\LoggedInCheckCommand","type":"->","args":[{"class":"OC\Authentication\Login\LoginData"}]},{"file":"/volume1/web/nextcloud/lib/private/Authentication/Login/EmailLoginCommand.php","line":58,"function":"processNextOrFinishSuccessfully","class":"OC\Authentication\Login\ALoginCommand","type":"->","args":[{"class":"OC\Authentication\Login\LoginData"}]},{"file":"/volume1/web/nextcloud/lib/private/Authentication/Login/ALoginCommand.php","line":40,"function":"process","class":"OC\Authentication\Login\EmailLoginCommand","type":"->","args":[{"class":"OC\Authentication\Login\LoginData"}]},{"file":"/volume1/web/nextcloud/lib/private/Authentication/Login/UidLoginCommand.php","line":54,"function":"processNextOrFinishSuccessfully","class":"OC\Authentication\Login\ALoginCommand","type":"->","args":[{"class":"OC\Authentication\Login\LoginData"}]},{"file":"/volume1/web/nextcloud/lib/private/Authentication/Login/ALoginCommand.php","line":40,"function":"process","class":"OC\Authentication\Login\UidLoginCommand","type":"->","args":[{"class":"OC\Authentication\Login\LoginData"}]},{"file":"/volume1/web/nextcloud/lib/private/Authentication/Login/UserDisabledCheckCommand.php","line":58,"function":"processNextOrFinishSuccessfully","class":"OC\Authentication\Login\ALoginCommand","type":"->","args":[{"class":"OC\Authentication\Login\LoginData"}]},{"file":"/volume1/web/nextcloud/lib/private/Authentication/Login/ALoginCommand.php","line":40,"function":"process","class":"OC\Authentication\Login\UserDisabledCheckCommand","type":"->","args":[{"class":"OC\Authentication\Login\LoginData"}]},{"file":"/volume1/web/nextcloud/lib/private/Authentication/Login/PreLoginHookCommand.php","line":53,"function":"processNextOrFinishSuccessfully","class":"OC\Authentication\Login\ALoginCommand","type":"->","args":[{"class":"OC\Authentication\Login\LoginData"}]},{"file":"/volume1/web/nextcloud/lib/private/Authentication/Login/Chain.php","line":108,"function":"process","class":"OC\Authentication\Login\PreLoginHookCommand","type":"->","args":[{"class":"OC\Authentication\Login\LoginData"}]},{"file":"/volume1/web/nextcloud/core/Controller/LoginController.php","line":329,"function":"process","class":"OC\Authentication\Login\Chain","type":"->","args":[{"class":"OC\Authentication\Login\LoginData"}]},{"file":"/volume1/web/nextcloud/lib/private/AppFramework/Http/Dispatcher.php","line":225,"function":"tryLogin","class":"OC\Core\Controller\LoginController","type":"->","args":[" sensitive parameters replaced ***"]},{"file":"/volume1/web/nextcloud/lib/private/AppFramework/Http/Dispatcher.php","line":133,"function":"executeController","class":"OC\AppFramework\Http\Dispatcher","type":"->","args":[{"class":"OC\Core\Controller\LoginController"},"tryLogin"]},{"file":"/volume1/web/nextcloud/lib/private/AppFramework/App.php","line":172,"function":"dispatch","class":"OC\AppFramework\Http\Dispatcher","type":"->","args":[{"class":"OC\Core\Controller\LoginController"},"tryLogin"]},{"file":"/volume1/web/nextcloud/lib/private/Route/Router.php","line":298,"function":"main","class":"OC\AppFramework\App","type":"::","args":["OC\Core\Controller\LoginController","tryLogin",{"class":"OC\AppFramework\DependencyInjection\DIContainer"},{"_route":"core.login.tryLogin"}]},{"file":"/volume1/web/nextcloud/lib/base.php","line":1023,"function":"match","class":"OC\Route\Router","type":"->","args":["/login"]},{"file":"/volume1/web/nextcloud/index.php","line":36,"function":"handleRequest","class":"OC","type":"::","args":[]}],"File":"/volume1/web/nextcloud/apps/files_external/lib/Lib/Auth/Password/SessionCredentials.php","Line":60},"CustomMessage":"--"}}

If you have any solutions, I'm a taker. Thanks !

@InFFOrmatik
Copy link

Hi,
we have a NC-instance with LDAP-Login and SMB-Shares, that are loaded via the files_external app.
After upgrade
from NC23.0.4.1 with files_external 1.15.0
to NC24.0.0.12 with files_external 1.16.1
we face the same issue, that users cannot login anymore and the server produces an internal server error upon login and the logfile shows the above mentioned SessionCredentials-error.
Only disabling the files_external app is helping at the moment.
Best Regards
Matt

@mphilosopher
Copy link

Hi, same issue here after upgrade to NC23.0.5; temporary solved by editing:
lib/private/Authentication/LoginCredentials/Store.php at line 104:

} catch (InvalidTokenException $ex) {
                        //$this->logger->debug('could not get login credentials because the token is invalid: ' . $ex->getMessage(), ['app' => 'core', 'exception' => $ex]);
                        $this->logger->debug('could not get login credentials because the token is invalid', ['app' => 'core']);
                        $trySession = true;

69f5f01

Best Regards,
Mauro

@InFFOrmatik
Copy link

Hi, same issue here after upgrade to NC23.0.5; temporary solved by editing: lib/private/Authentication/LoginCredentials/Store.php at line 104:

} catch (InvalidTokenException $ex) {
                        //$this->logger->debug('could not get login credentials because the token is invalid: ' . $ex->getMessage(), ['app' => 'core', 'exception' => $ex]);
                        $this->logger->debug('could not get login credentials because the token is invalid', ['app' => 'core']);
                        $trySession = true;

69f5f01

Best Regards, Mauro

Dear Mauro,
your proposal did in fact solve this issue for us.
Thank you very much.

@cz9dev
Copy link

cz9dev commented May 31, 2022

Hi, same issue here after upgrade to NC23.0.5; temporary solved by editing: lib/private/Authentication/LoginCredentials/Store.php at line 104:

} catch (InvalidTokenException $ex) {
                        //$this->logger->debug('could not get login credentials because the token is invalid: ' . $ex->getMessage(), ['app' => 'core', 'exception' => $ex]);
                        $this->logger->debug('could not get login credentials because the token is invalid', ['app' => 'core']);
                        $trySession = true;

69f5f01

Best Regards, Mauro

Su solución nos permitió resolver este error
Muchas gracias

@phreaker0
Copy link
Contributor Author

@ChristophWurst since you commited the breaking change 69f5f01, can you have a look?

@ChristophWurst
Copy link
Member

69f5f01 only changes the logging. How is that the breaking change?

@phreaker0
Copy link
Contributor Author

phreaker0 commented Jun 1, 2022

@ChristophWurst the other three people in this issue thread reverted your change and it worked again after, so it's safe to say that this change is the problem here. Regarding the reason I can only speculate because I don't know the code but based on our observations:

  • the logger now gets the passed exception
  • the logger makes sure that no sensitive information is logged and removes objects with the string "*** sensitive parameter replaced ***"
  • after the exception and logging is done ($trySession = true) ordinary login is done ( )
  • in this special case after the login the credentials will be stored in the storage object for use with external storage:
    $storage->setBackendOption('user', $credentials->getLoginName());
  • But the logger apparently replaced the "StorageConfig &$storage," object with the string "*** sensitive parameter replaced ***" and therefore an exception is raised

@ChristophWurst
Copy link
Member

This doesn't fully make sense yet but if it helps we can remove logging the exception. I assume logging the exception message is still OK.

#32685

@ChristophWurst ChristophWurst added 3. to review Waiting for reviews and removed 0. Needs triage Pending check for reproducibility or if it fits our roadmap labels Jun 1, 2022
@phreaker0
Copy link
Contributor Author

PR works for me, thx!

@cz9dev
Copy link

cz9dev commented Jun 1, 2022

works for me

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3. to review Waiting for reviews bug
Projects
Development

Successfully merging a pull request may close this issue.

6 participants