Unable to move or delete files and folders in Nextcloud

When trying to move or delete files or folders an error appears from the web interface: ‘Could not move / delete “photo.jpg”.  The same problem appears when using WebDAV.

This issue appears when files are being locked in the database and can be unlocked following the steps below.

  • If needed put Nextcloud in maintenance mode, edit the config.php file:
    'maintenance' => true,
  • Access the Nextcloud database to empty the oc_file_locks, run the following command:
    MariaDB [database]>DELETE FROM oc_file_locks WHERE 1;
  • Set back the maintenance mode to false.

Tested on Nextcloud v19.

Sources:
https://help.nextcloud.com/t/file-is-locked-how-to-unlock/1883

Leave a Comment

Your email address will not be published. Required fields are marked *