nextcloud / server

☁️ Nextcloud server, a safe home for all your data
https://nextcloud.com
GNU Affero General Public License v3.0
27.4k stars 4.07k forks source link

[Bug]: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry 'NextCloud-da0f4174-c707-103c-89a4-dfb392a94239' for key 'user_ldap_membership_unique' #42482

Closed kcastner closed 10 months ago

kcastner commented 10 months ago

⚠️ This issue respects the following points: ⚠️

Bug description

After login via a LDAP based user, i get this error: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry 'NextCloud-da0f4174-c707-103c-89a4-dfb392a94239' for key 'user_ldap_membership_unique'

Steps to reproduce

  1. Login to a NC with LDAP user
  2. Login as admin and check server logs.

Expected behavior

Error message should not appear after successful login

Installation method

None

Nextcloud Server version

26

Operating system

None

PHP engine version

None

Web server

None

Database engine version

None

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

None

Are you using the Nextcloud Server Encryption module?

None

What user-backends are you using?

Configuration report

{
    "system": {
        "htaccess.RewriteBase": "\/",
        "memcache.local": "\\OC\\Memcache\\APCu",
        "apps_paths": [
            {
                "path": "\/var\/www\/html\/apps",
                "url": "\/apps",
                "writable": false
            },
            {
                "path": "\/var\/www\/html\/custom_apps",
                "url": "\/custom_apps",
                "writable": true
            }
        ],
        "mail_smtpmode": "smtp",
        "mail_smtphost": "***REMOVED SENSITIVE VALUE***",
        "mail_smtpport": "465",
        "mail_smtpsecure": "ssl",
        "mail_smtpauth": true,
        "mail_smtpauthtype": "LOGIN",
        "mail_smtpname": "***REMOVED SENSITIVE VALUE***",
        "mail_from_address": "***REMOVED SENSITIVE VALUE***",
        "mail_domain": "***REMOVED SENSITIVE VALUE***",
        "mail_smtppassword": "***REMOVED SENSITIVE VALUE***",
        "passwordsalt": "***REMOVED SENSITIVE VALUE***",
        "secret": "***REMOVED SENSITIVE VALUE***",
        "trusted_domains": [
            "localhost",
            "*"
        ],
        "overwriteprotocol": "https",
        "datadirectory": "***REMOVED SENSITIVE VALUE***",
        "dbtype": "mysql",
        "version": "28.0.1.1",
        "overwrite.cli.url": "http:\/\/localhost",
        "dbname": "***REMOVED SENSITIVE VALUE***",
        "dbhost": "***REMOVED SENSITIVE VALUE***",
        "dbport": "",
        "dbtableprefix": "oc_",
        "mysql.utf8mb4": true,
        "dbuser": "***REMOVED SENSITIVE VALUE***",
        "dbpassword": "***REMOVED SENSITIVE VALUE***",
        "installed": true,
        "instanceid": "***REMOVED SENSITIVE VALUE***",
        "ldapProviderFactory": "OCA\\User_LDAP\\LDAPProviderFactory",
        "loglevel": 2,
        "maintenance": false,
        "default_language": "de",
        "default_locale": "de_DE",
        "default_phone_region": "DE",
        "updater.release.channel": "stable"
    }
}

List of activated Apps

Enabled:
  - activity: 2.20.0
  - circles: 28.0.0-dev
  - cloud_federation_api: 1.11.0
  - comments: 1.18.0
  - contactsinteraction: 1.9.0
  - dashboard: 7.8.0
  - dav: 1.29.1
  - federatedfilesharing: 1.18.0
  - federation: 1.18.0
  - files: 2.0.0
  - files_pdfviewer: 2.9.0
  - files_reminders: 1.1.0
  - files_sharing: 1.20.0
  - files_trashbin: 1.18.0
  - files_versions: 1.21.0
  - firstrunwizard: 2.17.0
  - logreader: 2.13.0
  - lookup_server_connector: 1.16.0
  - nextcloud_announcements: 1.17.0
  - notifications: 2.16.0
  - oauth2: 1.16.3
  - password_policy: 1.18.0
  - photos: 2.4.0
  - privacy: 1.12.0
  - provisioning_api: 1.18.0
  - recommendations: 2.0.0
  - related_resources: 1.3.0
  - richdocuments: 8.3.0
  - serverinfo: 1.18.0
  - settings: 1.10.1
  - sharebymail: 1.18.0
  - spreed: 18.0.1
  - support: 1.11.0
  - survey_client: 1.16.0
  - systemtags: 1.18.0
  - text: 3.9.1
  - theming: 2.3.0
  - twofactor_backupcodes: 1.17.0
  - twofactor_totp: 10.0.0-beta.2
  - twofactor_webauthn: 1.3.2
  - updatenotification: 1.18.0
  - user_ldap: 1.19.0
  - user_status: 1.8.1
  - viewer: 2.2.0
  - weather_status: 1.8.0
  - workflowengine: 2.10.0
Disabled:
  - admin_audit: 1.18.0
  - bruteforcesettings: 2.8.0
  - encryption: 2.16.0 (installed 2.13.0)
  - files_external: 1.20.0
  - files_rightclick: 0.15.1 (installed 1.6.0)
  - richdocumentscode: 23.5.604 (installed 23.5.604)
  - suspicious_login: 6.0.0
  - user_saml: 6.0.1 (installed 6.0.1)

Nextcloud Signing status

No errors have been found.

Nextcloud Logs

Due to error "[...] body is too long [...]" - file will be attached

Additional info

nextcloud (1).log

joshtrichards commented 10 months ago

Duplicate of #42232

jangatzke commented 10 months ago

I am not sure if this is really a duplicate of #42232. I have deleted the duplicates from the database and was able to enable the LDAP app. But now this error occurs every time a user logs in for the first time. The users see an error 500 after successful login. After reloading the page, Nextcloud works fine and the users can access their files.

nextcloud.log:

,"message":"An exception occurred while executing a query: SQLSTATE[23505]: Unique violation: 7 ERROR:  duplicate key value violates unique constraint \"user_ldap_membership_unique\"\nDETAIL:  Key (groupid, userid)=(SQL-SPS_Error_Test-Read, FA67CEC4-4834-40B4-B440-2111B006933C) already exists.","exception":{},"CustomMessage":"An exception occurred while executing a query: SQLSTATE[23505]: Unique violation: 7 ERROR:  duplicate key value violates unique constraint \"user_ldap_membership_unique\"\nDETAIL:  Key (groupid, userid)=(username, FA67CEC4-4834-40B4-B440-2111B006933C) already exists."}}

PSQL log:

2024-01-04 13:42:40.656 CET [2891499] ncadmin@nextcloud_db DETAIL:  Key (groupid, userid)=(username, FA67CEC4-4834-40B4-B440-2111B006933C) already exists.
2024-01-04 13:42:40.656 CET [2891499] ncadmin@nextcloud_db STATEMENT:  INSERT INTO "oc_ldap_group_membership" ("groupid", "userid") VALUES($1, $2)

The user in the log is not the user who logged in!

kcastner commented 10 months ago

@jangatzke i wrote in the issue @joshtrichards mentioned - i did a recheck, there are other tables related to it. till now there is no solution. the workaround is as you sayed to relog :D

my current error log looks like this - im not sure if this will help out; the collabora errors are related due to update checks. due to the 25MB file limit at github, the log is uploaded to my nextcloud.

come-nc commented 10 months ago

Reopening as this one is not from the migration but at login. According to https://github.com/nextcloud/server/issues/42232#issuecomment-1879464658 the migration went fine and the new table exists.

Have to figure out why login tries to insert a duplicated groupmembership.

come-nc commented 10 months ago

@kcastner So you only get the problem once for each user?

Can you reproduce it easily so that you would be able to provide information from both before and after the problem about the LDAP and DB content?

kcastner commented 10 months ago

@kcastner So you only get the problem once for each user?

An LDAP user logs in and the first thing he gets is a 500 error. As soon as the user presses F5 and logs in again, they can use all services.

This process can be reproduced after logout, around 20 minutes later.

Unfortunately I no longer have any backup from the error. The LDAP structure has remained the same. No new users have been created in the meantime. I use Univention Corporate Server as LDAP provider.

I can't notice any differences in the database after an LDAP login. Which tables should specifically be affected? The membership table still contains the entries that it contained before login.

jangatzke commented 10 months ago

@kcastner So you only get the problem once for each user?

An LDAP user logs in and the first thing he gets is a 500 error. As soon as the user presses F5 and logs in again, they can use all services.

This process can be reproduced after logout, around 20 minutes later.

Unfortunately I no longer have any backup from the error. The LDAP structure has remained the same. No new users have been created in the meantime. I use Univention Corporate Server as LDAP provider.

I can't notice any differences in the database after an LDAP login. Which tables should specifically be affected? The membership table still contains the entries that it contained before login.

Are yo sure you can reproduce the error with the same user after logout? I just tested it and got no error.

kcastner commented 10 months ago

Are yo sure you can reproduce the error with the same user after logout? I just tested it and got no error.

As I sayed , after round about 20 minutes the error will be back. Tried this again - I got 500 again with ID: HEy7dKu79u4705EZNXi2

My serverlog shows the following with this ID:

Log for this ID ```json { "reqId":"HEy7dKu79u4705EZNXi2", "level":3, "time":"2024-01-08T13:41:15+00:00", "remoteAddr":"172.19.0.1", "user":"da0f4174-c707-103c-89a4-dfb392a94239", "app":"index", "method":"POST", "url":"/login", "message":"An exception occurred while executing a query: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry 'NextCloud-da0f4174-c707-103c-89a4-dfb392a94239' for key 'user_ldap_membership_unique'", "userAgent":"Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Mobile Safari/537.36", "version":"28.0.1.1", "exception":{ "Exception":"OC\\DB\\Exceptions\\DbalException", "Message":"An exception occurred while executing a query: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry 'NextCloud-da0f4174-c707-103c-89a4-dfb392a94239' for key 'user_ldap_membership_unique'", "Code":1062, "Trace":[ { "file":"/var/www/html/lib/private/DB/QueryBuilder/QueryBuilder.php", "line":328, "function":"wrap", "class":"OC\\DB\\Exceptions\\DbalException", "type":"::", "args":[ [ "Doctrine\\DBAL\\Exception\\UniqueConstraintViolationException" ] ] }, { "file":"/var/www/html/lib/public/AppFramework/Db/QBMapper.php", "line":137, "function":"executeStatement", "class":"OC\\DB\\QueryBuilder\\QueryBuilder", "type":"->", "args":[ ] }, { "file":"/var/www/html/apps/user_ldap/lib/LoginListener.php", "line":95, "function":"insert", "class":"OCP\\AppFramework\\Db\\QBMapper", "type":"->", "args":[ [ "OCA\\User_LDAP\\Db\\GroupMembership", null ] ] }, { "file":"/var/www/html/apps/user_ldap/lib/LoginListener.php", "line":67, "function":"updateGroups", "class":"OCA\\User_LDAP\\LoginListener", "type":"->", "args":[ "*** sensitive parameters replaced ***" ] }, { "file":"/var/www/html/apps/user_ldap/lib/LoginListener.php", "line":55, "function":"onPostLogin", "class":"OCA\\User_LDAP\\LoginListener", "type":"->", "args":[ "*** sensitive parameters replaced ***" ] }, { "file":"/var/www/html/lib/private/EventDispatcher/ServiceEventListener.php", "line":86, "function":"handle", "class":"OCA\\User_LDAP\\LoginListener", "type":"->", "args":[ [ "OCP\\User\\Events\\PostLoginEvent" ] ] }, { "file":"/var/www/html/3rdparty/symfony/event-dispatcher/EventDispatcher.php", "line":230, "function":"__invoke", "class":"OC\\EventDispatcher\\ServiceEventListener", "type":"->", "args":[ [ "OCP\\User\\Events\\PostLoginEvent" ], "OCP\\User\\Events\\PostLoginEvent", [ "Symfony\\Component\\EventDispatcher\\EventDispatcher" ] ] }, { "file":"/var/www/html/3rdparty/symfony/event-dispatcher/EventDispatcher.php", "line":59, "function":"callListeners", "class":"Symfony\\Component\\EventDispatcher\\EventDispatcher", "type":"->", "args":[ [ [ "Closure" ], [ "Closure" ], [ "Closure" ], [ "Closure" ] ], "OCP\\User\\Events\\PostLoginEvent", [ "OCP\\User\\Events\\PostLoginEvent" ] ] }, { "file":"/var/www/html/lib/private/EventDispatcher/EventDispatcher.php", "line":94, "function":"dispatch", "class":"Symfony\\Component\\EventDispatcher\\EventDispatcher", "type":"->", "args":[ [ "OCP\\User\\Events\\PostLoginEvent" ], "OCP\\User\\Events\\PostLoginEvent" ] }, { "file":"/var/www/html/lib/private/EventDispatcher/EventDispatcher.php", "line":106, "function":"dispatch", "class":"OC\\EventDispatcher\\EventDispatcher", "type":"->", "args":[ "OCP\\User\\Events\\PostLoginEvent", [ "OCP\\User\\Events\\PostLoginEvent" ] ] }, { "file":"/var/www/html/lib/private/User/Session.php", "line":392, "function":"dispatchTyped", "class":"OC\\EventDispatcher\\EventDispatcher", "type":"->", "args":[ [ "OCP\\User\\Events\\PostLoginEvent" ] ] }, { "file":"/var/www/html/lib/private/Authentication/Login/CompleteLoginCommand.php", "line":39, "function":"completeLogin", "class":"OC\\User\\Session", "type":"->", "args":[ "*** sensitive parameters replaced ***" ] }, { "file":"/var/www/html/lib/private/Authentication/Login/ALoginCommand.php", "line":39, "function":"process", "class":"OC\\Authentication\\Login\\CompleteLoginCommand", "type":"->", "args":[ [ "OC\\Authentication\\Login\\LoginData" ] ] }, { "file":"/var/www/html/lib/private/Authentication/Login/LoggedInCheckCommand.php", "line":60, "function":"processNextOrFinishSuccessfully", "class":"OC\\Authentication\\Login\\ALoginCommand", "type":"->", "args":[ [ "OC\\Authentication\\Login\\LoginData" ] ] }, { "file":"/var/www/html/lib/private/Authentication/Login/ALoginCommand.php", "line":39, "function":"process", "class":"OC\\Authentication\\Login\\LoggedInCheckCommand", "type":"->", "args":[ [ "OC\\Authentication\\Login\\LoginData" ] ] }, { "file":"/var/www/html/lib/private/Authentication/Login/EmailLoginCommand.php", "line":68, "function":"processNextOrFinishSuccessfully", "class":"OC\\Authentication\\Login\\ALoginCommand", "type":"->", "args":[ [ "OC\\Authentication\\Login\\LoginData" ] ] }, { "file":"/var/www/html/lib/private/Authentication/Login/ALoginCommand.php", "line":39, "function":"process", "class":"OC\\Authentication\\Login\\EmailLoginCommand", "type":"->", "args":[ [ "OC\\Authentication\\Login\\LoginData" ] ] }, { "file":"/var/www/html/lib/private/Authentication/Login/UidLoginCommand.php", "line":53, "function":"processNextOrFinishSuccessfully", "class":"OC\\Authentication\\Login\\ALoginCommand", "type":"->", "args":[ [ "OC\\Authentication\\Login\\LoginData" ] ] }, { "file":"/var/www/html/lib/private/Authentication/Login/ALoginCommand.php", "line":39, "function":"process", "class":"OC\\Authentication\\Login\\UidLoginCommand", "type":"->", "args":[ [ "OC\\Authentication\\Login\\LoginData" ] ] }, { "file":"/var/www/html/lib/private/Authentication/Login/UserDisabledCheckCommand.php", "line":57, "function":"processNextOrFinishSuccessfully", "class":"OC\\Authentication\\Login\\ALoginCommand", "type":"->", "args":[ [ "OC\\Authentication\\Login\\LoginData" ] ] }, { "file":"/var/www/html/lib/private/Authentication/Login/ALoginCommand.php", "line":39, "function":"process", "class":"OC\\Authentication\\Login\\UserDisabledCheckCommand", "type":"->", "args":[ [ "OC\\Authentication\\Login\\LoginData" ] ] }, { "file":"/var/www/html/lib/private/Authentication/Login/PreLoginHookCommand.php", "line":52, "function":"processNextOrFinishSuccessfully", "class":"OC\\Authentication\\Login\\ALoginCommand", "type":"->", "args":[ [ "OC\\Authentication\\Login\\LoginData" ] ] }, { "file":"/var/www/html/lib/private/Authentication/Login/Chain.php", "line":107, "function":"process", "class":"OC\\Authentication\\Login\\PreLoginHookCommand", "type":"->", "args":[ [ "OC\\Authentication\\Login\\LoginData" ] ] }, { "file":"/var/www/html/core/Controller/LoginController.php", "line":307, "function":"process", "class":"OC\\Authentication\\Login\\Chain", "type":"->", "args":[ [ "OC\\Authentication\\Login\\LoginData" ] ] }, { "file":"/var/www/html/lib/private/AppFramework/Http/Dispatcher.php", "line":230, "function":"tryLogin", "class":"OC\\Core\\Controller\\LoginController", "type":"->", "args":[ "*** sensitive parameters replaced ***" ] }, { "file":"/var/www/html/lib/private/AppFramework/Http/Dispatcher.php", "line":137, "function":"executeController", "class":"OC\\AppFramework\\Http\\Dispatcher", "type":"->", "args":[ [ "OC\\Core\\Controller\\LoginController" ], "tryLogin" ] }, { "file":"/var/www/html/lib/private/AppFramework/App.php", "line":184, "function":"dispatch", "class":"OC\\AppFramework\\Http\\Dispatcher", "type":"->", "args":[ [ "OC\\Core\\Controller\\LoginController" ], "tryLogin" ] }, { "file":"/var/www/html/lib/private/Route/Router.php", "line":315, "function":"main", "class":"OC\\AppFramework\\App", "type":"::", "args":[ "OC\\Core\\Controller\\LoginController", "tryLogin", [ "OC\\AppFramework\\DependencyInjection\\DIContainer" ], [ "core.login.tryLogin" ] ] }, { "file":"/var/www/html/lib/base.php", "line":1069, "function":"match", "class":"OC\\Route\\Router", "type":"->", "args":[ "/login" ] }, { "file":"/var/www/html/index.php", "line":39, "function":"handleRequest", "class":"OC", "type":"::", "args":[ ] } ], "File":"/var/www/html/lib/private/DB/Exceptions/DbalException.php", "Line":71, "Previous":{ "Exception":"Doctrine\\DBAL\\Exception\\UniqueConstraintViolationException", "Message":"An exception occurred while executing a query: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry 'NextCloud-da0f4174-c707-103c-89a4-dfb392a94239' for key 'user_ldap_membership_unique'", "Code":1062, "Trace":[ { "file":"/var/www/html/3rdparty/doctrine/dbal/src/Connection.php", "line":1938, "function":"convert", "class":"Doctrine\\DBAL\\Driver\\API\\MySQL\\ExceptionConverter", "type":"->", "args":[ [ "Doctrine\\DBAL\\Driver\\PDO\\Exception" ], [ "Doctrine\\DBAL\\Query" ] ] }, { "file":"/var/www/html/3rdparty/doctrine/dbal/src/Connection.php", "line":1880, "function":"handleDriverException", "class":"Doctrine\\DBAL\\Connection", "type":"->", "args":[ [ "Doctrine\\DBAL\\Driver\\PDO\\Exception" ], [ "Doctrine\\DBAL\\Query" ] ] }, { "file":"/var/www/html/3rdparty/doctrine/dbal/src/Connection.php", "line":1208, "function":"convertExceptionDuringQuery", "class":"Doctrine\\DBAL\\Connection", "type":"->", "args":[ [ "Doctrine\\DBAL\\Driver\\PDO\\Exception" ], "INSERT INTO `oc_ldap_group_membership` (`groupid`, `userid`) VALUES(?, ?)", [ "NextCloud", "da0f4174-c707-103c-89a4-dfb392a94239" ], [ 2, 2 ] ] }, { "file":"/var/www/html/lib/private/DB/Connection.php", "line":294, "function":"executeStatement", "class":"Doctrine\\DBAL\\Connection", "type":"->", "args":[ "INSERT INTO `oc_ldap_group_membership` (`groupid`, `userid`) VALUES(?, ?)", [ "NextCloud", "da0f4174-c707-103c-89a4-dfb392a94239" ], [ 2, 2 ] ] }, { "file":"/var/www/html/3rdparty/doctrine/dbal/src/Query/QueryBuilder.php", "line":386, "function":"executeStatement", "class":"OC\\DB\\Connection", "type":"->", "args":[ "INSERT INTO `oc_ldap_group_membership` (`groupid`, `userid`) VALUES(:dcValue1, :dcValue2)", [ "NextCloud", "da0f4174-c707-103c-89a4-dfb392a94239" ], [ 2, 2 ] ] }, { "file":"/var/www/html/lib/private/DB/QueryBuilder/QueryBuilder.php", "line":280, "function":"execute", "class":"Doctrine\\DBAL\\Query\\QueryBuilder", "type":"->", "args":[ ] }, { "file":"/var/www/html/lib/private/DB/QueryBuilder/QueryBuilder.php", "line":326, "function":"execute", "class":"OC\\DB\\QueryBuilder\\QueryBuilder", "type":"->", "args":[ ] }, { "file":"/var/www/html/lib/public/AppFramework/Db/QBMapper.php", "line":137, "function":"executeStatement", "class":"OC\\DB\\QueryBuilder\\QueryBuilder", "type":"->", "args":[ ] }, { "file":"/var/www/html/apps/user_ldap/lib/LoginListener.php", "line":95, "function":"insert", "class":"OCP\\AppFramework\\Db\\QBMapper", "type":"->", "args":[ [ "OCA\\User_LDAP\\Db\\GroupMembership", null ] ] }, { "file":"/var/www/html/apps/user_ldap/lib/LoginListener.php", "line":67, "function":"updateGroups", "class":"OCA\\User_LDAP\\LoginListener", "type":"->", "args":[ "*** sensitive parameters replaced ***" ] }, { "file":"/var/www/html/apps/user_ldap/lib/LoginListener.php", "line":55, "function":"onPostLogin", "class":"OCA\\User_LDAP\\LoginListener", "type":"->", "args":[ "*** sensitive parameters replaced ***" ] }, { "file":"/var/www/html/lib/private/EventDispatcher/ServiceEventListener.php", "line":86, "function":"handle", "class":"OCA\\User_LDAP\\LoginListener", "type":"->", "args":[ [ "OCP\\User\\Events\\PostLoginEvent" ] ] }, { "file":"/var/www/html/3rdparty/symfony/event-dispatcher/EventDispatcher.php", "line":230, "function":"__invoke", "class":"OC\\EventDispatcher\\ServiceEventListener", "type":"->", "args":[ [ "OCP\\User\\Events\\PostLoginEvent" ], "OCP\\User\\Events\\PostLoginEvent", [ "Symfony\\Component\\EventDispatcher\\EventDispatcher" ] ] }, { "file":"/var/www/html/3rdparty/symfony/event-dispatcher/EventDispatcher.php", "line":59, "function":"callListeners", "class":"Symfony\\Component\\EventDispatcher\\EventDispatcher", "type":"->", "args":[ [ [ "Closure" ], [ "Closure" ], [ "Closure" ], [ "Closure" ] ], "OCP\\User\\Events\\PostLoginEvent", [ "OCP\\User\\Events\\PostLoginEvent" ] ] }, { "file":"/var/www/html/lib/private/EventDispatcher/EventDispatcher.php", "line":94, "function":"dispatch", "class":"Symfony\\Component\\EventDispatcher\\EventDispatcher", "type":"->", "args":[ [ "OCP\\User\\Events\\PostLoginEvent" ], "OCP\\User\\Events\\PostLoginEvent" ] }, { "file":"/var/www/html/lib/private/EventDispatcher/EventDispatcher.php", "line":106, "function":"dispatch", "class":"OC\\EventDispatcher\\EventDispatcher", "type":"->", "args":[ "OCP\\User\\Events\\PostLoginEvent", [ "OCP\\User\\Events\\PostLoginEvent" ] ] }, { "file":"/var/www/html/lib/private/User/Session.php", "line":392, "function":"dispatchTyped", "class":"OC\\EventDispatcher\\EventDispatcher", "type":"->", "args":[ [ "OCP\\User\\Events\\PostLoginEvent" ] ] }, { "file":"/var/www/html/lib/private/Authentication/Login/CompleteLoginCommand.php", "line":39, "function":"completeLogin", "class":"OC\\User\\Session", "type":"->", "args":[ "*** sensitive parameters replaced ***" ] }, { "file":"/var/www/html/lib/private/Authentication/Login/ALoginCommand.php", "line":39, "function":"process", "class":"OC\\Authentication\\Login\\CompleteLoginCommand", "type":"->", "args":[ [ "OC\\Authentication\\Login\\LoginData" ] ] }, { "file":"/var/www/html/lib/private/Authentication/Login/LoggedInCheckCommand.php", "line":60, "function":"processNextOrFinishSuccessfully", "class":"OC\\Authentication\\Login\\ALoginCommand", "type":"->", "args":[ [ "OC\\Authentication\\Login\\LoginData" ] ] }, { "file":"/var/www/html/lib/private/Authentication/Login/ALoginCommand.php", "line":39, "function":"process", "class":"OC\\Authentication\\Login\\LoggedInCheckCommand", "type":"->", "args":[ [ "OC\\Authentication\\Login\\LoginData" ] ] }, { "file":"/var/www/html/lib/private/Authentication/Login/EmailLoginCommand.php", "line":68, "function":"processNextOrFinishSuccessfully", "class":"OC\\Authentication\\Login\\ALoginCommand", "type":"->", "args":[ [ "OC\\Authentication\\Login\\LoginData" ] ] }, { "file":"/var/www/html/lib/private/Authentication/Login/ALoginCommand.php", "line":39, "function":"process", "class":"OC\\Authentication\\Login\\EmailLoginCommand", "type":"->", "args":[ [ "OC\\Authentication\\Login\\LoginData" ] ] }, { "file":"/var/www/html/lib/private/Authentication/Login/UidLoginCommand.php", "line":53, "function":"processNextOrFinishSuccessfully", "class":"OC\\Authentication\\Login\\ALoginCommand", "type":"->", "args":[ [ "OC\\Authentication\\Login\\LoginData" ] ] }, { "file":"/var/www/html/lib/private/Authentication/Login/ALoginCommand.php", "line":39, "function":"process", "class":"OC\\Authentication\\Login\\UidLoginCommand", "type":"->", "args":[ [ "OC\\Authentication\\Login\\LoginData" ] ] }, { "file":"/var/www/html/lib/private/Authentication/Login/UserDisabledCheckCommand.php", "line":57, "function":"processNextOrFinishSuccessfully", "class":"OC\\Authentication\\Login\\ALoginCommand", "type":"->", "args":[ [ "OC\\Authentication\\Login\\LoginData" ] ] }, { "file":"/var/www/html/lib/private/Authentication/Login/ALoginCommand.php", "line":39, "function":"process", "class":"OC\\Authentication\\Login\\UserDisabledCheckCommand", "type":"->", "args":[ [ "OC\\Authentication\\Login\\LoginData" ] ] }, { "file":"/var/www/html/lib/private/Authentication/Login/PreLoginHookCommand.php", "line":52, "function":"processNextOrFinishSuccessfully", "class":"OC\\Authentication\\Login\\ALoginCommand", "type":"->", "args":[ [ "OC\\Authentication\\Login\\LoginData" ] ] }, { "file":"/var/www/html/lib/private/Authentication/Login/Chain.php", "line":107, "function":"process", "class":"OC\\Authentication\\Login\\PreLoginHookCommand", "type":"->", "args":[ [ "OC\\Authentication\\Login\\LoginData" ] ] }, { "file":"/var/www/html/core/Controller/LoginController.php", "line":307, "function":"process", "class":"OC\\Authentication\\Login\\Chain", "type":"->", "args":[ [ "OC\\Authentication\\Login\\LoginData" ] ] }, { "file":"/var/www/html/lib/private/AppFramework/Http/Dispatcher.php", "line":230, "function":"tryLogin", "class":"OC\\Core\\Controller\\LoginController", "type":"->", "args":[ "*** sensitive parameters replaced ***" ] }, { "file":"/var/www/html/lib/private/AppFramework/Http/Dispatcher.php", "line":137, "function":"executeController", "class":"OC\\AppFramework\\Http\\Dispatcher", "type":"->", "args":[ [ "OC\\Core\\Controller\\LoginController" ], "tryLogin" ] }, { "file":"/var/www/html/lib/private/AppFramework/App.php", "line":184, "function":"dispatch", "class":"OC\\AppFramework\\Http\\Dispatcher", "type":"->", "args":[ [ "OC\\Core\\Controller\\LoginController" ], "tryLogin" ] }, { "file":"/var/www/html/lib/private/Route/Router.php", "line":315, "function":"main", "class":"OC\\AppFramework\\App", "type":"::", "args":[ "OC\\Core\\Controller\\LoginController", "tryLogin", [ "OC\\AppFramework\\DependencyInjection\\DIContainer" ], [ "core.login.tryLogin" ] ] }, { "file":"/var/www/html/lib/base.php", "line":1069, "function":"match", "class":"OC\\Route\\Router", "type":"->", "args":[ "/login" ] }, { "file":"/var/www/html/index.php", "line":39, "function":"handleRequest", "class":"OC", "type":"::", "args":[ ] } ], "File":"/var/www/html/3rdparty/doctrine/dbal/src/Driver/API/MySQL/ExceptionConverter.php", "Line":62, "Previous":{ "Exception":"Doctrine\\DBAL\\Driver\\PDO\\Exception", "Message":"SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry 'NextCloud-da0f4174-c707-103c-89a4-dfb392a94239' for key 'user_ldap_membership_unique'", "Code":1062, "Trace":[ { "file":"/var/www/html/3rdparty/doctrine/dbal/src/Driver/PDO/Statement.php", "line":132, "function":"new", "class":"Doctrine\\DBAL\\Driver\\PDO\\Exception", "type":"::", "args":[ [ "PDOException", [ "23000", 1062, "Duplicate entry 'NextCloud-da0f4174-c707-103c-89a4-dfb392a94239' for key 'user_ldap_membership_unique'" ] ] ] }, { "file":"/var/www/html/3rdparty/doctrine/dbal/src/Connection.php", "line":1202, "function":"execute", "class":"Doctrine\\DBAL\\Driver\\PDO\\Statement", "type":"->", "args":[ ] }, { "file":"/var/www/html/lib/private/DB/Connection.php", "line":294, "function":"executeStatement", "class":"Doctrine\\DBAL\\Connection", "type":"->", "args":[ "INSERT INTO `oc_ldap_group_membership` (`groupid`, `userid`) VALUES(?, ?)", [ "NextCloud", "da0f4174-c707-103c-89a4-dfb392a94239" ], [ 2, 2 ] ] }, { "file":"/var/www/html/3rdparty/doctrine/dbal/src/Query/QueryBuilder.php", "line":386, "function":"executeStatement", "class":"OC\\DB\\Connection", "type":"->", "args":[ "INSERT INTO `oc_ldap_group_membership` (`groupid`, `userid`) VALUES(:dcValue1, :dcValue2)", [ "NextCloud", "da0f4174-c707-103c-89a4-dfb392a94239" ], [ 2, 2 ] ] }, { "file":"/var/www/html/lib/private/DB/QueryBuilder/QueryBuilder.php", "line":280, "function":"execute", "class":"Doctrine\\DBAL\\Query\\QueryBuilder", "type":"->", "args":[ ] }, { "file":"/var/www/html/lib/private/DB/QueryBuilder/QueryBuilder.php", "line":326, "function":"execute", "class":"OC\\DB\\QueryBuilder\\QueryBuilder", "type":"->", "args":[ ] }, { "file":"/var/www/html/lib/public/AppFramework/Db/QBMapper.php", "line":137, "function":"executeStatement", "class":"OC\\DB\\QueryBuilder\\QueryBuilder", "type":"->", "args":[ ] }, { "file":"/var/www/html/apps/user_ldap/lib/LoginListener.php", "line":95, "function":"insert", "class":"OCP\\AppFramework\\Db\\QBMapper", "type":"->", "args":[ [ "OCA\\User_LDAP\\Db\\GroupMembership", null ] ] }, { "file":"/var/www/html/apps/user_ldap/lib/LoginListener.php", "line":67, "function":"updateGroups", "class":"OCA\\User_LDAP\\LoginListener", "type":"->", "args":[ "*** sensitive parameters replaced ***" ] }, { "file":"/var/www/html/apps/user_ldap/lib/LoginListener.php", "line":55, "function":"onPostLogin", "class":"OCA\\User_LDAP\\LoginListener", "type":"->", "args":[ "*** sensitive parameters replaced ***" ] }, { "file":"/var/www/html/lib/private/EventDispatcher/ServiceEventListener.php", "line":86, "function":"handle", "class":"OCA\\User_LDAP\\LoginListener", "type":"->", "args":[ [ "OCP\\User\\Events\\PostLoginEvent" ] ] }, { "file":"/var/www/html/3rdparty/symfony/event-dispatcher/EventDispatcher.php", "line":230, "function":"__invoke", "class":"OC\\EventDispatcher\\ServiceEventListener", "type":"->", "args":[ [ "OCP\\User\\Events\\PostLoginEvent" ], "OCP\\User\\Events\\PostLoginEvent", [ "Symfony\\Component\\EventDispatcher\\EventDispatcher" ] ] }, { "file":"/var/www/html/3rdparty/symfony/event-dispatcher/EventDispatcher.php", "line":59, "function":"callListeners", "class":"Symfony\\Component\\EventDispatcher\\EventDispatcher", "type":"->", "args":[ [ [ "Closure" ], [ "Closure" ], [ "Closure" ], [ "Closure" ] ], "OCP\\User\\Events\\PostLoginEvent", [ "OCP\\User\\Events\\PostLoginEvent" ] ] }, { "file":"/var/www/html/lib/private/EventDispatcher/EventDispatcher.php", "line":94, "function":"dispatch", "class":"Symfony\\Component\\EventDispatcher\\EventDispatcher", "type":"->", "args":[ [ "OCP\\User\\Events\\PostLoginEvent" ], "OCP\\User\\Events\\PostLoginEvent" ] }, { "file":"/var/www/html/lib/private/EventDispatcher/EventDispatcher.php", "line":106, "function":"dispatch", "class":"OC\\EventDispatcher\\EventDispatcher", "type":"->", "args":[ "OCP\\User\\Events\\PostLoginEvent", [ "OCP\\User\\Events\\PostLoginEvent" ] ] }, { "file":"/var/www/html/lib/private/User/Session.php", "line":392, "function":"dispatchTyped", "class":"OC\\EventDispatcher\\EventDispatcher", "type":"->", "args":[ [ "OCP\\User\\Events\\PostLoginEvent" ] ] }, { "file":"/var/www/html/lib/private/Authentication/Login/CompleteLoginCommand.php", "line":39, "function":"completeLogin", "class":"OC\\User\\Session", "type":"->", "args":[ "*** sensitive parameters replaced ***" ] }, { "file":"/var/www/html/lib/private/Authentication/Login/ALoginCommand.php", "line":39, "function":"process", "class":"OC\\Authentication\\Login\\CompleteLoginCommand", "type":"->", "args":[ [ "OC\\Authentication\\Login\\LoginData" ] ] }, { "file":"/var/www/html/lib/private/Authentication/Login/LoggedInCheckCommand.php", "line":60, "function":"processNextOrFinishSuccessfully", "class":"OC\\Authentication\\Login\\ALoginCommand", "type":"->", "args":[ [ "OC\\Authentication\\Login\\LoginData" ] ] }, { "file":"/var/www/html/lib/private/Authentication/Login/ALoginCommand.php", "line":39, "function":"process", "class":"OC\\Authentication\\Login\\LoggedInCheckCommand", "type":"->", "args":[ [ "OC\\Authentication\\Login\\LoginData" ] ] }, { "file":"/var/www/html/lib/private/Authentication/Login/EmailLoginCommand.php", "line":68, "function":"processNextOrFinishSuccessfully", "class":"OC\\Authentication\\Login\\ALoginCommand", "type":"->", "args":[ [ "OC\\Authentication\\Login\\LoginData" ] ] }, { "file":"/var/www/html/lib/private/Authentication/Login/ALoginCommand.php", "line":39, "function":"process", "class":"OC\\Authentication\\Login\\EmailLoginCommand", "type":"->", "args":[ [ "OC\\Authentication\\Login\\LoginData" ] ] }, { "file":"/var/www/html/lib/private/Authentication/Login/UidLoginCommand.php", "line":53, "function":"processNextOrFinishSuccessfully", "class":"OC\\Authentication\\Login\\ALoginCommand", "type":"->", "args":[ [ "OC\\Authentication\\Login\\LoginData" ] ] }, { "file":"/var/www/html/lib/private/Authentication/Login/ALoginCommand.php", "line":39, "function":"process", "class":"OC\\Authentication\\Login\\UidLoginCommand", "type":"->", "args":[ [ "OC\\Authentication\\Login\\LoginData" ] ] }, { "file":"/var/www/html/lib/private/Authentication/Login/UserDisabledCheckCommand.php", "line":57, "function":"processNextOrFinishSuccessfully", "class":"OC\\Authentication\\Login\\ALoginCommand", "type":"->", "args":[ [ "OC\\Authentication\\Login\\LoginData" ] ] }, { "file":"/var/www/html/lib/private/Authentication/Login/ALoginCommand.php", "line":39, "function":"process", "class":"OC\\Authentication\\Login\\UserDisabledCheckCommand", "type":"->", "args":[ [ "OC\\Authentication\\Login\\LoginData" ] ] }, { "file":"/var/www/html/lib/private/Authentication/Login/PreLoginHookCommand.php", "line":52, "function":"processNextOrFinishSuccessfully", "class":"OC\\Authentication\\Login\\ALoginCommand", "type":"->", "args":[ [ "OC\\Authentication\\Login\\LoginData" ] ] }, { "file":"/var/www/html/lib/private/Authentication/Login/Chain.php", "line":107, "function":"process", "class":"OC\\Authentication\\Login\\PreLoginHookCommand", "type":"->", "args":[ [ "OC\\Authentication\\Login\\LoginData" ] ] }, { "file":"/var/www/html/core/Controller/LoginController.php", "line":307, "function":"process", "class":"OC\\Authentication\\Login\\Chain", "type":"->", "args":[ [ "OC\\Authentication\\Login\\LoginData" ] ] }, { "file":"/var/www/html/lib/private/AppFramework/Http/Dispatcher.php", "line":230, "function":"tryLogin", "class":"OC\\Core\\Controller\\LoginController", "type":"->", "args":[ "*** sensitive parameters replaced ***" ] }, { "file":"/var/www/html/lib/private/AppFramework/Http/Dispatcher.php", "line":137, "function":"executeController", "class":"OC\\AppFramework\\Http\\Dispatcher", "type":"->", "args":[ [ "OC\\Core\\Controller\\LoginController" ], "tryLogin" ] }, { "file":"/var/www/html/lib/private/AppFramework/App.php", "line":184, "function":"dispatch", "class":"OC\\AppFramework\\Http\\Dispatcher", "type":"->", "args":[ [ "OC\\Core\\Controller\\LoginController" ], "tryLogin" ] }, { "file":"/var/www/html/lib/private/Route/Router.php", "line":315, "function":"main", "class":"OC\\AppFramework\\App", "type":"::", "args":[ "OC\\Core\\Controller\\LoginController", "tryLogin", [ "OC\\AppFramework\\DependencyInjection\\DIContainer" ], [ "core.login.tryLogin" ] ] }, { "file":"/var/www/html/lib/base.php", "line":1069, "function":"match", "class":"OC\\Route\\Router", "type":"->", "args":[ "/login" ] }, { "file":"/var/www/html/index.php", "line":39, "function":"handleRequest", "class":"OC", "type":"::", "args":[ ] } ], "File":"/var/www/html/3rdparty/doctrine/dbal/src/Driver/PDO/Exception.php", "Line":28, "Previous":{ "Exception":"PDOException", "Message":"SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry 'NextCloud-da0f4174-c707-103c-89a4-dfb392a94239' for key 'user_ldap_membership_unique'", "Code":"23000", "Trace":[ { "file":"/var/www/html/3rdparty/doctrine/dbal/src/Driver/PDO/Statement.php", "line":130, "function":"execute", "class":"PDOStatement", "type":"->", "args":[ null ] }, { "file":"/var/www/html/3rdparty/doctrine/dbal/src/Connection.php", "line":1202, "function":"execute", "class":"Doctrine\\DBAL\\Driver\\PDO\\Statement", "type":"->", "args":[ ] }, { "file":"/var/www/html/lib/private/DB/Connection.php", "line":294, "function":"executeStatement", "class":"Doctrine\\DBAL\\Connection", "type":"->", "args":[ "INSERT INTO `oc_ldap_group_membership` (`groupid`, `userid`) VALUES(?, ?)", [ "NextCloud", "da0f4174-c707-103c-89a4-dfb392a94239" ], [ 2, 2 ] ] }, { "file":"/var/www/html/3rdparty/doctrine/dbal/src/Query/QueryBuilder.php", "line":386, "function":"executeStatement", "class":"OC\\DB\\Connection", "type":"->", "args":[ "INSERT INTO `oc_ldap_group_membership` (`groupid`, `userid`) VALUES(:dcValue1, :dcValue2)", [ "NextCloud", "da0f4174-c707-103c-89a4-dfb392a94239" ], [ 2, 2 ] ] }, { "file":"/var/www/html/lib/private/DB/QueryBuilder/QueryBuilder.php", "line":280, "function":"execute", "class":"Doctrine\\DBAL\\Query\\QueryBuilder", "type":"->", "args":[ ] }, { "file":"/var/www/html/lib/private/DB/QueryBuilder/QueryBuilder.php", "line":326, "function":"execute", "class":"OC\\DB\\QueryBuilder\\QueryBuilder", "type":"->", "args":[ ] }, { "file":"/var/www/html/lib/public/AppFramework/Db/QBMapper.php", "line":137, "function":"executeStatement", "class":"OC\\DB\\QueryBuilder\\QueryBuilder", "type":"->", "args":[ ] }, { "file":"/var/www/html/apps/user_ldap/lib/LoginListener.php", "line":95, "function":"insert", "class":"OCP\\AppFramework\\Db\\QBMapper", "type":"->", "args":[ [ "OCA\\User_LDAP\\Db\\GroupMembership", null ] ] }, { "file":"/var/www/html/apps/user_ldap/lib/LoginListener.php", "line":67, "function":"updateGroups", "class":"OCA\\User_LDAP\\LoginListener", "type":"->", "args":[ "*** sensitive parameters replaced ***" ] }, { "file":"/var/www/html/apps/user_ldap/lib/LoginListener.php", "line":55, "function":"onPostLogin", "class":"OCA\\User_LDAP\\LoginListener", "type":"->", "args":[ "*** sensitive parameters replaced ***" ] }, { "file":"/var/www/html/lib/private/EventDispatcher/ServiceEventListener.php", "line":86, "function":"handle", "class":"OCA\\User_LDAP\\LoginListener", "type":"->", "args":[ [ "OCP\\User\\Events\\PostLoginEvent" ] ] }, { "file":"/var/www/html/3rdparty/symfony/event-dispatcher/EventDispatcher.php", "line":230, "function":"__invoke", "class":"OC\\EventDispatcher\\ServiceEventListener", "type":"->", "args":[ [ "OCP\\User\\Events\\PostLoginEvent" ], "OCP\\User\\Events\\PostLoginEvent", [ "Symfony\\Component\\EventDispatcher\\EventDispatcher" ] ] }, { "file":"/var/www/html/3rdparty/symfony/event-dispatcher/EventDispatcher.php", "line":59, "function":"callListeners", "class":"Symfony\\Component\\EventDispatcher\\EventDispatcher", "type":"->", "args":[ [ [ "Closure" ], [ "Closure" ], [ "Closure" ], [ "Closure" ] ], "OCP\\User\\Events\\PostLoginEvent", [ "OCP\\User\\Events\\PostLoginEvent" ] ] }, { "file":"/var/www/html/lib/private/EventDispatcher/EventDispatcher.php", "line":94, "function":"dispatch", "class":"Symfony\\Component\\EventDispatcher\\EventDispatcher", "type":"->", "args":[ [ "OCP\\User\\Events\\PostLoginEvent" ], "OCP\\User\\Events\\PostLoginEvent" ] }, { "file":"/var/www/html/lib/private/EventDispatcher/EventDispatcher.php", "line":106, "function":"dispatch", "class":"OC\\EventDispatcher\\EventDispatcher", "type":"->", "args":[ "OCP\\User\\Events\\PostLoginEvent", [ "OCP\\User\\Events\\PostLoginEvent" ] ] }, { "file":"/var/www/html/lib/private/User/Session.php", "line":392, "function":"dispatchTyped", "class":"OC\\EventDispatcher\\EventDispatcher", "type":"->", "args":[ [ "OCP\\User\\Events\\PostLoginEvent" ] ] }, { "file":"/var/www/html/lib/private/Authentication/Login/CompleteLoginCommand.php", "line":39, "function":"completeLogin", "class":"OC\\User\\Session", "type":"->", "args":[ "*** sensitive parameters replaced ***" ] }, { "file":"/var/www/html/lib/private/Authentication/Login/ALoginCommand.php", "line":39, "function":"process", "class":"OC\\Authentication\\Login\\CompleteLoginCommand", "type":"->", "args":[ [ "OC\\Authentication\\Login\\LoginData" ] ] }, { "file":"/var/www/html/lib/private/Authentication/Login/LoggedInCheckCommand.php", "line":60, "function":"processNextOrFinishSuccessfully", "class":"OC\\Authentication\\Login\\ALoginCommand", "type":"->", "args":[ [ "OC\\Authentication\\Login\\LoginData" ] ] }, { "file":"/var/www/html/lib/private/Authentication/Login/ALoginCommand.php", "line":39, "function":"process", "class":"OC\\Authentication\\Login\\LoggedInCheckCommand", "type":"->", "args":[ [ "OC\\Authentication\\Login\\LoginData" ] ] }, { "file":"/var/www/html/lib/private/Authentication/Login/EmailLoginCommand.php", "line":68, "function":"processNextOrFinishSuccessfully", "class":"OC\\Authentication\\Login\\ALoginCommand", "type":"->", "args":[ [ "OC\\Authentication\\Login\\LoginData" ] ] }, { "file":"/var/www/html/lib/private/Authentication/Login/ALoginCommand.php", "line":39, "function":"process", "class":"OC\\Authentication\\Login\\EmailLoginCommand", "type":"->", "args":[ [ "OC\\Authentication\\Login\\LoginData" ] ] }, { "file":"/var/www/html/lib/private/Authentication/Login/UidLoginCommand.php", "line":53, "function":"processNextOrFinishSuccessfully", "class":"OC\\Authentication\\Login\\ALoginCommand", "type":"->", "args":[ [ "OC\\Authentication\\Login\\LoginData" ] ] }, { "file":"/var/www/html/lib/private/Authentication/Login/ALoginCommand.php", "line":39, "function":"process", "class":"OC\\Authentication\\Login\\UidLoginCommand", "type":"->", "args":[ [ "OC\\Authentication\\Login\\LoginData" ] ] }, { "file":"/var/www/html/lib/private/Authentication/Login/UserDisabledCheckCommand.php", "line":57, "function":"processNextOrFinishSuccessfully", "class":"OC\\Authentication\\Login\\ALoginCommand", "type":"->", "args":[ [ "OC\\Authentication\\Login\\LoginData" ] ] }, { "file":"/var/www/html/lib/private/Authentication/Login/ALoginCommand.php", "line":39, "function":"process", "class":"OC\\Authentication\\Login\\UserDisabledCheckCommand", "type":"->", "args":[ [ "OC\\Authentication\\Login\\LoginData" ] ] }, { "file":"/var/www/html/lib/private/Authentication/Login/PreLoginHookCommand.php", "line":52, "function":"processNextOrFinishSuccessfully", "class":"OC\\Authentication\\Login\\ALoginCommand", "type":"->", "args":[ [ "OC\\Authentication\\Login\\LoginData" ] ] }, { "file":"/var/www/html/lib/private/Authentication/Login/Chain.php", "line":107, "function":"process", "class":"OC\\Authentication\\Login\\PreLoginHookCommand", "type":"->", "args":[ [ "OC\\Authentication\\Login\\LoginData" ] ] }, { "file":"/var/www/html/core/Controller/LoginController.php", "line":307, "function":"process", "class":"OC\\Authentication\\Login\\Chain", "type":"->", "args":[ [ "OC\\Authentication\\Login\\LoginData" ] ] }, { "file":"/var/www/html/lib/private/AppFramework/Http/Dispatcher.php", "line":230, "function":"tryLogin", "class":"OC\\Core\\Controller\\LoginController", "type":"->", "args":[ "*** sensitive parameters replaced ***" ] }, { "file":"/var/www/html/lib/private/AppFramework/Http/Dispatcher.php", "line":137, "function":"executeController", "class":"OC\\AppFramework\\Http\\Dispatcher", "type":"->", "args":[ [ "OC\\Core\\Controller\\LoginController" ], "tryLogin" ] }, { "file":"/var/www/html/lib/private/AppFramework/App.php", "line":184, "function":"dispatch", "class":"OC\\AppFramework\\Http\\Dispatcher", "type":"->", "args":[ [ "OC\\Core\\Controller\\LoginController" ], "tryLogin" ] }, { "file":"/var/www/html/lib/private/Route/Router.php", "line":315, "function":"main", "class":"OC\\AppFramework\\App", "type":"::", "args":[ "OC\\Core\\Controller\\LoginController", "tryLogin", [ "OC\\AppFramework\\DependencyInjection\\DIContainer" ], [ "core.login.tryLogin" ] ] }, { "file":"/var/www/html/lib/base.php", "line":1069, "function":"match", "class":"OC\\Route\\Router", "type":"->", "args":[ "/login" ] }, { "file":"/var/www/html/index.php", "line":39, "function":"handleRequest", "class":"OC", "type":"::", "args":[ ] } ], "File":"/var/www/html/3rdparty/doctrine/dbal/src/Driver/PDO/Statement.php", "Line":130 } } }, "message":"An exception occurred while executing a query: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry 'NextCloud-da0f4174-c707-103c-89a4-dfb392a94239' for key 'user_ldap_membership_unique'", "exception":{ }, "CustomMessage":"An exception occurred while executing a query: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry 'NextCloud-da0f4174-c707-103c-89a4-dfb392a94239' for key 'user_ldap_membership_unique'" } } ```
come-nc commented 10 months ago

Could you apply this patch, retrigger the problem and provide me the new log lines produced:

-Subproject commit a71bd8af76fdcfad78c865d1c60f6dde6e24f1dd
+Subproject commit 9e98dce036c0c2654f1ce33387f5d3e73488349e
diff --git a/apps/user_ldap/lib/LoginListener.php b/apps/user_ldap/lib/LoginListener.php
index ac5b32635c8..aaca7e71a1f 100644
--- a/apps/user_ldap/lib/LoginListener.php
+++ b/apps/user_ldap/lib/LoginListener.php
@@ -76,6 +76,22 @@ class LoginListener implements IEventListener {
                );
                $groupMemberships = array_combine($knownGroups, $groupMemberships);
                $actualGroups = $this->groupBackend->getUserGroups($userId);
+               $this->logger->error(
+                       'Actual groups for {user}: {groups}',
+                       [
+                               'app' => 'user_ldap',
+                               'user' => $userId,
+                               'groups' => json_encode($actualGroups),
+                       ]
+               );
+               $this->logger->error(
+                       'Known groups for {user}: {groups}',
+                       [
+                               'app' => 'user_ldap',
+                               'user' => $userId,
+                               'groups' => json_encode($knownGroups),
+                       ]
+               );

                $newGroups = array_diff($actualGroups, $knownGroups);
                $oldGroups = array_diff($knownGroups, $actualGroups);
@@ -92,6 +108,14 @@ class LoginListener implements IEventListener {
                                );
                                continue;
                        }
+                       $this->logger->info(
+                               __CLASS__ . ' – Will add {user} to {group}',
+                               [
+                                       'app' => 'user_ldap',
+                                       'user' => $userId,
+                                       'group' => $groupId
+                               ]
+                       );
                        $this->groupMembershipMapper->insert(GroupMembership::fromParams(['groupid' => $groupId,'userid' => $userId]));
                        $this->groupBackend->addRelationshipToCaches($userId, null, $groupId);
                        $this->dispatcher->dispatchTyped(new UserAddedEvent($groupObject, $userObject));
kcastner commented 10 months ago

@come-nc i edited the file:

The new ID is: L3dwdwi8TnUz6lOBFPPz

Log ``` json { "reqId":"L3dwdwi8TnUz6lOBFPPz", "level":3, "time":"2024-01-08T16:15:14+00:00", "remoteAddr":"172.19.0.1", "user":"da0f4174-c707-103c-89a4-dfb392a94239", "app":"user_ldap", "method":"POST", "url":"/login", "message":"Actual groups for da0f4174-c707-103c-89a4-dfb392a94239: [\"NextCloud\",\"NextCloud\"]", "userAgent":"Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Mobile Safari/537.36", "version":"28.0.1.1", "data":{ "app":"user_ldap" } } { "reqId":"L3dwdwi8TnUz6lOBFPPz", "level":3, "time":"2024-01-08T16:15:14+00:00", "remoteAddr":"172.19.0.1", "user":"da0f4174-c707-103c-89a4-dfb392a94239", "app":"user_ldap", "method":"POST", "url":"/login", "message":"Known groups for da0f4174-c707-103c-89a4-dfb392a94239: []", "userAgent":"Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Mobile Safari/537.36", "version":"28.0.1.1", "data":{ "app":"user_ldap" } } { "reqId":"L3dwdwi8TnUz6lOBFPPz", "level":3, "time":"2024-01-08T16:15:14+00:00", "remoteAddr":"172.19.0.1", "user":"da0f4174-c707-103c-89a4-dfb392a94239", "app":"index", "method":"POST", "url":"/login", "message":"An exception occurred while executing a query: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry 'NextCloud-da0f4174-c707-103c-89a4-dfb392a94239' for key 'user_ldap_membership_unique'", "userAgent":"Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Mobile Safari/537.36", "version":"28.0.1.1", "exception":{ "Exception":"OC\\DB\\Exceptions\\DbalException", "Message":"An exception occurred while executing a query: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry 'NextCloud-da0f4174-c707-103c-89a4-dfb392a94239' for key 'user_ldap_membership_unique'", "Code":1062, "Trace":[ { "file":"/var/www/html/lib/private/DB/QueryBuilder/QueryBuilder.php", "line":328, "function":"wrap", "class":"OC\\DB\\Exceptions\\DbalException", "type":"::", "args":[ [ "Doctrine\\DBAL\\Exception\\UniqueConstraintViolationException" ] ] }, { "file":"/var/www/html/lib/public/AppFramework/Db/QBMapper.php", "line":137, "function":"executeStatement", "class":"OC\\DB\\QueryBuilder\\QueryBuilder", "type":"->", "args":[ ] }, { "file":"/var/www/html/apps/user_ldap/lib/LoginListener.php", "line":120, "function":"insert", "class":"OCP\\AppFramework\\Db\\QBMapper", "type":"->", "args":[ [ "OCA\\User_LDAP\\Db\\GroupMembership", null ] ] }, { "file":"/var/www/html/apps/user_ldap/lib/LoginListener.php", "line":67, "function":"updateGroups", "class":"OCA\\User_LDAP\\LoginListener", "type":"->", "args":[ "*** sensitive parameters replaced ***" ] }, { "file":"/var/www/html/apps/user_ldap/lib/LoginListener.php", "line":55, "function":"onPostLogin", "class":"OCA\\User_LDAP\\LoginListener", "type":"->", "args":[ "*** sensitive parameters replaced ***" ] }, { "file":"/var/www/html/lib/private/EventDispatcher/ServiceEventListener.php", "line":86, "function":"handle", "class":"OCA\\User_LDAP\\LoginListener", "type":"->", "args":[ [ "OCP\\User\\Events\\PostLoginEvent" ] ] }, { "file":"/var/www/html/3rdparty/symfony/event-dispatcher/EventDispatcher.php", "line":230, "function":"__invoke", "class":"OC\\EventDispatcher\\ServiceEventListener", "type":"->", "args":[ [ "OCP\\User\\Events\\PostLoginEvent" ], "OCP\\User\\Events\\PostLoginEvent", [ "Symfony\\Component\\EventDispatcher\\EventDispatcher" ] ] }, { "file":"/var/www/html/3rdparty/symfony/event-dispatcher/EventDispatcher.php", "line":59, "function":"callListeners", "class":"Symfony\\Component\\EventDispatcher\\EventDispatcher", "type":"->", "args":[ [ [ "Closure" ], [ "Closure" ], [ "Closure" ], [ "Closure" ] ], "OCP\\User\\Events\\PostLoginEvent", [ "OCP\\User\\Events\\PostLoginEvent" ] ] }, { "file":"/var/www/html/lib/private/EventDispatcher/EventDispatcher.php", "line":94, "function":"dispatch", "class":"Symfony\\Component\\EventDispatcher\\EventDispatcher", "type":"->", "args":[ [ "OCP\\User\\Events\\PostLoginEvent" ], "OCP\\User\\Events\\PostLoginEvent" ] }, { "file":"/var/www/html/lib/private/EventDispatcher/EventDispatcher.php", "line":106, "function":"dispatch", "class":"OC\\EventDispatcher\\EventDispatcher", "type":"->", "args":[ "OCP\\User\\Events\\PostLoginEvent", [ "OCP\\User\\Events\\PostLoginEvent" ] ] }, { "file":"/var/www/html/lib/private/User/Session.php", "line":392, "function":"dispatchTyped", "class":"OC\\EventDispatcher\\EventDispatcher", "type":"->", "args":[ [ "OCP\\User\\Events\\PostLoginEvent" ] ] }, { "file":"/var/www/html/lib/private/Authentication/Login/CompleteLoginCommand.php", "line":39, "function":"completeLogin", "class":"OC\\User\\Session", "type":"->", "args":[ "*** sensitive parameters replaced ***" ] }, { "file":"/var/www/html/lib/private/Authentication/Login/ALoginCommand.php", "line":39, "function":"process", "class":"OC\\Authentication\\Login\\CompleteLoginCommand", "type":"->", "args":[ [ "OC\\Authentication\\Login\\LoginData" ] ] }, { "file":"/var/www/html/lib/private/Authentication/Login/LoggedInCheckCommand.php", "line":60, "function":"processNextOrFinishSuccessfully", "class":"OC\\Authentication\\Login\\ALoginCommand", "type":"->", "args":[ [ "OC\\Authentication\\Login\\LoginData" ] ] }, { "file":"/var/www/html/lib/private/Authentication/Login/ALoginCommand.php", "line":39, "function":"process", "class":"OC\\Authentication\\Login\\LoggedInCheckCommand", "type":"->", "args":[ [ "OC\\Authentication\\Login\\LoginData" ] ] }, { "file":"/var/www/html/lib/private/Authentication/Login/EmailLoginCommand.php", "line":68, "function":"processNextOrFinishSuccessfully", "class":"OC\\Authentication\\Login\\ALoginCommand", "type":"->", "args":[ [ "OC\\Authentication\\Login\\LoginData" ] ] }, { "file":"/var/www/html/lib/private/Authentication/Login/ALoginCommand.php", "line":39, "function":"process", "class":"OC\\Authentication\\Login\\EmailLoginCommand", "type":"->", "args":[ [ "OC\\Authentication\\Login\\LoginData" ] ] }, { "file":"/var/www/html/lib/private/Authentication/Login/UidLoginCommand.php", "line":53, "function":"processNextOrFinishSuccessfully", "class":"OC\\Authentication\\Login\\ALoginCommand", "type":"->", "args":[ [ "OC\\Authentication\\Login\\LoginData" ] ] }, { "file":"/var/www/html/lib/private/Authentication/Login/ALoginCommand.php", "line":39, "function":"process", "class":"OC\\Authentication\\Login\\UidLoginCommand", "type":"->", "args":[ [ "OC\\Authentication\\Login\\LoginData" ] ] }, { "file":"/var/www/html/lib/private/Authentication/Login/UserDisabledCheckCommand.php", "line":57, "function":"processNextOrFinishSuccessfully", "class":"OC\\Authentication\\Login\\ALoginCommand", "type":"->", "args":[ [ "OC\\Authentication\\Login\\LoginData" ] ] }, { "file":"/var/www/html/lib/private/Authentication/Login/ALoginCommand.php", "line":39, "function":"process", "class":"OC\\Authentication\\Login\\UserDisabledCheckCommand", "type":"->", "args":[ [ "OC\\Authentication\\Login\\LoginData" ] ] }, { "file":"/var/www/html/lib/private/Authentication/Login/PreLoginHookCommand.php", "line":52, "function":"processNextOrFinishSuccessfully", "class":"OC\\Authentication\\Login\\ALoginCommand", "type":"->", "args":[ [ "OC\\Authentication\\Login\\LoginData" ] ] }, { "file":"/var/www/html/lib/private/Authentication/Login/Chain.php", "line":107, "function":"process", "class":"OC\\Authentication\\Login\\PreLoginHookCommand", "type":"->", "args":[ [ "OC\\Authentication\\Login\\LoginData" ] ] }, { "file":"/var/www/html/core/Controller/LoginController.php", "line":307, "function":"process", "class":"OC\\Authentication\\Login\\Chain", "type":"->", "args":[ [ "OC\\Authentication\\Login\\LoginData" ] ] }, { "file":"/var/www/html/lib/private/AppFramework/Http/Dispatcher.php", "line":230, "function":"tryLogin", "class":"OC\\Core\\Controller\\LoginController", "type":"->", "args":[ "*** sensitive parameters replaced ***" ] }, { "file":"/var/www/html/lib/private/AppFramework/Http/Dispatcher.php", "line":137, "function":"executeController", "class":"OC\\AppFramework\\Http\\Dispatcher", "type":"->", "args":[ [ "OC\\Core\\Controller\\LoginController" ], "tryLogin" ] }, { "file":"/var/www/html/lib/private/AppFramework/App.php", "line":184, "function":"dispatch", "class":"OC\\AppFramework\\Http\\Dispatcher", "type":"->", "args":[ [ "OC\\Core\\Controller\\LoginController" ], "tryLogin" ] }, { "file":"/var/www/html/lib/private/Route/Router.php", "line":315, "function":"main", "class":"OC\\AppFramework\\App", "type":"::", "args":[ "OC\\Core\\Controller\\LoginController", "tryLogin", [ "OC\\AppFramework\\DependencyInjection\\DIContainer" ], [ "core.login.tryLogin" ] ] }, { "file":"/var/www/html/lib/base.php", "line":1069, "function":"match", "class":"OC\\Route\\Router", "type":"->", "args":[ "/login" ] }, { "file":"/var/www/html/index.php", "line":39, "function":"handleRequest", "class":"OC", "type":"::", "args":[ ] } ], "File":"/var/www/html/lib/private/DB/Exceptions/DbalException.php", "Line":71, "Previous":{ "Exception":"Doctrine\\DBAL\\Exception\\UniqueConstraintViolationException", "Message":"An exception occurred while executing a query: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry 'NextCloud-da0f4174-c707-103c-89a4-dfb392a94239' for key 'user_ldap_membership_unique'", "Code":1062, "Trace":[ { "file":"/var/www/html/3rdparty/doctrine/dbal/src/Connection.php", "line":1938, "function":"convert", "class":"Doctrine\\DBAL\\Driver\\API\\MySQL\\ExceptionConverter", "type":"->", "args":[ [ "Doctrine\\DBAL\\Driver\\PDO\\Exception" ], [ "Doctrine\\DBAL\\Query" ] ] }, { "file":"/var/www/html/3rdparty/doctrine/dbal/src/Connection.php", "line":1880, "function":"handleDriverException", "class":"Doctrine\\DBAL\\Connection", "type":"->", "args":[ [ "Doctrine\\DBAL\\Driver\\PDO\\Exception" ], [ "Doctrine\\DBAL\\Query" ] ] }, { "file":"/var/www/html/3rdparty/doctrine/dbal/src/Connection.php", "line":1208, "function":"convertExceptionDuringQuery", "class":"Doctrine\\DBAL\\Connection", "type":"->", "args":[ [ "Doctrine\\DBAL\\Driver\\PDO\\Exception" ], "INSERT INTO `oc_ldap_group_membership` (`groupid`, `userid`) VALUES(?, ?)", [ "NextCloud", "da0f4174-c707-103c-89a4-dfb392a94239" ], [ 2, 2 ] ] }, { "file":"/var/www/html/lib/private/DB/Connection.php", "line":294, "function":"executeStatement", "class":"Doctrine\\DBAL\\Connection", "type":"->", "args":[ "INSERT INTO `oc_ldap_group_membership` (`groupid`, `userid`) VALUES(?, ?)", [ "NextCloud", "da0f4174-c707-103c-89a4-dfb392a94239" ], [ 2, 2 ] ] }, { "file":"/var/www/html/3rdparty/doctrine/dbal/src/Query/QueryBuilder.php", "line":386, "function":"executeStatement", "class":"OC\\DB\\Connection", "type":"->", "args":[ "INSERT INTO `oc_ldap_group_membership` (`groupid`, `userid`) VALUES(:dcValue1, :dcValue2)", [ "NextCloud", "da0f4174-c707-103c-89a4-dfb392a94239" ], [ 2, 2 ] ] }, { "file":"/var/www/html/lib/private/DB/QueryBuilder/QueryBuilder.php", "line":280, "function":"execute", "class":"Doctrine\\DBAL\\Query\\QueryBuilder", "type":"->", "args":[ ] }, { "file":"/var/www/html/lib/private/DB/QueryBuilder/QueryBuilder.php", "line":326, "function":"execute", "class":"OC\\DB\\QueryBuilder\\QueryBuilder", "type":"->", "args":[ ] }, { "file":"/var/www/html/lib/public/AppFramework/Db/QBMapper.php", "line":137, "function":"executeStatement", "class":"OC\\DB\\QueryBuilder\\QueryBuilder", "type":"->", "args":[ ] }, { "file":"/var/www/html/apps/user_ldap/lib/LoginListener.php", "line":120, "function":"insert", "class":"OCP\\AppFramework\\Db\\QBMapper", "type":"->", "args":[ [ "OCA\\User_LDAP\\Db\\GroupMembership", null ] ] }, { "file":"/var/www/html/apps/user_ldap/lib/LoginListener.php", "line":67, "function":"updateGroups", "class":"OCA\\User_LDAP\\LoginListener", "type":"->", "args":[ "*** sensitive parameters replaced ***" ] }, { "file":"/var/www/html/apps/user_ldap/lib/LoginListener.php", "line":55, "function":"onPostLogin", "class":"OCA\\User_LDAP\\LoginListener", "type":"->", "args":[ "*** sensitive parameters replaced ***" ] }, { "file":"/var/www/html/lib/private/EventDispatcher/ServiceEventListener.php", "line":86, "function":"handle", "class":"OCA\\User_LDAP\\LoginListener", "type":"->", "args":[ [ "OCP\\User\\Events\\PostLoginEvent" ] ] }, { "file":"/var/www/html/3rdparty/symfony/event-dispatcher/EventDispatcher.php", "line":230, "function":"__invoke", "class":"OC\\EventDispatcher\\ServiceEventListener", "type":"->", "args":[ [ "OCP\\User\\Events\\PostLoginEvent" ], "OCP\\User\\Events\\PostLoginEvent", [ "Symfony\\Component\\EventDispatcher\\EventDispatcher" ] ] }, { "file":"/var/www/html/3rdparty/symfony/event-dispatcher/EventDispatcher.php", "line":59, "function":"callListeners", "class":"Symfony\\Component\\EventDispatcher\\EventDispatcher", "type":"->", "args":[ [ [ "Closure" ], [ "Closure" ], [ "Closure" ], [ "Closure" ] ], "OCP\\User\\Events\\PostLoginEvent", [ "OCP\\User\\Events\\PostLoginEvent" ] ] }, { "file":"/var/www/html/lib/private/EventDispatcher/EventDispatcher.php", "line":94, "function":"dispatch", "class":"Symfony\\Component\\EventDispatcher\\EventDispatcher", "type":"->", "args":[ [ "OCP\\User\\Events\\PostLoginEvent" ], "OCP\\User\\Events\\PostLoginEvent" ] }, { "file":"/var/www/html/lib/private/EventDispatcher/EventDispatcher.php", "line":106, "function":"dispatch", "class":"OC\\EventDispatcher\\EventDispatcher", "type":"->", "args":[ "OCP\\User\\Events\\PostLoginEvent", [ "OCP\\User\\Events\\PostLoginEvent" ] ] }, { "file":"/var/www/html/lib/private/User/Session.php", "line":392, "function":"dispatchTyped", "class":"OC\\EventDispatcher\\EventDispatcher", "type":"->", "args":[ [ "OCP\\User\\Events\\PostLoginEvent" ] ] }, { "file":"/var/www/html/lib/private/Authentication/Login/CompleteLoginCommand.php", "line":39, "function":"completeLogin", "class":"OC\\User\\Session", "type":"->", "args":[ "*** sensitive parameters replaced ***" ] }, { "file":"/var/www/html/lib/private/Authentication/Login/ALoginCommand.php", "line":39, "function":"process", "class":"OC\\Authentication\\Login\\CompleteLoginCommand", "type":"->", "args":[ [ "OC\\Authentication\\Login\\LoginData" ] ] }, { "file":"/var/www/html/lib/private/Authentication/Login/LoggedInCheckCommand.php", "line":60, "function":"processNextOrFinishSuccessfully", "class":"OC\\Authentication\\Login\\ALoginCommand", "type":"->", "args":[ [ "OC\\Authentication\\Login\\LoginData" ] ] }, { "file":"/var/www/html/lib/private/Authentication/Login/ALoginCommand.php", "line":39, "function":"process", "class":"OC\\Authentication\\Login\\LoggedInCheckCommand", "type":"->", "args":[ [ "OC\\Authentication\\Login\\LoginData" ] ] }, { "file":"/var/www/html/lib/private/Authentication/Login/EmailLoginCommand.php", "line":68, "function":"processNextOrFinishSuccessfully", "class":"OC\\Authentication\\Login\\ALoginCommand", "type":"->", "args":[ [ "OC\\Authentication\\Login\\LoginData" ] ] }, { "file":"/var/www/html/lib/private/Authentication/Login/ALoginCommand.php", "line":39, "function":"process", "class":"OC\\Authentication\\Login\\EmailLoginCommand", "type":"->", "args":[ [ "OC\\Authentication\\Login\\LoginData" ] ] }, { "file":"/var/www/html/lib/private/Authentication/Login/UidLoginCommand.php", "line":53, "function":"processNextOrFinishSuccessfully", "class":"OC\\Authentication\\Login\\ALoginCommand", "type":"->", "args":[ [ "OC\\Authentication\\Login\\LoginData" ] ] }, { "file":"/var/www/html/lib/private/Authentication/Login/ALoginCommand.php", "line":39, "function":"process", "class":"OC\\Authentication\\Login\\UidLoginCommand", "type":"->", "args":[ [ "OC\\Authentication\\Login\\LoginData" ] ] }, { "file":"/var/www/html/lib/private/Authentication/Login/UserDisabledCheckCommand.php", "line":57, "function":"processNextOrFinishSuccessfully", "class":"OC\\Authentication\\Login\\ALoginCommand", "type":"->", "args":[ [ "OC\\Authentication\\Login\\LoginData" ] ] }, { "file":"/var/www/html/lib/private/Authentication/Login/ALoginCommand.php", "line":39, "function":"process", "class":"OC\\Authentication\\Login\\UserDisabledCheckCommand", "type":"->", "args":[ [ "OC\\Authentication\\Login\\LoginData" ] ] }, { "file":"/var/www/html/lib/private/Authentication/Login/PreLoginHookCommand.php", "line":52, "function":"processNextOrFinishSuccessfully", "class":"OC\\Authentication\\Login\\ALoginCommand", "type":"->", "args":[ [ "OC\\Authentication\\Login\\LoginData" ] ] }, { "file":"/var/www/html/lib/private/Authentication/Login/Chain.php", "line":107, "function":"process", "class":"OC\\Authentication\\Login\\PreLoginHookCommand", "type":"->", "args":[ [ "OC\\Authentication\\Login\\LoginData" ] ] }, { "file":"/var/www/html/core/Controller/LoginController.php", "line":307, "function":"process", "class":"OC\\Authentication\\Login\\Chain", "type":"->", "args":[ [ "OC\\Authentication\\Login\\LoginData" ] ] }, { "file":"/var/www/html/lib/private/AppFramework/Http/Dispatcher.php", "line":230, "function":"tryLogin", "class":"OC\\Core\\Controller\\LoginController", "type":"->", "args":[ "*** sensitive parameters replaced ***" ] }, { "file":"/var/www/html/lib/private/AppFramework/Http/Dispatcher.php", "line":137, "function":"executeController", "class":"OC\\AppFramework\\Http\\Dispatcher", "type":"->", "args":[ [ "OC\\Core\\Controller\\LoginController" ], "tryLogin" ] }, { "file":"/var/www/html/lib/private/AppFramework/App.php", "line":184, "function":"dispatch", "class":"OC\\AppFramework\\Http\\Dispatcher", "type":"->", "args":[ [ "OC\\Core\\Controller\\LoginController" ], "tryLogin" ] }, { "file":"/var/www/html/lib/private/Route/Router.php", "line":315, "function":"main", "class":"OC\\AppFramework\\App", "type":"::", "args":[ "OC\\Core\\Controller\\LoginController", "tryLogin", [ "OC\\AppFramework\\DependencyInjection\\DIContainer" ], [ "core.login.tryLogin" ] ] }, { "file":"/var/www/html/lib/base.php", "line":1069, "function":"match", "class":"OC\\Route\\Router", "type":"->", "args":[ "/login" ] }, { "file":"/var/www/html/index.php", "line":39, "function":"handleRequest", "class":"OC", "type":"::", "args":[ ] } ], "File":"/var/www/html/3rdparty/doctrine/dbal/src/Driver/API/MySQL/ExceptionConverter.php", "Line":62, "Previous":{ "Exception":"Doctrine\\DBAL\\Driver\\PDO\\Exception", "Message":"SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry 'NextCloud-da0f4174-c707-103c-89a4-dfb392a94239' for key 'user_ldap_membership_unique'", "Code":1062, "Trace":[ { "file":"/var/www/html/3rdparty/doctrine/dbal/src/Driver/PDO/Statement.php", "line":132, "function":"new", "class":"Doctrine\\DBAL\\Driver\\PDO\\Exception", "type":"::", "args":[ [ "PDOException", [ "23000", 1062, "Duplicate entry 'NextCloud-da0f4174-c707-103c-89a4-dfb392a94239' for key 'user_ldap_membership_unique'" ] ] ] }, { "file":"/var/www/html/3rdparty/doctrine/dbal/src/Connection.php", "line":1202, "function":"execute", "class":"Doctrine\\DBAL\\Driver\\PDO\\Statement", "type":"->", "args":[ ] }, { "file":"/var/www/html/lib/private/DB/Connection.php", "line":294, "function":"executeStatement", "class":"Doctrine\\DBAL\\Connection", "type":"->", "args":[ "INSERT INTO `oc_ldap_group_membership` (`groupid`, `userid`) VALUES(?, ?)", [ "NextCloud", "da0f4174-c707-103c-89a4-dfb392a94239" ], [ 2, 2 ] ] }, { "file":"/var/www/html/3rdparty/doctrine/dbal/src/Query/QueryBuilder.php", "line":386, "function":"executeStatement", "class":"OC\\DB\\Connection", "type":"->", "args":[ "INSERT INTO `oc_ldap_group_membership` (`groupid`, `userid`) VALUES(:dcValue1, :dcValue2)", [ "NextCloud", "da0f4174-c707-103c-89a4-dfb392a94239" ], [ 2, 2 ] ] }, { "file":"/var/www/html/lib/private/DB/QueryBuilder/QueryBuilder.php", "line":280, "function":"execute", "class":"Doctrine\\DBAL\\Query\\QueryBuilder", "type":"->", "args":[ ] }, { "file":"/var/www/html/lib/private/DB/QueryBuilder/QueryBuilder.php", "line":326, "function":"execute", "class":"OC\\DB\\QueryBuilder\\QueryBuilder", "type":"->", "args":[ ] }, { "file":"/var/www/html/lib/public/AppFramework/Db/QBMapper.php", "line":137, "function":"executeStatement", "class":"OC\\DB\\QueryBuilder\\QueryBuilder", "type":"->", "args":[ ] }, { "file":"/var/www/html/apps/user_ldap/lib/LoginListener.php", "line":120, "function":"insert", "class":"OCP\\AppFramework\\Db\\QBMapper", "type":"->", "args":[ [ "OCA\\User_LDAP\\Db\\GroupMembership", null ] ] }, { "file":"/var/www/html/apps/user_ldap/lib/LoginListener.php", "line":67, "function":"updateGroups", "class":"OCA\\User_LDAP\\LoginListener", "type":"->", "args":[ "*** sensitive parameters replaced ***" ] }, { "file":"/var/www/html/apps/user_ldap/lib/LoginListener.php", "line":55, "function":"onPostLogin", "class":"OCA\\User_LDAP\\LoginListener", "type":"->", "args":[ "*** sensitive parameters replaced ***" ] }, { "file":"/var/www/html/lib/private/EventDispatcher/ServiceEventListener.php", "line":86, "function":"handle", "class":"OCA\\User_LDAP\\LoginListener", "type":"->", "args":[ [ "OCP\\User\\Events\\PostLoginEvent" ] ] }, { "file":"/var/www/html/3rdparty/symfony/event-dispatcher/EventDispatcher.php", "line":230, "function":"__invoke", "class":"OC\\EventDispatcher\\ServiceEventListener", "type":"->", "args":[ [ "OCP\\User\\Events\\PostLoginEvent" ], "OCP\\User\\Events\\PostLoginEvent", [ "Symfony\\Component\\EventDispatcher\\EventDispatcher" ] ] }, { "file":"/var/www/html/3rdparty/symfony/event-dispatcher/EventDispatcher.php", "line":59, "function":"callListeners", "class":"Symfony\\Component\\EventDispatcher\\EventDispatcher", "type":"->", "args":[ [ [ "Closure" ], [ "Closure" ], [ "Closure" ], [ "Closure" ] ], "OCP\\User\\Events\\PostLoginEvent", [ "OCP\\User\\Events\\PostLoginEvent" ] ] }, { "file":"/var/www/html/lib/private/EventDispatcher/EventDispatcher.php", "line":94, "function":"dispatch", "class":"Symfony\\Component\\EventDispatcher\\EventDispatcher", "type":"->", "args":[ [ "OCP\\User\\Events\\PostLoginEvent" ], "OCP\\User\\Events\\PostLoginEvent" ] }, { "file":"/var/www/html/lib/private/EventDispatcher/EventDispatcher.php", "line":106, "function":"dispatch", "class":"OC\\EventDispatcher\\EventDispatcher", "type":"->", "args":[ "OCP\\User\\Events\\PostLoginEvent", [ "OCP\\User\\Events\\PostLoginEvent" ] ] }, { "file":"/var/www/html/lib/private/User/Session.php", "line":392, "function":"dispatchTyped", "class":"OC\\EventDispatcher\\EventDispatcher", "type":"->", "args":[ [ "OCP\\User\\Events\\PostLoginEvent" ] ] }, { "file":"/var/www/html/lib/private/Authentication/Login/CompleteLoginCommand.php", "line":39, "function":"completeLogin", "class":"OC\\User\\Session", "type":"->", "args":[ "*** sensitive parameters replaced ***" ] }, { "file":"/var/www/html/lib/private/Authentication/Login/ALoginCommand.php", "line":39, "function":"process", "class":"OC\\Authentication\\Login\\CompleteLoginCommand", "type":"->", "args":[ [ "OC\\Authentication\\Login\\LoginData" ] ] }, { "file":"/var/www/html/lib/private/Authentication/Login/LoggedInCheckCommand.php", "line":60, "function":"processNextOrFinishSuccessfully", "class":"OC\\Authentication\\Login\\ALoginCommand", "type":"->", "args":[ [ "OC\\Authentication\\Login\\LoginData" ] ] }, { "file":"/var/www/html/lib/private/Authentication/Login/ALoginCommand.php", "line":39, "function":"process", "class":"OC\\Authentication\\Login\\LoggedInCheckCommand", "type":"->", "args":[ [ "OC\\Authentication\\Login\\LoginData" ] ] }, { "file":"/var/www/html/lib/private/Authentication/Login/EmailLoginCommand.php", "line":68, "function":"processNextOrFinishSuccessfully", "class":"OC\\Authentication\\Login\\ALoginCommand", "type":"->", "args":[ [ "OC\\Authentication\\Login\\LoginData" ] ] }, { "file":"/var/www/html/lib/private/Authentication/Login/ALoginCommand.php", "line":39, "function":"process", "class":"OC\\Authentication\\Login\\EmailLoginCommand", "type":"->", "args":[ [ "OC\\Authentication\\Login\\LoginData" ] ] }, { "file":"/var/www/html/lib/private/Authentication/Login/UidLoginCommand.php", "line":53, "function":"processNextOrFinishSuccessfully", "class":"OC\\Authentication\\Login\\ALoginCommand", "type":"->", "args":[ [ "OC\\Authentication\\Login\\LoginData" ] ] }, { "file":"/var/www/html/lib/private/Authentication/Login/ALoginCommand.php", "line":39, "function":"process", "class":"OC\\Authentication\\Login\\UidLoginCommand", "type":"->", "args":[ [ "OC\\Authentication\\Login\\LoginData" ] ] }, { "file":"/var/www/html/lib/private/Authentication/Login/UserDisabledCheckCommand.php", "line":57, "function":"processNextOrFinishSuccessfully", "class":"OC\\Authentication\\Login\\ALoginCommand", "type":"->", "args":[ [ "OC\\Authentication\\Login\\LoginData" ] ] }, { "file":"/var/www/html/lib/private/Authentication/Login/ALoginCommand.php", "line":39, "function":"process", "class":"OC\\Authentication\\Login\\UserDisabledCheckCommand", "type":"->", "args":[ [ "OC\\Authentication\\Login\\LoginData" ] ] }, { "file":"/var/www/html/lib/private/Authentication/Login/PreLoginHookCommand.php", "line":52, "function":"processNextOrFinishSuccessfully", "class":"OC\\Authentication\\Login\\ALoginCommand", "type":"->", "args":[ [ "OC\\Authentication\\Login\\LoginData" ] ] }, { "file":"/var/www/html/lib/private/Authentication/Login/Chain.php", "line":107, "function":"process", "class":"OC\\Authentication\\Login\\PreLoginHookCommand", "type":"->", "args":[ [ "OC\\Authentication\\Login\\LoginData" ] ] }, { "file":"/var/www/html/core/Controller/LoginController.php", "line":307, "function":"process", "class":"OC\\Authentication\\Login\\Chain", "type":"->", "args":[ [ "OC\\Authentication\\Login\\LoginData" ] ] }, { "file":"/var/www/html/lib/private/AppFramework/Http/Dispatcher.php", "line":230, "function":"tryLogin", "class":"OC\\Core\\Controller\\LoginController", "type":"->", "args":[ "*** sensitive parameters replaced ***" ] }, { "file":"/var/www/html/lib/private/AppFramework/Http/Dispatcher.php", "line":137, "function":"executeController", "class":"OC\\AppFramework\\Http\\Dispatcher", "type":"->", "args":[ [ "OC\\Core\\Controller\\LoginController" ], "tryLogin" ] }, { "file":"/var/www/html/lib/private/AppFramework/App.php", "line":184, "function":"dispatch", "class":"OC\\AppFramework\\Http\\Dispatcher", "type":"->", "args":[ [ "OC\\Core\\Controller\\LoginController" ], "tryLogin" ] }, { "file":"/var/www/html/lib/private/Route/Router.php", "line":315, "function":"main", "class":"OC\\AppFramework\\App", "type":"::", "args":[ "OC\\Core\\Controller\\LoginController", "tryLogin", [ "OC\\AppFramework\\DependencyInjection\\DIContainer" ], [ "core.login.tryLogin" ] ] }, { "file":"/var/www/html/lib/base.php", "line":1069, "function":"match", "class":"OC\\Route\\Router", "type":"->", "args":[ "/login" ] }, { "file":"/var/www/html/index.php", "line":39, "function":"handleRequest", "class":"OC", "type":"::", "args":[ ] } ], "File":"/var/www/html/3rdparty/doctrine/dbal/src/Driver/PDO/Exception.php", "Line":28, "Previous":{ "Exception":"PDOException", "Message":"SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry 'NextCloud-da0f4174-c707-103c-89a4-dfb392a94239' for key 'user_ldap_membership_unique'", "Code":"23000", "Trace":[ { "file":"/var/www/html/3rdparty/doctrine/dbal/src/Driver/PDO/Statement.php", "line":130, "function":"execute", "class":"PDOStatement", "type":"->", "args":[ null ] }, { "file":"/var/www/html/3rdparty/doctrine/dbal/src/Connection.php", "line":1202, "function":"execute", "class":"Doctrine\\DBAL\\Driver\\PDO\\Statement", "type":"->", "args":[ ] }, { "file":"/var/www/html/lib/private/DB/Connection.php", "line":294, "function":"executeStatement", "class":"Doctrine\\DBAL\\Connection", "type":"->", "args":[ "INSERT INTO `oc_ldap_group_membership` (`groupid`, `userid`) VALUES(?, ?)", [ "NextCloud", "da0f4174-c707-103c-89a4-dfb392a94239" ], [ 2, 2 ] ] }, { "file":"/var/www/html/3rdparty/doctrine/dbal/src/Query/QueryBuilder.php", "line":386, "function":"executeStatement", "class":"OC\\DB\\Connection", "type":"->", "args":[ "INSERT INTO `oc_ldap_group_membership` (`groupid`, `userid`) VALUES(:dcValue1, :dcValue2)", [ "NextCloud", "da0f4174-c707-103c-89a4-dfb392a94239" ], [ 2, 2 ] ] }, { "file":"/var/www/html/lib/private/DB/QueryBuilder/QueryBuilder.php", "line":280, "function":"execute", "class":"Doctrine\\DBAL\\Query\\QueryBuilder", "type":"->", "args":[ ] }, { "file":"/var/www/html/lib/private/DB/QueryBuilder/QueryBuilder.php", "line":326, "function":"execute", "class":"OC\\DB\\QueryBuilder\\QueryBuilder", "type":"->", "args":[ ] }, { "file":"/var/www/html/lib/public/AppFramework/Db/QBMapper.php", "line":137, "function":"executeStatement", "class":"OC\\DB\\QueryBuilder\\QueryBuilder", "type":"->", "args":[ ] }, { "file":"/var/www/html/apps/user_ldap/lib/LoginListener.php", "line":120, "function":"insert", "class":"OCP\\AppFramework\\Db\\QBMapper", "type":"->", "args":[ [ "OCA\\User_LDAP\\Db\\GroupMembership", null ] ] }, { "file":"/var/www/html/apps/user_ldap/lib/LoginListener.php", "line":67, "function":"updateGroups", "class":"OCA\\User_LDAP\\LoginListener", "type":"->", "args":[ "*** sensitive parameters replaced ***" ] }, { "file":"/var/www/html/apps/user_ldap/lib/LoginListener.php", "line":55, "function":"onPostLogin", "class":"OCA\\User_LDAP\\LoginListener", "type":"->", "args":[ "*** sensitive parameters replaced ***" ] }, { "file":"/var/www/html/lib/private/EventDispatcher/ServiceEventListener.php", "line":86, "function":"handle", "class":"OCA\\User_LDAP\\LoginListener", "type":"->", "args":[ [ "OCP\\User\\Events\\PostLoginEvent" ] ] }, { "file":"/var/www/html/3rdparty/symfony/event-dispatcher/EventDispatcher.php", "line":230, "function":"__invoke", "class":"OC\\EventDispatcher\\ServiceEventListener", "type":"->", "args":[ [ "OCP\\User\\Events\\PostLoginEvent" ], "OCP\\User\\Events\\PostLoginEvent", [ "Symfony\\Component\\EventDispatcher\\EventDispatcher" ] ] }, { "file":"/var/www/html/3rdparty/symfony/event-dispatcher/EventDispatcher.php", "line":59, "function":"callListeners", "class":"Symfony\\Component\\EventDispatcher\\EventDispatcher", "type":"->", "args":[ [ [ "Closure" ], [ "Closure" ], [ "Closure" ], [ "Closure" ] ], "OCP\\User\\Events\\PostLoginEvent", [ "OCP\\User\\Events\\PostLoginEvent" ] ] }, { "file":"/var/www/html/lib/private/EventDispatcher/EventDispatcher.php", "line":94, "function":"dispatch", "class":"Symfony\\Component\\EventDispatcher\\EventDispatcher", "type":"->", "args":[ [ "OCP\\User\\Events\\PostLoginEvent" ], "OCP\\User\\Events\\PostLoginEvent" ] }, { "file":"/var/www/html/lib/private/EventDispatcher/EventDispatcher.php", "line":106, "function":"dispatch", "class":"OC\\EventDispatcher\\EventDispatcher", "type":"->", "args":[ "OCP\\User\\Events\\PostLoginEvent", [ "OCP\\User\\Events\\PostLoginEvent" ] ] }, { "file":"/var/www/html/lib/private/User/Session.php", "line":392, "function":"dispatchTyped", "class":"OC\\EventDispatcher\\EventDispatcher", "type":"->", "args":[ [ "OCP\\User\\Events\\PostLoginEvent" ] ] }, { "file":"/var/www/html/lib/private/Authentication/Login/CompleteLoginCommand.php", "line":39, "function":"completeLogin", "class":"OC\\User\\Session", "type":"->", "args":[ "*** sensitive parameters replaced ***" ] }, { "file":"/var/www/html/lib/private/Authentication/Login/ALoginCommand.php", "line":39, "function":"process", "class":"OC\\Authentication\\Login\\CompleteLoginCommand", "type":"->", "args":[ [ "OC\\Authentication\\Login\\LoginData" ] ] }, { "file":"/var/www/html/lib/private/Authentication/Login/LoggedInCheckCommand.php", "line":60, "function":"processNextOrFinishSuccessfully", "class":"OC\\Authentication\\Login\\ALoginCommand", "type":"->", "args":[ [ "OC\\Authentication\\Login\\LoginData" ] ] }, { "file":"/var/www/html/lib/private/Authentication/Login/ALoginCommand.php", "line":39, "function":"process", "class":"OC\\Authentication\\Login\\LoggedInCheckCommand", "type":"->", "args":[ [ "OC\\Authentication\\Login\\LoginData" ] ] }, { "file":"/var/www/html/lib/private/Authentication/Login/EmailLoginCommand.php", "line":68, "function":"processNextOrFinishSuccessfully", "class":"OC\\Authentication\\Login\\ALoginCommand", "type":"->", "args":[ [ "OC\\Authentication\\Login\\LoginData" ] ] }, { "file":"/var/www/html/lib/private/Authentication/Login/ALoginCommand.php", "line":39, "function":"process", "class":"OC\\Authentication\\Login\\EmailLoginCommand", "type":"->", "args":[ [ "OC\\Authentication\\Login\\LoginData" ] ] }, { "file":"/var/www/html/lib/private/Authentication/Login/UidLoginCommand.php", "line":53, "function":"processNextOrFinishSuccessfully", "class":"OC\\Authentication\\Login\\ALoginCommand", "type":"->", "args":[ [ "OC\\Authentication\\Login\\LoginData" ] ] }, { "file":"/var/www/html/lib/private/Authentication/Login/ALoginCommand.php", "line":39, "function":"process", "class":"OC\\Authentication\\Login\\UidLoginCommand", "type":"->", "args":[ [ "OC\\Authentication\\Login\\LoginData" ] ] }, { "file":"/var/www/html/lib/private/Authentication/Login/UserDisabledCheckCommand.php", "line":57, "function":"processNextOrFinishSuccessfully", "class":"OC\\Authentication\\Login\\ALoginCommand", "type":"->", "args":[ [ "OC\\Authentication\\Login\\LoginData" ] ] }, { "file":"/var/www/html/lib/private/Authentication/Login/ALoginCommand.php", "line":39, "function":"process", "class":"OC\\Authentication\\Login\\UserDisabledCheckCommand", "type":"->", "args":[ [ "OC\\Authentication\\Login\\LoginData" ] ] }, { "file":"/var/www/html/lib/private/Authentication/Login/PreLoginHookCommand.php", "line":52, "function":"processNextOrFinishSuccessfully", "class":"OC\\Authentication\\Login\\ALoginCommand", "type":"->", "args":[ [ "OC\\Authentication\\Login\\LoginData" ] ] }, { "file":"/var/www/html/lib/private/Authentication/Login/Chain.php", "line":107, "function":"process", "class":"OC\\Authentication\\Login\\PreLoginHookCommand", "type":"->", "args":[ [ "OC\\Authentication\\Login\\LoginData" ] ] }, { "file":"/var/www/html/core/Controller/LoginController.php", "line":307, "function":"process", "class":"OC\\Authentication\\Login\\Chain", "type":"->", "args":[ [ "OC\\Authentication\\Login\\LoginData" ] ] }, { "file":"/var/www/html/lib/private/AppFramework/Http/Dispatcher.php", "line":230, "function":"tryLogin", "class":"OC\\Core\\Controller\\LoginController", "type":"->", "args":[ "*** sensitive parameters replaced ***" ] }, { "file":"/var/www/html/lib/private/AppFramework/Http/Dispatcher.php", "line":137, "function":"executeController", "class":"OC\\AppFramework\\Http\\Dispatcher", "type":"->", "args":[ [ "OC\\Core\\Controller\\LoginController" ], "tryLogin" ] }, { "file":"/var/www/html/lib/private/AppFramework/App.php", "line":184, "function":"dispatch", "class":"OC\\AppFramework\\Http\\Dispatcher", "type":"->", "args":[ [ "OC\\Core\\Controller\\LoginController" ], "tryLogin" ] }, { "file":"/var/www/html/lib/private/Route/Router.php", "line":315, "function":"main", "class":"OC\\AppFramework\\App", "type":"::", "args":[ "OC\\Core\\Controller\\LoginController", "tryLogin", [ "OC\\AppFramework\\DependencyInjection\\DIContainer" ], [ "core.login.tryLogin" ] ] }, { "file":"/var/www/html/lib/base.php", "line":1069, "function":"match", "class":"OC\\Route\\Router", "type":"->", "args":[ "/login" ] }, { "file":"/var/www/html/index.php", "line":39, "function":"handleRequest", "class":"OC", "type":"::", "args":[ ] } ], "File":"/var/www/html/3rdparty/doctrine/dbal/src/Driver/PDO/Statement.php", "Line":130 } } }, "message":"An exception occurred while executing a query: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry 'NextCloud-da0f4174-c707-103c-89a4-dfb392a94239' for key 'user_ldap_membership_unique'", "exception":{ }, "CustomMessage":"An exception occurred while executing a query: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry 'NextCloud-da0f4174-c707-103c-89a4-dfb392a94239' for key 'user_ldap_membership_unique'" } } ```
come-nc commented 10 months ago

Interesting, so the problem is $this->groupBackend->getUserGroups($userId); returns a duplicated value. Do you have several LDAP servers connected, with the same group?

kcastner commented 10 months ago

For the LDAP connection, I specify the user group that is allowed to connect (Nextcloud). I then specified which groups there should be. Here is Nextcloud and NextcloudAdmin deposited.

The logged in user is only in the Nextcloud group

come-nc commented 10 months ago

For the LDAP connection, I specify the user group that is allowed to connect (Nextcloud). I then specified which groups there should be. Here is Nextcloud and NextcloudAdmin deposited.

The logged in user is only in the Nextcloud group

My question is how many LDAP configuration do you have? If you do "occ ldap:show-config" How many configurations do you see? Only one?

If you have only one configuration I do not see yet where the duplicated group can come from as the method is supposed to run array_unique on the array before returning.

kcastner commented 10 months ago

My question is how many LDAP configuration do you have?

I only have 1 - as is see at Nextcloud-Admin-Panel.

Via command I can see 2.

+-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------+
| Configuration                 | s01                                                                                                                                            |
+-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------+
| hasMemberOfFilterSupport      | 1                                                                                                                                              |
| homeFolderNamingRule          |                                                                                                                                                |
| lastJpegPhotoLookup           | 0                                                                                                                                              |
| ldapAdminGroup                |                                                                                                                                                |
| ldapAgentName                 | uid={{ REDUCTED }},CN=users,DC=int,DC=kcastner,DC=de                                                                                               |
| ldapAgentPassword             | ***                                                                                                                                            |
| ldapAttributeAddress          |                                                                                                                                                |
| ldapAttributeBiography        |                                                                                                                                                |
| ldapAttributeFediverse        |                                                                                                                                                |
| ldapAttributeHeadline         |                                                                                                                                                |
| ldapAttributeOrganisation     |                                                                                                                                                |
| ldapAttributePhone            |                                                                                                                                                |
| ldapAttributeRole             |                                                                                                                                                |
| ldapAttributeTwitter          |                                                                                                                                                |
| ldapAttributeWebsite          |                                                                                                                                                |
| ldapAttributesForGroupSearch  |                                                                                                                                                |
| ldapAttributesForUserSearch   |                                                                                                                                                |
| ldapBackgroundHost            |                                                                                                                                                |
| ldapBackgroundPort            |                                                                                                                                                |
| ldapBackupHost                |                                                                                                                                                |
| ldapBackupPort                |                                                                                                                                                |
| ldapBase                      | DC=int,DC=kcastner,DC=de                                                                                                                       |
| ldapBaseGroups                | DC=int,DC=kcastner,DC=de                                                                                                                       |
| ldapBaseUsers                 | DC=int,DC=kcastner,DC=de                                                                                                                       |
| ldapCacheTTL                  | 600                                                                                                                                            |
| ldapConfigurationActive       | 1                                                                                                                                              |
| ldapConnectionTimeout         | 15                                                                                                                                             |
| ldapDefaultPPolicyDN          |                                                                                                                                                |
| ldapDynamicGroupMemberURL     |                                                                                                                                                |
| ldapEmailAttribute            | mail                                                                                                                                           |
| ldapExperiencedAdmin          | 0                                                                                                                                              |
| ldapExpertUUIDGroupAttr       |                                                                                                                                                |
| ldapExpertUUIDUserAttr        |                                                                                                                                                |
| ldapExpertUsernameAttr        |                                                                                                                                                |
| ldapExtStorageHomeAttribute   |                                                                                                                                                |
| ldapGidNumber                 | gidNumber                                                                                                                                      |
| ldapGroupDisplayName          | cn                                                                                                                                             |
| ldapGroupFilter               | (&(|(objectclass=univentionGroup))(|(cn=NextCloud)))                                                                                           |
| ldapGroupFilterGroups         | NextCloud                                                                                                                                      |
| ldapGroupFilterMode           | 0                                                                                                                                              |
| ldapGroupFilterObjectclass    | univentionGroup                                                                                                                                |
| ldapGroupMemberAssocAttr      | gidNumber                                                                                                                                      |
| ldapHost                      | int.kcastner.de                                                                                                                                |
| ldapIgnoreNamingRules         |                                                                                                                                                |
| ldapLoginFilter               | (&(&(|(objectclass=person))(|(memberof=cn=NextCloud,cn=groups,dc=int,dc=kcastner,dc=de)))(|(uid=%uid)(|(mailPrimaryAddress=%uid)(mail=%uid)))) |
| ldapLoginFilterAttributes     |                                                                                                                                                |
| ldapLoginFilterEmail          | 1                                                                                                                                              |
| ldapLoginFilterMode           | 0                                                                                                                                              |
| ldapLoginFilterUsername       | 1                                                                                                                                              |
| ldapMatchingRuleInChainState  | unknown                                                                                                                                        |
| ldapNestedGroups              | 0                                                                                                                                              |
| ldapOverrideMainServer        |                                                                                                                                                |
| ldapPagingSize                | 500                                                                                                                                            |
| ldapPort                      | 7389                                                                                                                                           |
| ldapQuotaAttribute            |                                                                                                                                                |
| ldapQuotaDefault              |                                                                                                                                                |
| ldapTLS                       | 0                                                                                                                                              |
| ldapUserAvatarRule            | default                                                                                                                                        |
| ldapUserDisplayName           | displayname                                                                                                                                    |
| ldapUserDisplayName2          |                                                                                                                                                |
| ldapUserFilter                | (&(|(objectclass=person))(|(memberof=cn=NextCloud,cn=groups,dc=int,dc=kcastner,dc=de)))                                                        |
| ldapUserFilterGroups          | NextCloud                                                                                                                                      |
| ldapUserFilterMode            | 0                                                                                                                                              |
| ldapUserFilterObjectclass     | person                                                                                                                                         |
| ldapUuidGroupAttribute        | auto                                                                                                                                           |
| ldapUuidUserAttribute         | auto                                                                                                                                           |
| markRemnantsAsDisabled        | 0                                                                                                                                              |
| turnOffCertCheck              | 0                                                                                                                                              |
| turnOnPasswordChange          | 0                                                                                                                                              |
| useMemberOfToDetectMembership | 1                                                                                                                                              |
+-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------+
+-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------+
| Configuration                 | s02                                                                                                                                            |
+-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------+
| hasMemberOfFilterSupport      | 1                                                                                                                                              |
| homeFolderNamingRule          |                                                                                                                                                |
| lastJpegPhotoLookup           | 0                                                                                                                                              |
| ldapAdminGroup                |                                                                                                                                                |
| ldapAgentName                 | uid={{ REDUCTED }},CN=users,DC=int,DC=kcastner,DC=de                                                                                               |
| ldapAgentPassword             | ***                                                                                                                                            |
| ldapAttributeAddress          |                                                                                                                                                |
| ldapAttributeBiography        |                                                                                                                                                |
| ldapAttributeFediverse        |                                                                                                                                                |
| ldapAttributeHeadline         |                                                                                                                                                |
| ldapAttributeOrganisation     |                                                                                                                                                |
| ldapAttributePhone            |                                                                                                                                                |
| ldapAttributeRole             |                                                                                                                                                |
| ldapAttributeTwitter          |                                                                                                                                                |
| ldapAttributeWebsite          |                                                                                                                                                |
| ldapAttributesForGroupSearch  |                                                                                                                                                |
| ldapAttributesForUserSearch   |                                                                                                                                                |
| ldapBackgroundHost            |                                                                                                                                                |
| ldapBackgroundPort            |                                                                                                                                                |
| ldapBackupHost                |                                                                                                                                                |
| ldapBackupPort                |                                                                                                                                                |
| ldapBase                      | DC=int,DC=kcastner,DC=de                                                                                                                       |
| ldapBaseGroups                | DC=int,DC=kcastner,DC=de                                                                                                                       |
| ldapBaseUsers                 | DC=int,DC=kcastner,DC=de                                                                                                                       |
| ldapCacheTTL                  | 600                                                                                                                                            |
| ldapConfigurationActive       | 1                                                                                                                                              |
| ldapConnectionTimeout         | 15                                                                                                                                             |
| ldapDefaultPPolicyDN          |                                                                                                                                                |
| ldapDynamicGroupMemberURL     |                                                                                                                                                |
| ldapEmailAttribute            | mail                                                                                                                                           |
| ldapExperiencedAdmin          | 0                                                                                                                                              |
| ldapExpertUUIDGroupAttr       |                                                                                                                                                |
| ldapExpertUUIDUserAttr        |                                                                                                                                                |
| ldapExpertUsernameAttr        |                                                                                                                                                |
| ldapExtStorageHomeAttribute   |                                                                                                                                                |
| ldapGidNumber                 | gidNumber                                                                                                                                      |
| ldapGroupDisplayName          | cn                                                                                                                                             |
| ldapGroupFilter               | (&(|(objectclass=univentionGroup))(|(cn=NextCloud)))                                                                                           |
| ldapGroupFilterGroups         | NextCloud                                                                                                                                      |
| ldapGroupFilterMode           | 0                                                                                                                                              |
| ldapGroupFilterObjectclass    | univentionGroup                                                                                                                                |
| ldapGroupMemberAssocAttr      | gidNumber                                                                                                                                      |
| ldapHost                      | dc02.int.kcastner.de                                                                                                                           |
| ldapIgnoreNamingRules         |                                                                                                                                                |
| ldapLoginFilter               | (&(&(|(objectclass=person))(|(memberof=cn=NextCloud,cn=groups,dc=int,dc=kcastner,dc=de)))(|(uid=%uid)(|(mailPrimaryAddress=%uid)(mail=%uid)))) |
| ldapLoginFilterAttributes     |                                                                                                                                                |
| ldapLoginFilterEmail          | 1                                                                                                                                              |
| ldapLoginFilterMode           | 0                                                                                                                                              |
| ldapLoginFilterUsername       | 1                                                                                                                                              |
| ldapMatchingRuleInChainState  | unknown                                                                                                                                        |
| ldapNestedGroups              | 0                                                                                                                                              |
| ldapOverrideMainServer        |                                                                                                                                                |
| ldapPagingSize                | 500                                                                                                                                            |
| ldapPort                      | 7389                                                                                                                                           |
| ldapQuotaAttribute            |                                                                                                                                                |
| ldapQuotaDefault              |                                                                                                                                                |
| ldapTLS                       | 0                                                                                                                                              |
| ldapUserAvatarRule            | default                                                                                                                                        |
| ldapUserDisplayName           | displayname                                                                                                                                    |
| ldapUserDisplayName2          |                                                                                                                                                |
| ldapUserFilter                | (&(|(objectclass=person))(|(memberof=cn=NextCloud,cn=groups,dc=int,dc=kcastner,dc=de)))                                                        |
| ldapUserFilterGroups          | NextCloud                                                                                                                                      |
| ldapUserFilterMode            | 0                                                                                                                                              |
| ldapUserFilterObjectclass     | person                                                                                                                                         |
| ldapUuidGroupAttribute        | auto                                                                                                                                           |
| ldapUuidUserAttribute         | auto                                                                                                                                           |
| markRemnantsAsDisabled        | 0                                                                                                                                              |
| turnOffCertCheck              | 0                                                                                                                                              |
| turnOnPasswordChange          | 0                                                                                                                                              |
| useMemberOfToDetectMembership | 1                                                                                                                                              |
+-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------+

Here is a screenshot of Admin UI: Screenshot 2024-01-10 190016

Should I delete the second config?

come-nc commented 10 months ago

It’s crazy that you do not see both config in the UI. Maybe it’s something specific to univention, I don’t know.

But at least that confirms the problem comes from multiple config. Could you try this fix:

diff --git a/apps/user_ldap/lib/Group_Proxy.php b/apps/user_ldap/lib/Group_Proxy.php
index 73daf4fdd77..7410aa6a6e9 100644
--- a/apps/user_ldap/lib/Group_Proxy.php
+++ b/apps/user_ldap/lib/Group_Proxy.php
@@ -178,7 +178,7 @@ class Group_Proxy extends Proxy implements \OCP\GroupInterface, IGroupLDAP, IGet
                        }
                }

-               return $groups;
+               return array_values(array_unique($groups));
        }

        /**
kcastner commented 10 months ago

Maybe it’s something specific to univention

i tried to figure it out - it doesnt matter which config is active. if i disable on of these via occ ldap:set-config XXX ldapConfigurationActive 0 the login will work without any problem.

if both configs are active, the problem persists.


after activating both configs, i applied your fix. the login will work again as usually.

now my question: idk how/why there are two configs set. what about deleting one? my dns-setup is correct - all DC's can be found there.

if you merge this fix to public, other instances (not mine) may have real multiple LDAP's with same group name - as i know, thats not supported. should we take care of it?

come-nc commented 10 months ago

now my question: idk how/why there are two configs set. what about deleting one? my dns-setup is correct - all DC's can be found there.

Yes I think you can delete one, but you need to figure out which one. One has host dc02.int.kcastner.de and one has int.kcastner.de, if you know which host is better suited to be used delete the other one.

if you merge this fix to public, other instances (not mine) may have real multiple LDAP's with same group name - as i know, thats not supported. should we take care of it?

I think it is supported to merge groups accross LDAPs, at least that is how it worked until now so I will merge this fix to restore previous behavior.

Thank you for your tests and your patience!