3

I've setup transmission and sickrage to automattically download series. This went well, however when Sickrage tries to move the files, it gets stuck and the logs say: 2016-07-25 16:10:13 POSTPROCESSER :: Processing failed for /mnt/usbstorage/downloads/complete/***.mkv: File is locked for reading/writing

I've checked all permissions of files and folders and I cant get my head around the problem. Also I've currently set Transmission to stop the torrent after it completes. Did I overlook something? I'm running Raspbian Jessie

Permissions of all files and folders:

drwxr-xr-x   3 root                root      4096       mrt  8 10:02 /mnt
drwxr-xr-x   7 root                root      4096       jul 21 23:40 /mnt/usbstorage

drwxrwxr-x   4 root                downloads 4096       jul 21 23:00 /mnt/usbstorage/downloads
drwxrwsr-x  34 root                downloads 4096       jul 25 13:07 /mnt/usbstorage/downloads/complete
-rwxr-xr-x   1 debian-transmission downloads 2104212313 jul 25 13:07 /mnt/usbstorage/downloads/complete/***.mkv

drwxrwxr-x   8 root                downloads 4096       jul 25 11:32 /mnt/usbstorage/series
drwxrwxr-x   4 sickrage            sickrage  4096       jul 23 06:52 /mnt/usbstorage/series/***

Users of downloads:

$ grep downloads /etc/group
downloads:x:120:debian-transmission,sickrage
  • 3
    File locking probably doesn't (because it shouldn't) refer to file permissions. More likely, it is about a system of voluntary locking (see man flock for a hint) sometimes used by multi-process applications for synchronization (e.g., so they don't end up trying to read meaningful information from a file while that information is being changed). Notice it says locked for reading/writing, i.e., this file is not available to read or write, which is what you would want to do if you were writing to it, until you were finished. It looks like that synchronization is flawed in this case... – goldilocks Jul 25 '16 at 15:08
  • 1
    Sounds like standard torrent client behaviour. When the file's completed it's normally acting as a seed for other users (i.e. being read from), hence the file is locked/can't be moved. I haven't touched Transmission before, but you're likely to need to remove it from the torrent queue before moving the file. – goobering Jul 25 '16 at 15:52
  • 1
    This looks relevant: gist.github.com/bulljit/791609 . Interestingly, they're moving the files first using transmission-remote's '-move' flag, and then removing them from the torrent queue using the '-remove' flag. – goobering Jul 25 '16 at 16:01
  • 1
    Thanks for all comments! I've read into flock and lsof. However when I run $ sudo lsof | grep downloads I do not see the files that sickrage is complaining about. The script from @goobering did not help either unfortunately. – Victor Jul 26 '16 at 10:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.