Can't delete a directory

In the past i tried to rename a directory in my NextCloud. It was “12 SayIT PR” and a tried to rename it to “15 SayIT PR”. After that I had two directories. The new one (with my files) and a old one (only directories without files). But: I cannot delete the old one in the client and i cannot delete it in the web surface. I always get error messages (sync error in the client). In the web interface the error mesage is only “Fehler beim Löschen der Datei “12 SayIT PR”” (translated: "Error occured while deleting file “12 SayIT PR”).

renaming the directory fails also. Any idea, ho to delete this empty directory?

Access the server using a console account, navigate to the directory and delete it.

j-ed, thanks for the answer, but this cannot be the only answer when you have to delete 100s of directories and 10000’s of files, or is it?
On my environment I have serious difficulties handling deletions with the clients:

  • retention app does not work : the files are uploaded again by the client
  • deleting the file on the client OS does not work: the client downloads the deleted files again from the server, even if replication has not been interrupted.
    thanks, hubert j.

@David_Goehler hasn’t mentioned that hundreds of directories need to be deleted, he mentioned only one directory, so I assumed that he hasn’t any problems with other folders.

Additionally I would recommend to solve one problem after the other instead of mixing-up several things unter one subject.

So in a first step you should focus on how to fix the deletion of directories using the web GUI. If this works, you should focus on the sync problem with the Nextcloud client.

  • Are there any error messages in the Nextcloud log file or the web server log file covering the problem?
  • Have you checked the file system access rights and the ownership of the directories which are causing problems?

Ok, thanks for your help so far. I use a hoster, where I cannot open a console. NextCloud is an App which I can install using the hoster GUI (same for updates).

What I found out in the meantime is, that the directory is locked (“error 423”). Do you see a chance to unlock it using the GUI?

As far as I know it is not possible to unlock a file from the GUI. You can try to install the OCC Web app which should give you console access so that you can execute the occ comand line tool and execute other commands on the console.

2 days ago Nexcloud blocked me out: I can’t access NextCloud anymore - not via client and not via web browser. My access was outside the “trusted domains”. What the hell …

This was the point to leave this “solution” for sharing files and dates. Too many issues, too few advantages.

Thank for your help! But now I’m back on iCloud und Dropbox. These solutions work without interruption every day and night.


I had a similar issue recently on mine where three files could not be deleted. The problem ended up being that they were owned by root. No idea how that happened but changing them back to www-data resolved it. Make sure your data folder and contents are owned by the web user.