Cant Delete Files or Folders anymore

NextCloud 11
Ubuntu 16.04 Server
SSL
HTTPS
Strict HTTPS
Strong Permissions Set
Login with SSH Key only set
REDIS MEMCACHE installed
No new apps
No recent changes

Hello.

All of the sudden I cant delete folders or files through the nextcloud website. The only way to delete the files is if I rmdir or rm -R in ssh.

I am not sure but this seems to have started after I tried to use the nextcloud desktop app… which didnt work well and just kept getting disconnected. I didnt get to upload much using that.

Also its not just the files or folders that I uploaded with the nextcloud desktop app.

This is in the nextcloud admin logs

OCA\DAV\Connector\Sabre\Exception\FileLocked: HTTP/1.1 423 "Pictures" is locked
/var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Tree.php - line 179: OCA\DAV\Connector\Sabre\Directory->delete()
/var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/CorePlugin.php - line 287: Sabre\DAV\Tree->delete('Pictures')
[internal function] Sabre\DAV\CorePlugin->httpDelete(Object(Sabre\HTTP\Request), Object(Sabre\HTTP\Response))
/var/www/nextcloud/3rdparty/sabre/event/lib/EventEmitterTrait.php - line 105: call_user_func_array(Array, Array)
/var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php - line 479: Sabre\Event\EventEmitter->emit('method DELETE', Array)
/var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php - line 254: Sabre\DAV\Server->invokeMethod(Object(Sabre\HTTP\Request), Object(Sabre\HTTP\Response))
/var/www/nextcloud/apps/dav/appinfo/v1/webdav.php - line 60: Sabre\DAV\Server->exec()
/var/www/nextcloud/remote.php - line 165: require_once('/var/www/nextcl...')
{main}

another one is:

Fatal webdav OCA\DAV\Connector\Sabre\Exception\FileLocked: HTTP/1.1 423 “kes/sterd” is locked

/var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Tree.php - line 179: OCA\DAV\Connector\Sabre\File->delete()
/var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/CorePlugin.php - line 287: Sabre\DAV\Tree->delete('kes/sterda...')
[internal function] Sabre\DAV\CorePlugin->httpDelete(Object(Sabre\HTTP\Request), Object(Sabre\HTTP\Response))
/var/www/nextcloud/3rdparty/sabre/event/lib/EventEmitterTrait.php - line 105: call_user_func_array(Array, Array)
/var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php - line 479: Sabre\Event\EventEmitter->emit('method DELETE', Array)
/var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php - line 254: Sabre\DAV\Server->invokeMethod(Object(Sabre\HTTP\Request), Object(Sabre\HTTP\Response))
/var/www/nextcloud/apps/dav/appinfo/v1/webdav.php - line 60: Sabre\DAV\Server->exec()
/var/www/nextcloud/remote.php - line 165: require_once('/var/www/nextcl...')
{main}

My Permissions for the data directory are

drwxr-x— 9 www-data www-data

also when I run

sudo -u www-data php occ files:scan --all

I get this

Scanning files for 5 users
Starting scan for user 1 out of 5 ()
Starting scan for user 2 out of 5 ()
Starting scan for user 3 out of 5 ()
Starting scan for user 4 out of 5 ()
Starting scan for user 5 out of 5 ()

±--------±------±-------------+
| Folders | Files | Elapsed time |
±--------±------±-------------+
| 902 | 9341 | 00:00:54 |
±--------±------±-------------+

I just checked the permissions. They are as posted above.
I went ahead and set strong permissions again.
rebooted the system.

I do not know why this started to happen or what I can do to resolve this.

The other one thread on here was no help …thats the one I got the sudo -u www-data php oc files:scan -all From.

Any help on this I would appreciate it … thank you!!

Did you restart redis and apache? Are you sure that is no shared filed another user still has opened in his interface?

ya i did service redis restart and service apache2 restart

I even rebooted the system a few times too.

its weird … it seems to be about half of the files/folders. Old and new. I dont see any common deal. Not just folders … not just empty folders. No one else has logged into it for a bit. I only have one shared folder on there and thats the main one … that I have not tried to delete as its pretty big

Flushed redis? Are you using nextant?

Checked this?

He’s already using redis, but also as file-locking cache?

Yeah, just saw redis and assumed that this is for file locking…

For 99% this is correct, here it’s probably the other 1% :slight_smile:

I do have Nextant enabled.

@tflidd Honestly about the redis and the file-locking cache I am not sure … I am assuming that might be on the config.php. I would have to look …

Edit

alright this is what I have in the config

'memcache.local' => '\\OC\\Memcache\\APCu', 'memcache.locking' => '\\OC\\Memcache\\Redis', 'filelocking.enabled' => 'true', 'redis' => array ( 'host' => '/var/run/redis/redis.sock', 'port' => 0, 'timeout' => 0.0,

So you are using redis for file locking. My guess is that it is nextants fault. For me it helped to change live index to database instead of semaphore. There are some issues on the nextant github that are file locking related. I don’t know if they have the same cause though.

Regarding how to resolve your current issue I am not sure since I ended up recreating my database. Several times.

The safe things to do are flushing redis and cleaning all kinds of caches and files:scan plus whatever you find in threads and issues that are related to file locking.

well last night I disabled nextant, waited a bit … then restarted everything.

Seems like I can now delete stuff and also I was able to use the nextcloud desktop client from start to finish as I wasnt able to do before.

its interesting but it seems that nextant was the issue?

Yep, thats possible. As I mentioned before, try to change live index to database.