File is locked - how to unlock

Hi amo13

I had the same Problems a few times. But I could always fix it with this procedure (retain the order!):

  • occ ‘files:scan --all’
  • occ ‘files:cleanup’
  • occ ‘maintenance:mode --on’
  • mysql -u root -p’inheregoesyourpassword’ -D ocdb -e ‘delete from oc_file_locks where 1’
  • occ ‘maintenance:mode --off’
  • restart your Nextcloud webserver and try again -> the files in your web-ui should be gone.

Good Luck, Cheers zisuu

4 Likes