Cannot completely remove user - user data deleted but MySQL references persist

I’m trying to delete a user I’ve tried via commandline and the web interface. Unfortunately when I look into the MySQL – Database I still see a ton of rows populated with ‘AnnoyingUser’

sudo -u www-data php occ user:delete AnnoyingUser
Nextcloud is in maintenance mode - no apps have been loaded
PHP Fatal error: Class ‘OCA\FederatedFileSharing\AddressHandler’ not found in /var/www/nextcloud/lib/private/Share20/ProviderFactory.php on line 97

{“reqId”:“CFSCxJkKoK3hwo8txSaB”,“remoteAddr”:“”,“app”:“PHP”,“message”:“Class ‘OCA\FederatedFileSharing\AddressHandler’ not found at /var/www/nextcloud/lib/private/Share20/ProviderFactory.php#97”,“level”:3,“time”:“2017-02-26T03:40:30+00:00”,“method”:“–”,“url”:“–”,“user”:“–”,“version”:“11.0.1.2”}

All the user data is gone for ‘AnnoyingUser’ but he still exists in most of the database. Unfortunately I do need to reuse the particular name of this individual as a user. I need to figure out how to purge everything related to ‘AnnoyingUser’ from the nextcloud MySQL database.

Thank you for your help in advance!

Nextcloud version 11.0.1
Debian Jessie
Nginx 1.6.2
PHP version 5:
Is this the first time you’ve seen this error?: Yes

Bump :worried:

The issue is resolved!

  1. I did this by migrating the nextcloud user data to a new nextcloud install.
  2. Enabled nextcloud maintenance mode.
  3. Then migrated MySQL database in portions. First with user credential information.
  4. Disabled maintenance mode
  5. Then logged in as a user admin and enabled the previous apps.
  6. Re-enabled maintenance mode. Second i migrated relevant app databases.
  7. Disabled maintenance mode
  8. sudo -u www-data php occ files:scan --all
  9. Presto everything works!

Requires phpmyadmin on the server and something like mysql server/workbench on local machine. This allows for you to extract portions of the database then upload them to the nextcloud server.

I know this is an old thread. I had a similar issue. I deleted user1 from web interface but the name and email remained in the dropdown list although no files or folders remained for user1. I could not recreate user1 from the admin interface or use forgot password!

However deleting the user from the command line worked fine when NC is not in maintenance mode.
sudo -u www-data php occ user:delete user1

2 Likes