Unable to delete Files/Folders

I’m having an issue on my NextCloud, version 9.0.52 (stable).

I have some folders and files that are on the NextCloud, but have been deleted from the folder on my computer. Because I don’t want them anymore. Yet every time it syncs, the client puts the dang things right back on my computer, which is really messing up my work flow, having to constantly sort folders that I’ve already deleted or moved into the actual folder where they go.

When I go to remove them from the NextCloud, so they aren’t constantly re-syncing back to the computer, I get an error.

So two questions, really.

How can I get rid of these folders/files that won’t let me delete them?

And,

Is there a way to make it delete folders that are on the NextCloud that are NOT in the synchronized folder?

1 Like

Your log may tell you why it’s erroring when deleting, but I’d first look at permissions. Your data dir should be owned by the web user (www-data in Ubuntu).

I had my host set everything up, as I was afraid of making mistakes. At this point I’m not sure if I have access to the directory, I can request it though, probably.

The log file says what’s below. However, I have no clue how to unlock files that have been locked somehow. ----

Exception: {"Message":"HTTP\/1.1 423 \"Work\/Liliom Press\/Tutorials\" is locked","Exception":"OCA\\DAV\\Connector\\Sabre\\Exception\\FileLocked","Code":0,"Trace":"#0 \/home\/mandiand\/web\/WEBADDRESS\/public_html\/3rdparty\/sabre\/dav\/lib\/DAV\/Tree.php(179): OCA\\DAV\\Connector\\Sabre\\Directory->delete()\n#1 \/home\/mandiand\/web\/WEBADDRESS\/public_html\/3rdparty\/sabre\/dav\/lib\/DAV\/CorePlugin.php(285): Sabre\\DAV\\Tree->delete('Work\/Liliom Pre...')\n#2 [internal function]: Sabre\\DAV\\CorePlugin->httpDelete(Object(Sabre\\HTTP\\Request), Object(Sabre\\HTTP\\Response))\n#3 \/home\/mandiand\/web\/WEBADDRESS\/public_html\/3rdparty\/sabre\/event\/lib\/EventEmitterTrait.php(105): call_user_func_array(Array, Array)\n#4 \/home\/mandiand\/web\/WEBADDRESS\/public_html\/3rdparty\/sabre\/dav\/lib\/DAV\/Server.php(459): Sabre\\Event\\EventEmitter->emit('method:DELETE', Array)\n#5 \/home\/mandiand\/web\/WEBADDRESS\/public_html\/3rdparty\/sabre\/dav\/lib\/DAV\/Server.php(248): Sabre\\DAV\\Server->invokeMethod(Object(Sabre\\HTTP\\Request), Object(Sabre\\HTTP\\Response))\n#6 \/home\/mandiand\/web\/WEBADDRESS\/public_html\/apps\/dav\/appinfo\/v1\/webdav.php(55): Sabre\\DAV\\Server->exec()\n#7 \/home\/mandiand\/web\/WEBADDRESS\/public_html\/remote.php(138): require_once('\/home\/mandiand\/...')\n#8 {main}","File":"\/home\/mandiand\/web\/WEBADDRESS\/public_html\/apps\/dav\/lib\/connector\/sabre\/directory.php","Line":279,"User":"mandi"}

I would do the following:

  1. Check permissions
  2. do sudo -u www-data php occ files:scan --all

There maybe multiple reasons why it doesn’t let you delete the files

To solve the locking problem:

2 Likes

I sent this page to my host, and he went and cleared the locked files from the table, it’s working now. Thank you!

they fix it for me too, but i cant delete the files before fixing!

how to clear locked files?

Hello, I installed nextcloud as it comes when installing the ubuntu server, and it does not allow me to access my mysql, every time I try to access it it indicates “Command ‘mysql’ not found”
Is there any way to run DELETE FROM oc_file_locks WHERE 1 without entering mysql or how should I enter?