Unable to delete user

Support intro

Sorry to hear you’re facing problems :slightly_frowning_face:

help.nextcloud.com is for home/non-enterprise users. If you’re running a business, paid support can be accessed via portal.nextcloud.com where we can ensure your business keeps running smoothly.

In order to help you as quickly as possible, before clicking Create Topic please provide as much of the below as you can. Feel free to use a pastebin service for logs, otherwise either indent short log examples with four spaces:

example

Or for longer, use three backticks above and below the code snippet:

longer
example
here

Some or all of the below information will be requested if it isn’t supplied; for fastest response please provide as much as you can :heart:

Nextcloud version (eg, 20.0.5): 24.0.8
Operating system and version (eg, Ubuntu 20.04): Debian GNU/Linux 11 (bullseye)"
Apache or nginx version (eg, Apache 2.4.25): Apache 2.4.54
PHP version (eg, 7.4): 7.4

The issue you are facing:
User cannot be deleted, log shows error.

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

Steps to replicate it:

  1. Goto users overview
  2. Click on the 3 dots in the users row
  3. Click “Delete user” and confirm the upcoming windows by clicking on the red button

The output of your Nextcloud log in Admin > Logging:

[no app in context] Error: Exception: Argument 1 passed to OCA\Files_Reader\Hooks::OCA\Files_Reader\{closure}() must be an instance of OCA\Files_Reader\Node, instance of OC\Files\Node\File given in file '/var/www/cloud/apps/files_reader/lib/Hooks.php' line 18 at <<closure>>

0. /var/www/cloud/lib/private/AppFramework/App.php line 172
   OC\AppFramework\Http\Dispatcher->dispatch()
1. /var/www/cloud/lib/private/Route/Router.php line 298
   OC\AppFramework\App::main()
2. /var/www/cloud/ocs/v1.php line 62
   OC\Route\Router->match()
3. /var/www/cloud/ocs/v2.php line 23
   require_once("/var/www/cloud/ocs/v1.php")

DELETE /ocs/v2.php/cloud/users/username
from xxx.xxx.xxx.xxx by admin at 2023-01-14T21:53:23+00:00

The output of your config.php file in /path/to/nextcloud (make sure you remove any identifiable information!):

<?php
$CONFIG = array (
  'instanceid' => 'REMOVED',
  'passwordsalt' => 'REMOVED',
  'secret' => 'REMOVED',
  'trusted_domains' =>
  array (
    0 => 'cloud.example.com',
  ),
  'datadirectory' => '/var/www/cloud/data',
  'dbtype' => 'sqlite3',
  'version' => '24.0.8.2',
  'overwrite.cli.url' => 'http://cloud.example.com',
  'installed' => true,
  'maintenance' => false,
  'mail_smtpmode' => 'sendmail',
  'mail_sendmailmode' => 'smtp',
  'mail_from_address' => 'cloud',
  'mail_domain' => 'example.com',
  'log_type' => 'file',
  'logfile' => '/var/log/nextcloud/nextcloud.log',
  'loglevel' => '2',
  'log_rotate_size' => 10485760,
  'overwriteprotocol' => 'https',
  'user_backends' =>
  array (
    0 =>
    array (
      'class' => '\\OCA\\UserExternal\\IMAP',
      'arguments' =>
      array (
        0 => 'mail.example.com',
        1 => 143,
        2 => 'tls',
        3 => '',
        4 => true,
        5 => false,
      ),
    ),
  ),
  'theme' => '',
  'updater.release.channel' => 'stable',
  'mail_smtpsecure' => 'tls',
);

The output of your Apache/nginx/system log in /var/log/____:

I see no errors in there

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":"OZMnm09VKU4PfVXXANfn","level":3,"time":"2023-01-14T21:53:23+00:00","remoteAddr":"xxx.xxx.xxx.xxx","user":"admin","app":"no app in context","method":"DELETE","url":"/ocs/v2.php/cloud/users/username","message":"Argument 1 passed to OCA\\Files_Reader\\Hooks::OCA\\Files_Reader\\{closure}() must be an instance of OCA\\Files_Reader\\Node, instance of OC\\Files\\Node\\File given in file '/var/www/cloud/apps/files_reader/lib/Hooks.php' line 18","userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:108.0) Gecko/20100101 Firefox/108.0","version":"24.0.8.2","exception":{"Exception":"Exception","Message":"Argument 1 passed to OCA\\Files_Reader\\Hooks::OCA\\Files_Reader\\{closure}() must be an instance of OCA\\Files_Reader\\Node, instance of OC\\Files\\Node\\File given in file '/var/www/cloud/apps/files_reader/lib/Hooks.php' line 18","Code":0,"Trace":[{"file":"/var/www/cloud/lib/private/AppFramework/App.php","line":172,"function":"dispatch","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->"},{"file":"/var/www/cloud/lib/private/Route/Router.php","line":298,"function":"main","class":"OC\\AppFramework\\App","type":"::"},{"file":"/var/www/cloud/ocs/v1.php","line":62,"function":"match","class":"OC\\Route\\Router","type":"->"},{"file":"/var/www/cloud/ocs/v2.php","line":23,"args":["/var/www/cloud/ocs/v1.php"],"function":"require_once"}],"File":"/var/www/cloud/lib/private/AppFramework/Http/Dispatcher.php","Line":165,"Previous":{"Exception":"TypeError","Message":"Argument 1 passed to OCA\\Files_Reader\\Hooks::OCA\\Files_Reader\\{closure}() must be an instance of OCA\\Files_Reader\\Node, instance of OC\\Files\\Node\\File given","Code":0,"Trace":[{"function":"OCA\\Files_Reader\\{closure}","class":"OCA\\Files_Reader\\Hooks","type":"::","args":["*** sensitive parameters replaced ***"]},{"file":"/var/www/cloud/lib/private/Hooks/EmitterTrait.php","line":106,"function":"call_user_func_array"},{"file":"/var/www/cloud/lib/private/Hooks/PublicEmitter.php","line":40,"function":"emit","class":"OC\\Hooks\\BasicEmitter","type":"->"},{"file":"/var/www/cloud/lib/private/Files/Node/Root.php","line":143,"function":"emit","class":"OC\\Hooks\\PublicEmitter","type":"->"},{"file":"/var/www/cloud/lib/private/Files/Node/Node.php","line":117,"function":"emit","class":"OC\\Files\\Node\\Root","type":"->"},{"file":"/var/www/cloud/lib/private/Files/Node/File.php","line":129,"function":"sendHooks","class":"OC\\Files\\Node\\Node","type":"->"},{"file":"/var/www/cloud/lib/private/Files/SimpleFS/SimpleFile.php","line":149,"function":"delete","class":"OC\\Files\\Node\\File","type":"->"},{"file":"/var/www/cloud/lib/private/Avatar/UserAvatar.php","line":212,"function":"delete","class":"OC\\Files\\SimpleFS\\SimpleFile","type":"->"},{"file":"/var/www/cloud/lib/private/Server.php","line":1487,"function":"remove","class":"OC\\Avatar\\UserAvatar","type":"->"},{"file":"/var/www/cloud/3rdparty/symfony/event-dispatcher/EventDispatcher.php","line":264,"function":"OC\\{closure}","class":"OC\\Server","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/var/www/cloud/3rdparty/symfony/event-dispatcher/EventDispatcher.php","line":239,"function":"doDispatch","class":"Symfony\\Component\\EventDispatcher\\EventDispatcher","type":"->"},{"file":"/var/www/cloud/3rdparty/symfony/event-dispatcher/EventDispatcher.php","line":73,"function":"callListeners","class":"Symfony\\Component\\EventDispatcher\\EventDispatcher","type":"->"},{"file":"/var/www/cloud/lib/private/EventDispatcher/SymfonyAdapter.php","line":122,"function":"dispatch","class":"Symfony\\Component\\EventDispatcher\\EventDispatcher","type":"->"},{"file":"/var/www/cloud/lib/private/User/User.php","line":256,"function":"dispatch","class":"OC\\EventDispatcher\\SymfonyAdapter","type":"->"},{"file":"/var/www/cloud/apps/provisioning_api/lib/Controller/UsersController.php","line":1080,"function":"delete","class":"OC\\User\\User","type":"->"},{"file":"/var/www/cloud/lib/private/AppFramework/Http/Dispatcher.php","line":225,"function":"deleteUser","class":"OCA\\Provisioning_API\\Controller\\UsersController","type":"->"},{"file":"/var/www/cloud/lib/private/AppFramework/Http/Dispatcher.php","line":133,"function":"executeController","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->"},{"file":"/var/www/cloud/lib/private/AppFramework/App.php","line":172,"function":"dispatch","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->"},{"file":"/var/www/cloud/lib/private/Route/Router.php","line":298,"function":"main","class":"OC\\AppFramework\\App","type":"::"},{"file":"/var/www/cloud/ocs/v1.php","line":62,"function":"match","class":"OC\\Route\\Router","type":"->"},{"file":"/var/www/cloud/ocs/v2.php","line":23,"args":["/var/www/cloud/ocs/v1.php"],"function":"require_once"}],"File":"/var/www/cloud/apps/files_reader/lib/Hooks.php","Line":18},"CustomMessage":"--"}}

I would suggest the old reliable - reboot