Attempt for Paging and DbalException

Nextcloud version (eg, 20.0.5): 28.02
Operating system and version (eg, Ubuntu 20.04): Ubuntu 22.04
Apache or nginx version (eg, Apache 2.4.25): Apache 2.4.52
PHP version (eg, 7.4): 8.1.2

The issue you are facing:

I’ve updated from 27.x to 28.0.1 and had a lot of errors. Some have already been fixed by the update to 28.0.2. However some error are still present.
The error which reoccurs several times an hour from the application “user_ldap” is:

Attempt for Paging? 1

The error which reoccurs several times within a day from the core is

DbalException
An exception occurred while executing a query: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry ‘QUAREP-889f2d2c-5b37-103c-9465-851589469358’ for key ‘oc_ldap_group_membership.user_ldap_membership_unique’
Exception thrown: OC\DB\Exceptions\DbalException

The errors seem to be related to the connection to the LDAP server, which is used for the user management. Furthermore every user gets notifications that he or she has been removed from the group QUAREP, although the users still in the group. All users can work as usual but the notifications are annoying and raise questions from the user side.

Is this the first time you’ve seen this error? (Y/N):

The

Attempt for paging error? 1

has been there in the past in version 27.x. However in the last version of 27 it has been gone.

The output of your Nextcloud log in Admin > Logging:

[user_ldap] Error: Attempt for Paging?  1
	from ? by -- at 06.02.2024, 13:00:02
[user_ldap] Error: Attempt for Paging?  1
	from ? by -- at 06.02.2024, 12:55:03
[user_ldap] Error: Attempt for Paging?  1
	from ? by -- at 06.02.2024, 12:40:02
[core] Error: Exception thrown: Doctrine\DBAL\Exception
	GET /index.php/apps/logreader/api/poll?lastReqId=kav5e2XYsZZJBQs1o9OL
	from 10.5.235.67 by -- at 06.02.2024, 12:35:43
[core] Error: Exception thrown: Doctrine\DBAL\Exception
	GET /index.php/apps/logreader/api/poll?lastReqId=kav5e2XYsZZJBQs1o9OL
	from 10.5.235.67 by -- at 06.02.2024, 12:35:43
[index] Error: Failed to connect to the database: An exception occurred in the driver: SQLSTATE[HY000] [2002] No such file or directory
	GET /index.php/apps/logreader/api/poll?lastReqId=kav5e2XYsZZJBQs1o9OL
	from 10.5.235.67 by -- at 06.02.2024, 12:35:43
[PHP] Error: Doctrine\DBAL\Exception: Failed to connect to the database: An exception occurred in the driver: SQLSTATE[HY000] [2002] No such file or directory at /var/www/nextcloud.quarep.org/lib/private/DB/Connection.php#139
	GET /ocs/v2.php/apps/notifications/api/v2/notifications
	from 217.91.68.60 by -- at 06.02.2024, 12:35:43
[PHP] Error: Doctrine\DBAL\Exception: Failed to connect to the database: An exception occurred in the driver: SQLSTATE[HY000] [2002] No such file or directory at /var/www/nextcloud.quarep.org/lib/private/DB/Connection.php#139
	GET /ocs/v2.php/apps/notifications/api/v2/notifications
	from 141.76.27.155 by -- at 06.02.2024, 12:35:43
[user_ldap] Error: Attempt for Paging?  1
	GET /index.php/settings/users
	from 10.5.235.67 by e4676134-3e08-103c-81b2-3539e8883aff at 06.02.2024, 12:28:01

Output errors in nextcloud.log in /var/www/ or as admin user in top right menu, filtering for errors. Use a pastebin service if necessary.

{"reqId":"kav5e2XYsZZJBQs1o9OL","level":3,"time":"2024-02-06T11:28:01+00:00","remoteAddr":"10.5.235.67","user":"e4676134-3e08-103c-81b2-3539e8883aff","app":"user_ldap","method":"GET","url":"/index.php/settings/users","message":"Attempt for Paging?  1","userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/121.0.0.0 Safari/537.36","version":"28.0.2.5","data":{"app":"user_ldap"}}
{"reqId":"6rogIO2oZcsOQufowSQQ","level":3,"time":"2024-02-06T11:35:43+00:00","remoteAddr":"141.76.27.155","user":"--","app":"PHP","method":"GET","url":"/ocs/v2.php/apps/notifications/api/v2/notifications","message":"Doctrine\\DBAL\\Exception: Failed to connect to the database: An exception occurred in the driver: SQLSTATE[HY000] [2002] No such file or directory at /var/www/nextcloud.quarep.org/lib/private/DB/Connection.php#139","userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:109.0) Gecko/20100101 Firefox/115.0","version":"28.0.2.5","data":{"app":"PHP"}}
{"reqId":"Oyiwb42w0NtRIarbH4uz","level":3,"time":"2024-02-06T11:35:43+00:00","remoteAddr":"217.91.68.60","user":"--","app":"PHP","method":"GET","url":"/ocs/v2.php/apps/notifications/api/v2/notifications","message":"Doctrine\\DBAL\\Exception: Failed to connect to the database: An exception occurred in the driver: SQLSTATE[HY000] [2002] No such file or directory at /var/www/nextcloud.quarep.org/lib/private/DB/Connection.php#139","userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:122.0) Gecko/20100101 Firefox/122.0","version":"28.0.2.5","data":{"app":"PHP"}}
{"reqId":"zreeK5yLX28mT0lG1kGO","level":3,"time":"2024-02-06T11:35:43+00:00","remoteAddr":"10.5.235.67","user":"--","app":"index","method":"GET","url":"/index.php/apps/logreader/api/poll?lastReqId=kav5e2XYsZZJBQs1o9OL","message":"Failed to connect to the database: An exception occurred in the driver: SQLSTATE[HY000] [2002] No such file or directory","userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/121.0.0.0 Safari/537.36","version":"28.0.2.5","exception":{"Exception":"Doctrine\\DBAL\\Exception","Message":"Failed to connect to the database: An exception occurred in the driver: SQLSTATE[HY000] [2002] No such file or directory","Code":2002,"Trace":[{"file":"/var/www/nextcloud.quarep.org/3rdparty/doctrine/dbal/src/Connection.php","line":1654,"function":"connect","class":"OC\\DB\\Connection","type":"->"},{"file":"/var/www/nextcloud.quarep.org/3rdparty/doctrine/dbal/src/Connection.php","line":1081,"function":"getWrappedConnection","class":"Doctrine\\DBAL\\Connection","type":"->"},{"file":"/var/www/nextcloud.quarep.org/lib/private/DB/Connection.php","line":261,"function":"executeQuery","class":"Doctrine\\DBAL\\Connection","type":"->"},{"file":"/var/www/nextcloud.quarep.org/3rdparty/doctrine/dbal/src/Query/QueryBuilder.php","line":341,"function":"executeQuery","class":"OC\\DB\\Connection","type":"->"},{"file":"/var/www/nextcloud.quarep.org/3rdparty/doctrine/dbal/src/Query/QueryBuilder.php","line":377,"function":"executeQuery","class":"Doctrine\\DBAL\\Query\\QueryBuilder","type":"->"},{"file":"/var/www/nextcloud.quarep.org/lib/private/DB/QueryBuilder/QueryBuilder.php","line":280,"function":"execute","class":"Doctrine\\DBAL\\Query\\QueryBuilder","type":"->"},{"file":"/var/www/nextcloud.quarep.org/lib/private/AppConfig.php","line":421,"function":"execute","class":"OC\\DB\\QueryBuilder\\QueryBuilder","type":"->"},{"file":"/var/www/nextcloud.quarep.org/lib/private/AppConfig.php","line":187,"function":"loadConfigValues","class":"OC\\AppConfig","type":"->"},{"file":"/var/www/nextcloud.quarep.org/lib/private/AppConfig.php","line":377,"function":"getApps","class":"OC\\AppConfig","type":"->"},{"file":"/var/www/nextcloud.quarep.org/lib/private/App/AppManager.php","line":128,"function":"getValues","class":"OC\\AppConfig","type":"->"},{"file":"/var/www/nextcloud.quarep.org/lib/private/App/AppManager.php","line":149,"function":"getInstalledAppsValues","class":"OC\\App\\AppManager","type":"->"},{"file":"/var/www/nextcloud.quarep.org/lib/private/legacy/OC_App.php","line":231,"function":"getInstalledApps","class":"OC\\App\\AppManager","type":"->"},{"file":"/var/www/nextcloud.quarep.org/lib/private/AppFramework/Bootstrap/Coordinator.php","line":90,"function":"getEnabledApps","class":"OC_App","type":"::"},{"file":"/var/www/nextcloud.quarep.org/lib/base.php","line":700,"function":"runInitialRegistration","class":"OC\\AppFramework\\Bootstrap\\Coordinator","type":"->"},{"file":"/var/www/nextcloud.quarep.org/lib/base.php","line":1200,"function":"init","class":"OC","type":"::"},{"file":"/var/www/nextcloud.quarep.org/index.php","line":37,"args":["/var/www/nextcloud.quarep.org/lib/base.php"],"function":"require_once"}],"File":"/var/www/nextcloud.quarep.org/lib/private/DB/Connection.php","Line":139,"message":"Failed to connect to the database: An exception occurred in the driver: SQLSTATE[HY000] [2002] No such file or directory","exception":{},"CustomMessage":"Failed to connect to the database: An exception occurred in the driver: SQLSTATE[HY000] [2002] No such file or directory"}}
{"reqId":"zreeK5yLX28mT0lG1kGO","level":3,"time":"2024-02-06T11:35:43+00:00","remoteAddr":"10.5.235.67","user":"--","app":"core","method":"GET","url":"/index.php/apps/logreader/api/poll?lastReqId=kav5e2XYsZZJBQs1o9OL","message":"Exception thrown: Doctrine\\DBAL\\Exception","userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/121.0.0.0 Safari/537.36","version":"28.0.2.5","exception":{"Exception":"Doctrine\\DBAL\\Exception","Message":"Failed to connect to the database: An exception occurred in the driver: SQLSTATE[HY000] [2002] No such file or directory","Code":2002,"Trace":[{"file":"/var/www/nextcloud.quarep.org/3rdparty/doctrine/dbal/src/Connection.php","line":1654,"function":"connect","class":"OC\\DB\\Connection","type":"->"},{"file":"/var/www/nextcloud.quarep.org/3rdparty/doctrine/dbal/src/Connection.php","line":1081,"function":"getWrappedConnection","class":"Doctrine\\DBAL\\Connection","type":"->"},{"file":"/var/www/nextcloud.quarep.org/lib/private/DB/Connection.php","line":261,"function":"executeQuery","class":"Doctrine\\DBAL\\Connection","type":"->"},{"file":"/var/www/nextcloud.quarep.org/3rdparty/doctrine/dbal/src/Query/QueryBuilder.php","line":341,"function":"executeQuery","class":"OC\\DB\\Connection","type":"->"},{"file":"/var/www/nextcloud.quarep.org/3rdparty/doctrine/dbal/src/Query/QueryBuilder.php","line":377,"function":"executeQuery","class":"Doctrine\\DBAL\\Query\\QueryBuilder","type":"->"},{"file":"/var/www/nextcloud.quarep.org/lib/private/DB/QueryBuilder/QueryBuilder.php","line":280,"function":"execute","class":"Doctrine\\DBAL\\Query\\QueryBuilder","type":"->"},{"file":"/var/www/nextcloud.quarep.org/lib/private/AppConfig.php","line":421,"function":"execute","class":"OC\\DB\\QueryBuilder\\QueryBuilder","type":"->"},{"file":"/var/www/nextcloud.quarep.org/lib/private/AppConfig.php","line":187,"function":"loadConfigValues","class":"OC\\AppConfig","type":"->"},{"file":"/var/www/nextcloud.quarep.org/lib/private/AppConfig.php","line":377,"function":"getApps","class":"OC\\AppConfig","type":"->"},{"file":"/var/www/nextcloud.quarep.org/lib/private/App/AppManager.php","line":128,"function":"getValues","class":"OC\\AppConfig","type":"->"},{"file":"/var/www/nextcloud.quarep.org/lib/private/App/AppManager.php","line":149,"function":"getInstalledAppsValues","class":"OC\\App\\AppManager","type":"->"},{"file":"/var/www/nextcloud.quarep.org/lib/private/legacy/OC_App.php","line":231,"function":"getInstalledApps","class":"OC\\App\\AppManager","type":"->"},{"file":"/var/www/nextcloud.quarep.org/lib/private/AppFramework/Bootstrap/Coordinator.php","line":90,"function":"getEnabledApps","class":"OC_App","type":"::"},{"file":"/var/www/nextcloud.quarep.org/lib/base.php","line":700,"function":"runInitialRegistration","class":"OC\\AppFramework\\Bootstrap\\Coordinator","type":"->"},{"file":"/var/www/nextcloud.quarep.org/lib/base.php","line":1200,"function":"init","class":"OC","type":"::"},{"file":"/var/www/nextcloud.quarep.org/index.php","line":37,"args":["/var/www/nextcloud.quarep.org/lib/base.php"],"function":"require_once"}],"File":"/var/www/nextcloud.quarep.org/lib/private/DB/Connection.php","Line":139,"CustomMessage":"Exception thrown: Doctrine\\DBAL\\Exception"}}
{"reqId":"zreeK5yLX28mT0lG1kGO","level":3,"time":"2024-02-06T11:35:43+00:00","remoteAddr":"10.5.235.67","user":"--","app":"core","method":"GET","url":"/index.php/apps/logreader/api/poll?lastReqId=kav5e2XYsZZJBQs1o9OL","message":"Exception thrown: Doctrine\\DBAL\\Exception","userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/121.0.0.0 Safari/537.36","version":"28.0.2.5","exception":{"Exception":"Doctrine\\DBAL\\Exception","Message":"Failed to connect to the database: An exception occurred in the driver: SQLSTATE[HY000] [2002] No such file or directory","Code":2002,"Trace":[{"file":"/var/www/nextcloud.quarep.org/3rdparty/doctrine/dbal/src/Connection.php","line":1654,"function":"connect","class":"OC\\DB\\Connection","type":"->"},{"file":"/var/www/nextcloud.quarep.org/3rdparty/doctrine/dbal/src/Connection.php","line":1081,"function":"getWrappedConnection","class":"Doctrine\\DBAL\\Connection","type":"->"},{"file":"/var/www/nextcloud.quarep.org/lib/private/DB/Connection.php","line":261,"function":"executeQuery","class":"Doctrine\\DBAL\\Connection","type":"->"},{"file":"/var/www/nextcloud.quarep.org/3rdparty/doctrine/dbal/src/Query/QueryBuilder.php","line":341,"function":"executeQuery","class":"OC\\DB\\Connection","type":"->"},{"file":"/var/www/nextcloud.quarep.org/3rdparty/doctrine/dbal/src/Query/QueryBuilder.php","line":377,"function":"executeQuery","class":"Doctrine\\DBAL\\Query\\QueryBuilder","type":"->"},{"file":"/var/www/nextcloud.quarep.org/lib/private/DB/QueryBuilder/QueryBuilder.php","line":280,"function":"execute","class":"Doctrine\\DBAL\\Query\\QueryBuilder","type":"->"},{"file":"/var/www/nextcloud.quarep.org/lib/private/AppConfig.php","line":421,"function":"execute","class":"OC\\DB\\QueryBuilder\\QueryBuilder","type":"->"},{"file":"/var/www/nextcloud.quarep.org/lib/private/AppConfig.php","line":187,"function":"loadConfigValues","class":"OC\\AppConfig","type":"->"},{"file":"/var/www/nextcloud.quarep.org/lib/private/AppConfig.php","line":377,"function":"getApps","class":"OC\\AppConfig","type":"->"},{"file":"/var/www/nextcloud.quarep.org/lib/private/legacy/OC_App.php","line":734,"function":"getValues","class":"OC\\AppConfig","type":"->"},{"file":"/var/www/nextcloud.quarep.org/lib/private/TemplateLayout.php","line":236,"function":"getAppVersions","class":"OC_App","type":"::"},{"file":"/var/www/nextcloud.quarep.org/lib/private/legacy/OC_Template.php","line":142,"function":"__construct","class":"OC\\TemplateLayout","type":"->"},{"file":"/var/www/nextcloud.quarep.org/lib/private/Template/Base.php","line":132,"function":"fetchPage","class":"OC_Template","type":"->"},{"file":"/var/www/nextcloud.quarep.org/lib/private/legacy/OC_Template.php","line":291,"function":"printPage","class":"OC\\Template\\Base","type":"->"},{"file":"/var/www/nextcloud.quarep.org/index.php","line":104,"function":"printExceptionErrorPage","class":"OC_Template","type":"::"}],"File":"/var/www/nextcloud.quarep.org/lib/private/DB/Connection.php","Line":139,"CustomMessage":"Exception thrown: Doctrine\\DBAL\\Exception"}}
{"reqId":"7Fh10MukqidPh0oJ0vsb","level":3,"time":"2024-02-06T11:40:02+00:00","remoteAddr":"","user":"--","app":"user_ldap","method":"","url":"--","message":"Attempt for Paging?  1","userAgent":"--","version":"28.0.2.5","data":{"app":"user_ldap"}}
{"reqId":"Or6fnmQ92Ic4cNVgNTIy","level":3,"time":"2024-02-06T11:55:03+00:00","remoteAddr":"","user":"--","app":"user_ldap","method":"","url":"--","message":"Attempt for Paging?  1","userAgent":"--","version":"28.0.2.5","data":{"app":"user_ldap"}}
{"reqId":"YnpIXcmj4lcijtbFUjCt","level":3,"time":"2024-02-06T12:00:02+00:00","remoteAddr":"","user":"--","app":"user_ldap","method":"","url":"--","message":"Attempt for Paging?  1","userAgent":"--","version":"28.0.2.5","data":{"app":"user_ldap"}}

Check the bug reports. The LDAP stuff you’re experiencing sounds like at least one of the issues that I know is open right now[1]. There may other applicable ones too that you can add to the discussion about to help figure out what’s going on.

[1] e.g. [Bug]: Activity Report - Administrator removed you from group XXX · Issue #43272 · nextcloud/server · GitHub