Page 1 of 1

Error Renaming (Sab & SB on different machines)

Posted: February 15th, 2017, 9:00 am
by Jeimuzu88
I'm running sabnzbd on a windows machine and sickbeard et al on a raspberry pi. This is set up in such a way that the temporary download folder is local to the windows machine with the completed directory being on a shared network location on the RPi. This has been working flawlessly until updating to 1.2.0.

Now I get the following error in Sab:

Code: Select all

2017-02-15 06:16:07,984::DEBUG::[misc:1282] Renaming "\\?\UNC\x.x.x.x\path\to\dir\_UNPACK_Marvels Agents of S H I E L D S04E14 720p HDTV X264-DIMENSION" to "\\?\UNC\x.x.x.x\path\to\dir\Marvels Agents of S H I E L D S04E14 720p HDTV X264-DIMENSION"
2017-02-15 06:26:20,786::ERROR::[postproc:436] Error renaming "\\x.x.x.x\path\to\dir\_UNPACK_Marvels Agents of S H I E L D S04E14 720p HDTV X264-DIMENSION" to "\\x.x.x.x\path\to\dir\Marvels Agents of S H I E L D S04E14 720p HDTV X264-DIMENSION"
I have the TV download directory in SB set up so that it will scan a process every 10 minutes (default), and it correctly skips any _UNPACK_ directories as expected:

Code: Select all

2017-02-15 06:13:12 DEBUG    POSTPROCESSER :: Processing folder: /path/to/dir/_UNPACK_Marvels Agents of S H I E L D S04E14 720p HDTV X264-DIMENSION
2017-02-15 06:13:12 DEBUG    POSTPROCESSER :: The directory name indicates that this release is in the process of being unpacked, skipping
What I can see, is that eventually SB will carry out a post process scan during the move:

Code: Select all

2017-02-15 06:23:10 DEBUG    POSTPROCESSER :: Recursively processing a folder: /path/to/dir/Marvels Agents of S H I E L D S04E14 720p HDTV X264-DIMENSION
2017-02-15 06:23:10 DEBUG    POSTPROCESSER :: Processing folder: /path/to/dir/Marvels Agents of S H I E L D S04E14 720p HDTV X264-DIMENSION
...
...
Obviously this is down to a timing issue, but why is SAB now taking so long to carry out a simple rename? The only thing I can think of is that now, for whatever reason, it's no longer carrying out a simple rename, but a move (from Pi -> Windows -> Pi).

I have since extended the time between post process scans, but will still occasionally hit this issue.

Re: Error Renaming (Sab & SB on different machines)

Posted: February 15th, 2017, 9:50 am
by safihre
If SB accesses the file exactly when SAB is trying to rename it, Windows will not allow a rename and Python/SAB chooses the hard way of just copying.
In 1.2.1 we will put a workaround to wait 3 seconds and then try again a simple rename, before doing the last-resort copy.