Page 1 of 1

Restoring _FAILED_ downloads

Posted: June 21st, 2011, 5:07 pm
by Tobai
I noticed the change in keeping failed downloads in Incomplete with the recent 0.6.

Post: http://forums.sabnzbd.org/index.php?topic=6935.0

Someone else asked this question afterwards and it was solved for them.  That would not work with me.

I'm asking the same question if it's possible to continue moving _FAILED_ to their respective directories.  I have a lot of categories which sabnzbd pushes the files out to the right places.  99% of my downloads are good.  Still sabnzbd is moving massive amount of data everyday.  Which even with 99% success, I'll get a dozen or so _FAILED_ a day.  When it was moved, everything was organized and I can just easily re-add the ones that failed manually or fix up from elsewhere.  Now I just have a huge directory of directories, which are mixed with legit incomplete (as in sabnzbd is still downloading them) and failed ones.

Before, I can easily check each category (as some are much higher priority for me) and decide if it's worth me completing or not.  Now everything is mixed up in incomplete.  I never had to look in Incomplete before either.  Now I have to check there or through the web interface to see what's actually downloaded and failed.  After my initial setup, I have limited access to sabnzbd interface to actually check.  Which is good.  Shows just how well sabnzbd is as I've been running it hands off for months without as much as even needing to bring the browser up.

I'm pulling almost 400GB of data down every day.  Over 10TB/month easy.  You can see how even a 99% success rate will still result in alot of incompletes.  Can moving/keeping the _FAILED_ be a user option?  Or moving them another folder if not /Completed so I can keep my sorted categories clean?  The actual download has been completed even if the archive doesn't work.  There are other minor reasons I would prefer it the old way(preferred) or a separate failed directory.

I'm hoping I make sense.
Thanks

Re: Restoring _FAILED_ downloads

Posted: June 22nd, 2011, 2:35 am
by shypike
I don't quite understand what the problem is.
From the history view you see what is failed, you can even filter for failed items.
If you want to discard the job (including downloaded file), you can from the history view.
From the History view you can also repair, optionally with a larger NZB (containing extra par2 files).

Re: Restoring _FAILED_ downloads

Posted: June 25th, 2011, 11:30 am
by Tobai
Because it's now an extra manual step for me to fix things.  Even moreso since I have to look at the history to see which directory the failed downloads needs to go into instead of just browsing the directory structure.

Is it possible to put a post-dl processing script in that will move failed directories to the correct /Completed directory?  So the end result is basically the old way of doing things with _FAILED_ in the correct /Completed/Subdirs even if the process is different from before.

Re: Restoring _FAILED_ downloads

Posted: June 25th, 2011, 3:07 pm
by pobox
You might be able to tweak your setup to avoid even a 1% failure rate.  To  do that you'd have to know exactly why they fail.

Re: Restoring _FAILED_ downloads

Posted: June 26th, 2011, 2:12 am
by shypike
Tobai wrote: Is it possible to put a post-dl processing script in that will move failed directories to the correct /Completed directory?
It's always possible, but quite difficult.
I'll see if there's some small tweak possible for a later release.

Re: Restoring _FAILED_ downloads

Posted: June 27th, 2011, 10:28 am
by Tobai
It currently _UNPACKS_ in the completed directory, how about just being able to 'turn off' the moved back if failed part?  There are still some scenarios that let _FAILED_ directories into the completed directory.  Not sure when/how.  Looks maybe an empty/par2 only nzb will get moved to completed (as pre-0.6 version) instead of moving the failed backed to /Incomplete.

Re: Restoring _FAILED_ downloads

Posted: June 27th, 2011, 12:29 pm
by shypike
Nothing is "moved back", it used to be "moved forward",
which isn't altogether useful.
If an unpack action fails (CRC error, disk full) then an unfinished __failed__ folder is left in complete.
It's up to the user to remove that, because it might still be useful.
The original downloaded files are kept in incomplete until the post-processing succeeds
so that you can still retry optionally adding an NZB with more par2 files.

Re: Restoring _FAILED_ downloads

Posted: June 29th, 2011, 11:22 am
by Tobai
Is there a place I can put a force move in postproc.py like:

if not all_ok:
    renamer(workdir_complete, prefix(complete_dir, '_FAILED_'))

workdir_complete is the location of the incomplete directory and complete_dir is the final destination if that looks right.  I know it's not clean and it doesn't really matter to me.  I just want to move failed downloads out of the /Incomplete directories to the right locations.  Or a seperate /Failed directory would be ok as well.  It doesn't matter if the history/queue doesn't match up.  Nobody logs into the web front end where I am.  It's actually quite a hassle for me to log in via the web side.  Queues are all added via a bunch of machines  on another server that sabnzb has mounted and reads.  Incompletes/working directories are all on the local machine.  And when a file is finished (good or bad) files and directories are automatically pushed off the local machine to another SAN.

I understand the web has nice and convenient options for people wanting to add pars or re-queue a job.  And it should be great for most people.  I'm just looking for a temporary quick fix.  A real solution or ideally a user option would require testing.

Re: Restoring _FAILED_ downloads

Posted: June 29th, 2011, 1:32 pm
by shypike
You still won't have the raw files, just the indication that something went wrong.

Re: Restoring _FAILED_ downloads

Posted: July 15th, 2011, 7:02 pm
by Tobai
shypike wrote:
Tobai wrote: Is it possible to put a post-dl processing script in that will move failed directories to the correct /Completed directory?
It's always possible, but quite difficult.
I'll see if there's some small tweak possible for a later release.
Is there any work around or progress on this or a script somewhere yet?

Re: Restoring _FAILED_ downloads

Posted: July 17th, 2011, 5:46 am
by shypike
Perhaps your problem is solved by setting the option Config->Switches->"Post-Process Only Verified Jobs" to "off".
This will make SABnzbd continue post-processing, with unrar likely to fail.
You'll end up with partially unpacked files and all the raw rar and par2 files in the "complete" folder.
The job will be listed as "completed" but will show an error message.
With a simple post processing script you can rename the failed folder.
(Because SABnzbd tells the script that par2 verification has failed.)

Code: Select all

@echo off
if %7 == 0 goto end
cd /d %1
cd ..
set name=%3
set name=%name:"=%
ren "%name%"  "__FAILED__%name%"
:end

Re: Restoring _FAILED_ downloads

Posted: July 18th, 2011, 9:56 am
by Tobai
shypike wrote:Perhaps your problem is solved by setting the option Config->Switches->"Post-Process Only Verified Jobs" to "off".
This will make SABnzbd continue post-processing, with unrar likely to fail.
You'll end up with partially unpacked files and all the raw rar and par2 files in the "complete" folder.
The job will be listed as "completed" but will show an error message.
With a simple post processing script you can rename the failed folder.
(Because SABnzbd tells the script that par2 verification has failed.)

Code: Select all

@echo off
if %7 == 0 goto end
cd /d %1
cd ..
set name=%3
set name=%name:"=%
ren "%name%"  "__FAILED__%name%"
:end
That would be fine. As long as the (failed) files are in the correct places, it'll be fixed elsewhere.

Would this work under ubuntu/linux?

Code: Select all

#!/bin/bash

set +v
if [ "$7" == "0" ]
then
    exit
fi

cd $1
cd ..

name=$3
mv "$name" "_FAILED_$name"
I'm not sure what 'set name=%name:"=%' is doing tho.

Re: Restoring _FAILED_ downloads

Posted: July 18th, 2011, 10:28 am
by shypike
Tobai wrote:I'm not sure what 'set name=%name:"=%' is doing tho.
It strips surrounding quotes, not needed on Unix.
I'd say test the script separately, I'm not very fluent shell scriptese.
You might want to use:
cd "$1"
to support spaces in the path.

Re: Restoring _FAILED_ downloads

Posted: July 19th, 2011, 10:08 am
by Tobai
Thanks. Things are working like they were before now. All files are moved to Completed. Failed downloads are located in the same directories with the prefix.

Now my usual scripts can re-scrape just the failed ones, fix and re-queue them automatically from other sources without any problems. I'm just manually clearing out the current huge backlog of previously failed files in Incomplete before this was put in place. Since it's only a one-time thing, I can live with it.