Unable to remove deleted files with strange characters

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:


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


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): 27.1.3
Operating system and version (eg, Ubuntu 20.04): Centos v7
Apache or nginx version (eg, Apache 2.4.25): nginx 1.20.1
PHP version (eg, 7.4): 8.1.24

The issue you are facing: unable to remove files from trash that contain unusual character sequence.

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

Steps to replicate it:

  1. Open deleted files
  2. Try and remove the files

I’ve found the files in the file system and removed them but they still appear in the Nextcloud web interface. I’ve tried occ file:scan and occ groupfolder:scan but no difference.

I only spotted occ files:delete after doing the above. Do these scan operations work on trash and revisions?

Did I understand that correctly: You deleted the file at file system level, so the file is no longer on the hard drive?

Your screenshot shows the trashbin folder. If those files do not exists, those are zombie entries.
Those zombie entries normaly disapear as soon as you do a “Restore”. Only an error message in logfile “unable to rename, file does not exists … (path/to/trashbin/filename)” appears but it restores the file-entry in the webview. After it is restored, it is easy to remove that entry (without underlying file in the filesystem) by runing
occ files:scan <user_id>
occ groupfolders:scan <groupfolder_id>


it must be
occ files:scan
occ groupfolders:scan
(you missed the “s” before the colon)

If my suggestion doesn’t help, then the file should perhaps be renamed.

  • &#039;

is the html entity of a single apostrophe: (')

Is it possible that the file did not get into the file system via the web frontend but was added directly at the file system level? Then it’s possible that it wasn’t properly UTF8 encoded. Or there was an encoding problem with the name on the client that added it?

I hope you get it solved, if not, don’t hesitate to come back here.

Much luck,