Page 1 of 1

[0.7.0B3]Error renaming

Posted: April 25th, 2012, 9:39 am
by Taomyn
Since upgrading to 0.7.0B3 I've been seeing a lot of "Error renaming" warnings in my log, some examples from the log look like this:

Code: Select all

2012-04-23 19:24:22,209::ERROR::[postproc:389] Error renaming "\\marge\Multimedia\Video\TV\Game of Thrones\_UNPACK_Game of Thrones - 2x04 - Garden of Bones" to "\\marge\Multimedia\Video\TV\Game of Thrones\Game of Thrones - 2x04 - Garden of Bones"

2012-04-24 07:21:38,309::ERROR::[postproc:389] Error renaming "\\marge\Multimedia\Video\TV\Eureka\_UNPACK_Eureka - 5x02 - The Real Thing" to "\\marge\Multimedia\Video\TV\Eureka\Eureka - 5x02 - The Real Thing"

2012-04-24 07:27:46,084::ERROR::[postproc:389] Error renaming "\\marge\Multimedia\Video\TV\Bones\_UNPACK_Bones - 7x10 - The Warrior in the Wuss" to "\\marge\Multimedia\Video\TV\Bones\Bones - 7x10 - The Warrior in the Wuss"

It's almost like the folder may be in use so it can't proceed, but nothing on the remote server is using them as far as I can tell. Anyone else seeing these?

Version: 0.7.0B3
OS: Windows Server 2008 R2 SP1
Install-type: Windows Installer
Skin (if applicable): Plush
Firewall Software: None
Are you using IPV6? No
Is the issue reproducible? No, sometimes all is ok

Re: [0.7.0B3]Error renaming

Posted: April 25th, 2012, 1:17 pm
by shypike
Known problem with Windows, which is completely anal regarding folder renames.
If Windows even suspects that some other process is looking at a folder, you cannot rename it.
Examples of other processes: Windows' own indexing and virus-scanners.
Work-around: Turn off he option "Enable folder rename" in Config->Switches.
Downside: you won't see that a folder is not ready yet or is failed (in the Explorer).

Re: [0.7.0B3]Error renaming

Posted: April 25th, 2012, 2:53 pm
by Taomyn
shypike wrote:Known problem with Windows, which is completely anal regarding folder renames.
If Windows even suspects that some other process is looking at a folder, you cannot rename it.
Examples of other processes: Windows' own indexing and virus-scanners.
Work-around: Turn off he option "Enable folder rename" in Config->Switches.
Downside: you won't see that a folder is not ready yet or is failed (in the Explorer).
Thanks, I'll give that a shot - strange that it's only started happening since going to 0.7

Re: [0.7.0B3]Error renaming

Posted: April 30th, 2012, 7:16 am
by Taomyn
I think I've found the issue - it might be my installation of TwonkyServer that just happens to be scanning whilst the _UNPACKED_ folder exists. If it's holding the main media file open then it will prevent the folder name being changed.

The only two ways I can think of to get around this is 1) place a file called .ignorethis or .nomedia into the folder then remove it after the folder is renamed, 2) find a away to get TwonkyServer to ignore folders with a prefix of "_UNPACKED_".

I don't think Twonky will be able to do 2) and I couldn't seem to get any kind of wildcard to work in it's .ini file, but I'm hoping it wouldn't take much to get SABnzbd to place a file into the folder. Any ideas how?

Re: [0.7.0B3]Error renaming

Posted: April 30th, 2012, 8:26 am
by shypike
Why not simply use the work-around and not rename folders?

Re: [0.7.0B3]Error renaming

Posted: April 30th, 2012, 8:54 am
by Taomyn
shypike wrote:Why not simply use the work-around and not rename folders?
I still am, but I'm thinking having a flag file like ".ignorethis" that remains only until the job is done might be useful in other circumstances not just Twonky - I notice sometimes with XBMC I would see items listed twice where it saw the _UNPACKED_ folder then the renamed one a little while later.

I'm fairly certain my original issue is with Twonky as it's the only major change I have made to that server, upgraded from v6 to v7, which I did at the same time as SABnzbd.

Re: [0.7.0B3]Error renaming

Posted: April 30th, 2012, 10:18 am
by shypike
Any standardization here? Is it ".ignore" or ".ignorethis"? (The latter one seems unlikely).
Is any of this documented?

Re: [0.7.0B3]Error renaming

Posted: April 30th, 2012, 10:35 am
by Taomyn
A good question. The lines in the Twonky .ini file currently are:

Code: Select all

# content folder will be ignored if it contains any files in this list
ignoredirwithfile=.nomedia,.ignorethis
So anyone can add more if needed, so if you find a "standard" then Twonky can hopefully handle it.

I don't know about ".ignorethis", but ".nomedia" is used by Android to prevent the media scanner including the folder and sub-folders where it's located - something I've had to create many a time when apps are poorly coded and I ended up with their cached icons in my Gallery >:(

Re: [0.7.0B3]Error renaming

Posted: April 30th, 2012, 3:15 pm
by shypike
It's a Twonky-exclusive, so I'm not inclined to add support for it.
Android has a spotty reputation regarding the .nomedia file.

In XBMC, you'd do it like this, in advancedsettings.xml:

Code: Select all

<video>
  <excludefromscan>
    <regexp>__unpack__</regexp>
    <regexp>__failed__</regexp>
  </excludefromscan>
  <excludetvshowsfromscan>
    <regexp>__unpack__</regexp>
    <regexp>__failed__</regexp>
  </excludetvshowsfromscan>
 </video>

Re: [0.7.0B3]Error renaming

Posted: May 2nd, 2012, 6:32 am
by Taomyn
shypike wrote:It's a Twonky-exclusive, so I'm not inclined to add support for it.
Android has a spotty reputation regarding the .nomedia file.

In XBMC, you'd do it like this, in advancedsettings.xml:

Code: Select all

<video>
  <excludefromscan>
    <regexp>__unpack__</regexp>
    <regexp>__failed__</regexp>
  </excludefromscan>
  <excludetvshowsfromscan>
    <regexp>__unpack__</regexp>
    <regexp>__failed__</regexp>
  </excludetvshowsfromscan>
 </video>
Thanks for the code, though it disappoints me to read your cavalier dismissal of the idea. It's not "Twonky-exclusive" by virtue that XBMC can support the function but is simply more sophisticated, and the problems with ".nomedia" in Android aren't with Android or the media scanner, but with the developers that forget to set the file - it's always worked for me when I add the file manually, then informed the dev to fix their app.

Re: [0.7.0B3]Error renaming

Posted: May 2nd, 2012, 11:46 am
by shypike
.nomedia would be an option.
The problem I have is that such features cater to specific features of other apps.
Where does it end?
Even for Twonky it doesn't look like a standard setting, you have to edit it setup files.
Possibly we could add a "special" option, specifying which "special" file should be
temporarily added to a folder in progress.

Re: [0.7.0B3]Error renaming

Posted: May 2nd, 2012, 3:30 pm
by Taomyn
Totally undersand where you're coming from - maybe I can pursuade Twonky devs to support wildcards. BTW aren't/weren't there special settings in SABnzbd as well ;)

When I first discovered that Twonky had this feature I thought I might be able to just script it in SABnzbd but there's little scope for doing this as far as I can see. Would be nice to be able to set up scripts to run at certain stages of a download to cater for things like this. That would be a far less specific but far more useful.

Re: [0.7.0B3]Error renaming

Posted: May 3rd, 2012, 3:46 am
by zoggy
feel free to fork sabnzbd and make the changes in your own fork.

Re: [0.7.0B3]Error renaming

Posted: May 3rd, 2012, 5:31 am
by shypike
I think I can add the .nomedia file without too much trouble.
Maybe I'll make it a "special" option for some flexibility.

Re: [0.7.0B3]Error renaming

Posted: May 3rd, 2012, 5:40 am
by Taomyn
shypike wrote:I think I can add the .nomedia file without too much trouble.
Maybe I'll make it a "special" option for some flexibility.
Cool thanks - if you need it tested do let me know, happy to help