File is locked - how to unlock



You can’t access files because they are locked and you find such errors in your logfile:

{"reqId":"0DijSqEkfOg2iyh9VD8J","remoteAddr":"xx.xx.xx.xx","app":"webdav","message":"Exception: {\"Message\":\"HTTP\\\/1.1 423 \\\"path\\\/file.extension\\\" is locked\",\"Exception\":\"OCA\\\\DAV\\\\Connector\\\\Sabre\\\\Exception\\\\FileLocked\",\"Code\":0,\"Trace\":\"#0

If you’re running the ownCloud 8.2.x branch make sure that you’re using at least 8.2.2 (previous versions had a bug causing this issue).

Manually disable locking state:

  • put ownCloud in maintenance mode: edit config/config.php and change this line:
    'maintenance' => true,
  • Empty table oc_file_locks: Use tools such as phpmyadmin or connect directly to your database and run:
    DELETE FROM oc_file_locks WHERE 1
  • disable maintenance mode (undo first step).

Automatically reset locking state:
Normally ownCloud should reset the locked state on its own via background jobs. So make sure your cron-jobs run properly (you admin page tells you when cron ran the last time):

Permanent solution (if it happens regularly)

Fehler - File ist locked - kein Sync
Can't delete files
Problems to upload 2 GB+ files
My files aren't syncing the way I would expect. How should I troubleshoot?
After upgrade to error when syncing big fil
[Résolu] Server replied: locked
File Locked / Datei kann nicht gelöscht werden
Benutzer kann geteielte Datei nicht löschen
Owncloud newbie needs help desperatly
Login impossible after downgrade to 8.2
Trouble Syncing Files
Could not move folder
Popup keeps informing me on error
Locked File in Owncloud version 10
Locked File in Owncloud version 10
Owncloud Sync error lock-unlock files
ownCloud ignore my MP4 and .rar files on sync
[Terminé] Erreur à la Suppression du fichier
Issues deleting my folders and files on an encrypted profile (OC10.x)
Lock files issues - 65K entries in table oc_file_locks
Cannot files:scan a user
Error uploading files larger than 40gb
File Locked, how to reset using docker
Errors when running sudo -u www-data php occ files:scan --all --repair
After update to 9.1.2 some files have a yellow exclamation mark
Error deleting last empty folder
Too many files on /data compared to local drive
OwnCloud - Error log
Shared folders are not sync with the Desktop Client
Owncloud & Docker : Unable to run CLI correctly
After update to 9.1.2 some files have a yellow exclamation mark
Problem restoring files
Mailbird on ownCloud
Can not delete one file!?
closed #2