Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

After impersonating a user, all User Status are messed up #303

Open
estux opened this issue Jun 7, 2024 · 0 comments
Open

After impersonating a user, all User Status are messed up #303

estux opened this issue Jun 7, 2024 · 0 comments

Comments

@estux
Copy link

estux commented Jun 7, 2024

I impersonated a normal user from admin account and immediately noticed a strange user status while I was inside the account of the impersonated user. The status was automatically set to "In a meeting" with a calendar icon.
I went in the settings to revert it back to Available (green circle) without success and then exited from the impersonated account.
Now also other normal users are affected by this bug, all their status are changed immediately after login to "in a meeting" and reverting back to Available status or deleting status message doesn't work at all.

So I went to check nextcloud.log and found this error logged (one for impersonated user, one for my actual user (not admin)):

{"reqId":"MvYAigQGKQMZCaHzWFR6","level":3,"time":"2024-06-07T13:20:06+02:00","remoteAddr":"myIP(sensitive)","user":"user name(sensitive)","app":"no app in context","method":"GET","url":"/ocs/v2.php/apps/user_status/api/v1/user_status","message":"Exception thrown: OC\\DB\\Exceptions\\DbalException","userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:126.0) Gecko/20100101 Firefox/126.0","version":"28.0.6.1","exception":{"Exception":"OC\\DB\\Exceptions\\DbalException","Message":"An exception occurred while executing a query: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry 'user name (sensitive)' for key 'user_status_uid_ix'","Code":1062,"Trace":[{"file":"/data/www/nextcloud614/lib/private/DB/QueryBuilder/QueryBuilder.php","line":328,"function":"wrap","class":"OC\\DB\\Exceptions\\DbalException","type":"::"},{"file":"/data/www/nextcloud614/lib/public/AppFramework/Db/QBMapper.php","line":137,"function":"executeStatement","class":"OC\\DB\\QueryBuilder\\QueryBuilder","type":"->"},{"file":"/data/www/nextcloud614/apps/user_status/lib/Service/StatusService.php","line":311,"function":"insert","class":"OCP\\AppFramework\\Db\\QBMapper","type":"->"},{"file":"/data/www/nextcloud614/apps/dav/lib/CalDAV/Status/StatusService.php","line":134,"function":"setUserStatus","class":"OCA\\UserStatus\\Service\\StatusService","type":"->"},{"file":"/data/www/nextcloud614/apps/user_status/lib/Controller/UserStatusController.php","line":77,"function":"processCalendarStatus","class":"OCA\\DAV\\CalDAV\\Status\\StatusService","type":"->"},{"file":"/data/www/nextcloud614/lib/private/AppFramework/Http/Dispatcher.php","line":230,"function":"getStatus","class":"OCA\\UserStatus\\Controller\\UserStatusController","type":"->"},{"file":"/data/www/nextcloud614/lib/private/AppFramework/Http/Dispatcher.php","line":137,"function":"executeController","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->"},{"file":"/data/www/nextcloud614/lib/private/AppFramework/App.php","line":184,"function":"dispatch","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->"},{"file":"/data/www/nextcloud614/lib/private/Route/Router.php","line":315,"function":"main","class":"OC\\AppFramework\\App","type":"::"},{"file":"/data/www/nextcloud614/ocs/v1.php","line":65,"function":"match","class":"OC\\Route\\Router","type":"->"},{"file":"/data/www/nextcloud614/ocs/v2.php","line":23,"args":["/data/www/nextcloud614/ocs/v1.php"],"function":"require_once"}],"File":"/data/www/nextcloud614/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 'user name (sensitive)' for key 'user_status_uid_ix'","Code":1062,"Trace":[{"file":"/data/www/nextcloud614/3rdparty/doctrine/dbal/src/Connection.php","line":1938,"function":"convert","class":"Doctrine\\DBAL\\Driver\\API\\MySQL\\ExceptionConverter","type":"->"},{"file":"/data/www/nextcloud614/3rdparty/doctrine/dbal/src/Connection.php","line":1880,"function":"handleDriverException","class":"Doctrine\\DBAL\\Connection","type":"->"},{"file":"/data/www/nextcloud614/3rdparty/doctrine/dbal/src/Connection.php","line":1208,"function":"convertExceptionDuringQuery","class":"Doctrine\\DBAL\\Connection","type":"->"},{"file":"/data/www/nextcloud614/lib/private/DB/Connection.php","line":294,"function":"executeStatement","class":"Doctrine\\DBAL\\Connection","type":"->"},{"file":"/data/www/nextcloud614/3rdparty/doctrine/dbal/src/Query/QueryBuilder.php","line":386,"function":"executeStatement","class":"OC\\DB\\Connection","type":"->"},{"file":"/data/www/nextcloud614/lib/private/DB/QueryBuilder/QueryBuilder.php","line":280,"function":"execute","class":"Doctrine\\DBAL\\Query\\QueryBuilder","type":"->"},{"file":"/data/www/nextcloud614/lib/private/DB/QueryBuilder/QueryBuilder.php","line":326,"function":"execute","class":"OC\\DB\\QueryBuilder\\QueryBuilder","type":"->"},{"file":"/data/www/nextcloud614/lib/public/AppFramework/Db/QBMapper.php","line":137,"function":"executeStatement","class":"OC\\DB\\QueryBuilder\\QueryBuilder","type":"->"},{"file":"/data/www/nextcloud614/apps/user_status/lib/Service/StatusService.php","line":311,"function":"insert","class":"OCP\\AppFramework\\Db\\QBMapper","type":"->"},{"file":"/data/www/nextcloud614/apps/dav/lib/CalDAV/Status/StatusService.php","line":134,"function":"setUserStatus","class":"OCA\\UserStatus\\Service\\StatusService","type":"->"},{"file":"/data/www/nextcloud614/apps/user_status/lib/Controller/UserStatusController.php","line":77,"function":"processCalendarStatus","class":"OCA\\DAV\\CalDAV\\Status\\StatusService","type":"->"},{"file":"/data/www/nextcloud614/lib/private/AppFramework/Http/Dispatcher.php","line":230,"function":"getStatus","class":"OCA\\UserStatus\\Controller\\UserStatusController","type":"->"},{"file":"/data/www/nextcloud614/lib/private/AppFramework/Http/Dispatcher.php","line":137,"function":"executeController","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->"},{"file":"/data/www/nextcloud614/lib/private/AppFramework/App.php","line":184,"function":"dispatch","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->"},{"file":"/data/www/nextcloud614/lib/private/Route/Router.php","line":315,"function":"main","class":"OC\\AppFramework\\App","type":"::"},{"file":"/data/www/nextcloud614/ocs/v1.php","line":65,"function":"match","class":"OC\\Route\\Router","type":"->"},{"file":"/data/www/nextcloud614/ocs/v2.php","line":23,"args":["/data/www/nextcloud614/ocs/v1.php"],"function":"require_once"}],"File":"/data/www/nextcloud614/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 'user name (sensitive)' for key 'user_status_uid_ix'","Code":1062,"Trace":[{"file":"/data/www/nextcloud614/3rdparty/doctrine/dbal/src/Driver/PDO/Statement.php","line":132,"function":"new","class":"Doctrine\\DBAL\\Driver\\PDO\\Exception","type":"::"},{"file":"/data/www/nextcloud614/3rdparty/doctrine/dbal/src/Connection.php","line":1202,"function":"execute","class":"Doctrine\\DBAL\\Driver\\PDO\\Statement","type":"->"},{"file":"/data/www/nextcloud614/lib/private/DB/Connection.php","line":294,"function":"executeStatement","class":"Doctrine\\DBAL\\Connection","type":"->"},{"file":"/data/www/nextcloud614/3rdparty/doctrine/dbal/src/Query/QueryBuilder.php","line":386,"function":"executeStatement","class":"OC\\DB\\Connection","type":"->"},{"file":"/data/www/nextcloud614/lib/private/DB/QueryBuilder/QueryBuilder.php","line":280,"function":"execute","class":"Doctrine\\DBAL\\Query\\QueryBuilder","type":"->"},{"file":"/data/www/nextcloud614/lib/private/DB/QueryBuilder/QueryBuilder.php","line":326,"function":"execute","class":"OC\\DB\\QueryBuilder\\QueryBuilder","type":"->"},{"file":"/data/www/nextcloud614/lib/public/AppFramework/Db/QBMapper.php","line":137,"function":"executeStatement","class":"OC\\DB\\QueryBuilder\\QueryBuilder","type":"->"},{"file":"/data/www/nextcloud614/apps/user_status/lib/Service/StatusService.php","line":311,"function":"insert","class":"OCP\\AppFramework\\Db\\QBMapper","type":"->"},{"file":"/data/www/nextcloud614/apps/dav/lib/CalDAV/Status/StatusService.php","line":134,"function":"setUserStatus","class":"OCA\\UserStatus\\Service\\StatusService","type":"->"},{"file":"/data/www/nextcloud614/apps/user_status/lib/Controller/UserStatusController.php","line":77,"function":"processCalendarStatus","class":"OCA\\DAV\\CalDAV\\Status\\StatusService","type":"->"},{"file":"/data/www/nextcloud614/lib/private/AppFramework/Http/Dispatcher.php","line":230,"function":"getStatus","class":"OCA\\UserStatus\\Controller\\UserStatusController","type":"->"},{"file":"/data/www/nextcloud614/lib/private/AppFramework/Http/Dispatcher.php","line":137,"function":"executeController","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->"},{"file":"/data/www/nextcloud614/lib/private/AppFramework/App.php","line":184,"function":"dispatch","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->"},{"file":"/data/www/nextcloud614/lib/private/Route/Router.php","line":315,"function":"main","class":"OC\\AppFramework\\App","type":"::"},{"file":"/data/www/nextcloud614/ocs/v1.php","line":65,"function":"match","class":"OC\\Route\\Router","type":"->"},{"file":"/data/www/nextcloud614/ocs/v2.php","line":23,"args":["/data/www/nextcloud614/ocs/v1.php"],"function":"require_once"}],"File":"/data/www/nextcloud614/3rdparty/doctrine/dbal/src/Driver/PDO/Exception.php","Line":28,"Previous":{"Exception":"PDOException","Message":"SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry 'user name (sensitive)' for key 'user_status_uid_ix'","Code":"23000","Trace":[{"file":"/data/www/nextcloud614/3rdparty/doctrine/dbal/src/Driver/PDO/Statement.php","line":130,"function":"execute","class":"PDOStatement","type":"->"},{"file":"/data/www/nextcloud614/3rdparty/doctrine/dbal/src/Connection.php","line":1202,"function":"execute","class":"Doctrine\\DBAL\\Driver\\PDO\\Statement","type":"->"},{"file":"/data/www/nextcloud614/lib/private/DB/Connection.php","line":294,"function":"executeStatement","class":"Doctrine\\DBAL\\Connection","type":"->"},{"file":"/data/www/nextcloud614/3rdparty/doctrine/dbal/src/Query/QueryBuilder.php","line":386,"function":"executeStatement","class":"OC\\DB\\Connection","type":"->"},{"file":"/data/www/nextcloud614/lib/private/DB/QueryBuilder/QueryBuilder.php","line":280,"function":"execute","class":"Doctrine\\DBAL\\Query\\QueryBuilder","type":"->"},{"file":"/data/www/nextcloud614/lib/private/DB/QueryBuilder/QueryBuilder.php","line":326,"function":"execute","class":"OC\\DB\\QueryBuilder\\QueryBuilder","type":"->"},{"file":"/data/www/nextcloud614/lib/public/AppFramework/Db/QBMapper.php","line":137,"function":"executeStatement","class":"OC\\DB\\QueryBuilder\\QueryBuilder","type":"->"},{"file":"/data/www/nextcloud614/apps/user_status/lib/Service/StatusService.php","line":311,"function":"insert","class":"OCP\\AppFramework\\Db\\QBMapper","type":"->"},{"file":"/data/www/nextcloud614/apps/dav/lib/CalDAV/Status/StatusService.php","line":134,"function":"setUserStatus","class":"OCA\\UserStatus\\Service\\StatusService","type":"->"},{"file":"/data/www/nextcloud614/apps/user_status/lib/Controller/UserStatusController.php","line":77,"function":"processCalendarStatus","class":"OCA\\DAV\\CalDAV\\Status\\StatusService","type":"->"},{"file":"/data/www/nextcloud614/lib/private/AppFramework/Http/Dispatcher.php","line":230,"function":"getStatus","class":"OCA\\UserStatus\\Controller\\UserStatusController","type":"->"},{"file":"/data/www/nextcloud614/lib/private/AppFramework/Http/Dispatcher.php","line":137,"function":"executeController","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->"},{"file":"/data/www/nextcloud614/lib/private/AppFramework/App.php","line":184,"function":"dispatch","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->"},{"file":"/data/www/nextcloud614/lib/private/Route/Router.php","line":315,"function":"main","class":"OC\\AppFramework\\App","type":"::"},{"file":"/data/www/nextcloud614/ocs/v1.php","line":65,"function":"match","class":"OC\\Route\\Router","type":"->"},{"file":"/data/www/nextcloud614/ocs/v2.php","line":23,"args":["/data/www/nextcloud614/ocs/v1.php"],"function":"require_once"}],"File":"/data/www/nextcloud614/3rdparty/doctrine/dbal/src/Driver/PDO/Statement.php","Line":130}}},"CustomMessage":"Exception thrown: OC\\DB\\Exceptions\\DbalException"},"id":"6662eced8c49d"}

It seems this (impersonating one user) messed up all the user status database.

System data
Nextcloud version: 28.0.6
Impersonate version: 1.15
Webserver: nginx/1.18.0 (fpm-fcgi)
Database: mysql 10.5.23
PHP version: 8.2.14

List of apps

Enabled:
 - activity: 2.20.0
 - bookmarks: 14.1.2
 - bruteforcesettings: 2.8.0
 - calendar: 4.7.6
 - camerarawpreviews: 0.8.5
 - circles: 28.0.0
 - cloud_federation_api: 1.11.0
 - collectives: 2.11.0
 - comments: 1.18.0
 - contacts: 5.5.3
 - contactsinteraction: 1.9.0
 - cospend: 1.6.1
 - dashboard: 7.8.0
 - dav: 1.29.1
 - deck: 1.12.2
 - 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
 - forms: 4.2.4
 - groupfolders: 16.0.6
 - guests: 3.0.1
 - impersonate: 1.15.0
 - logreader: 2.13.0
 - lookup_server_connector: 1.16.0
 - maps: 1.4.0
 - nextcloud_announcements: 1.17.0
 - notes: 4.10.0
 - notifications: 2.16.0
 - oauth2: 1.16.3
 - password_policy: 1.18.0
 - photos: 2.4.0
 - polls: 7.0.3
 - privacy: 1.12.0
 - provisioning_api: 1.18.0
 - recommendations: 2.0.0
 - related_resources: 1.3.0
 - richdocuments: 8.3.7
 - serverinfo: 1.18.0
 - settings: 1.10.1
 - sharebymail: 1.18.0
 - spreed: 18.0.8
 - support: 1.11.1
 - survey_client: 1.16.0
 - suspicious_login: 6.0.0
 - systemtags: 1.18.0
 - tables: 0.7.2
 - tasks: 0.16.0
 - text: 3.9.1
 - theming: 2.3.0
 - twofactor_backupcodes: 1.17.0
 - updatenotification: 1.18.0
 - user_status: 1.8.1
 - viewer: 2.2.0
 - weather_status: 1.8.0
 - welcome: 1.1.0
 - workflowengine: 2.10.0
Disabled:
 - admin_audit: 1.10.0
 - encryption
 - files_external
 - files_rightclick: 1.6.0
 - talk_matterbridge: 1.26.0
 - twofactor_totp
 - unsplash: 2.2.1
 - user_ldap
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants