Post Processing user script receives status 0=OK on failed download [Confirmed]

Report & discuss bugs found in SABnzbd
Forum rules
Help us help you:
  • Are you using the latest stable version of SABnzbd? Downloads page.
  • Tell us what system you run SABnzbd on.
  • Adhere to the forum rules.
  • Do you experience problems during downloading?
    Check your connection in Status and Interface settings window.
    Use Test Server in Config > Servers.
    We will probably ask you to do a test using only basic settings.
  • Do you experience problems during repair or unpacking?
    Enable +Debug logging in the Status and Interface settings window and share the relevant parts of the log here using [ code ] sections.
Post Reply
Incr.Badeend
Newbie
Newbie
Posts: 6
Joined: April 8th, 2010, 11:13 am

Post Processing user script receives status 0=OK on failed download [Confirmed]

Post by Incr.Badeend »

Hi there,

Well the title just about sums it up but here's the longer version..

Version: 0.5.1 RC2 (also had RC1, same problem)
OS: Mac OSX 10.6.3
Install-type: OSX app in DMG

I have a user script (shell script) for 'post processing', actually it in turn starts an Applescript and passes the arguments to that.

Code: Select all

#!/bin/sh
osascript /Users/chris/sabnzbd/SABnzbd.scpt "$3" "$7"
As you can see I'm using argument 3 and 7. These should be the clean name of the nzb file (3) and the status (7) of the download (0 = OK, 1, 2 and 3 are errors).

The applescript is used to send a notification to my iPhone, I use Prowl for this, which is a plugin for Growl.

This is the applescript:

Code: Select all

on run argv
	tell application "GrowlHelperApp"
		set strSuccess to "EPIC FAIL"
		if item 2 of argv = "0" then set strSuccess to "Success, Enjoy!"
		if item 2 of argv = "1" then set strSuccess to "INCOMPLETE, Sorry.."
		if item 2 of argv = "2" then set strSuccess to "EXTRACT ERROR - Password?"
		notify with name "Download complete" title "Completed download:" description item 1 of argv & "
Result: " & strSuccess application name "SABnzb"
	end tell
end run
The idea is that this provides me with a message on my iPhone with the title and status of the download when it is completed.
The first part works fine, it notifies me that the download is complete. The second part does not work, it tells me it succeeded in unpacking when it did in fact not succeed. I have been debugging the issue and reading up on release notes etc. to find an answer to my quest. I didn't find any yet. However I did find something interesting in the logs:
2010-04-08 17:58:12,492::INFO::[newsunpack:126] Running external script /Users/me/sabnzbd/sabnzbd.sh(/Volumes/Storage/Nieuw/lost.1, lost.nzb, lost, , None, alt.binaries.x, 0)
Note that it says the status is 0 (OK), in fact this is one that I am sure had failed because I removed half of the NZB file myself to test it.

So can anybody tell me, am I doing something wrong? I am I alone in this situation? Is this simply a bug?

Any help is much appreciated!

Regards,
Chris
Last edited by Incr.Badeend on April 12th, 2010, 10:15 am, edited 1 time in total.
young-einstein
Newbie
Newbie
Posts: 37
Joined: January 15th, 2010, 9:41 am

Re: Post Processing user script receives status 0 = OK when the download fails

Post by young-einstein »

Incr.Badeend wrote: am I alone in this situation? Is this simply a bug?
No you're not ... I've noticed this bug at least once on a job which failed extraction due to password protection. 

The error showed up properly in the history queue, yet the $7 parameter passed to my script was definitely 0.  [I know that, because it echoes the $7 value as part of the script]

FWIW - I'm running 0.5.1RC2 on Ubuntu Linux.
Incr.Badeend
Newbie
Newbie
Posts: 6
Joined: April 8th, 2010, 11:13 am

Re: Post Processing user script receives status 0 = OK when the download fails

Post by Incr.Badeend »

young-einstein wrote: I know that, because it echoes the $7 value as part of the script]
Thank you young-einstein, for confirming my suspicion! Could you maybe try to find the following line in the log to undeniably confirm it to the developers?
2010-04-08 17:58:12,492::INFO::[newsunpack:126] Running external script /Users/me/sabnzbd/sabnzbd.sh(/Volumes/Storage/Nieuw/lost.1, lost.nzb, lost, , None, alt.binaries.x, 0)
That's 2 *nix like systems, that means it's not isolated to 1!  ;D

Regards
young-einstein
Newbie
Newbie
Posts: 37
Joined: January 15th, 2010, 9:41 am

Re: Post Processing user script receives status 0 = OK when the download fails

Post by young-einstein »

Incr.Badeend wrote: Could you maybe try to find the following line in the log to undeniably confirm it to the developers?
I just tried another test now, and it's definitely confirmed the bug:

Code: Select all

2010-04-12 23:52:06,548::INFO::[newsunpack:438] Archive /media/sabnzbd/incomplete/passworded/xxx.rar probably encrypted, skipping
...
2010-04-12 23:52:06,559::INFO::[newsunpack:126] Running external script /home/david/scripts/sabnzbd/remove-backup-nzb(/media/sabnzbd/complete/passworded, passworded.nzb, passworded, , None, alt.binaries.x, 0)
It shows the error on the history page:

"» Failed opening main archive (encrypted or damaged) "

... yet here's the debugging info from my post processing script:
-------------------------
1 = /media/sabnzbd/complete/passworded
2 = passworded.nzb
3 = passworded
7 = 0
-------------------------
Last edited by young-einstein on April 12th, 2010, 9:16 am, edited 1 time in total.
Incr.Badeend
Newbie
Newbie
Posts: 6
Joined: April 8th, 2010, 11:13 am

Re: Post Processing user script receives status 0 = OK when the download fails

Post by Incr.Badeend »

Thanks young-einstein!

Can anyone else confirm this or is there a developer that has seen this issue? :)
User avatar
shypike
Administrator
Administrator
Posts: 19774
Joined: January 18th, 2008, 12:49 pm

Re: Post Processing user script receives status 0=OK on failed download [Confirmed]

Post by shypike »

Yeah, the unrar failure message gets lost somewhere in post-processing.
BTW the "encrypted" message need not be true.
Some other failures may cause that too.
Will all be fixed in 0.5.2
Incr.Badeend
Newbie
Newbie
Posts: 6
Joined: April 8th, 2010, 11:13 am

Re: Post Processing user script receives status 0=OK on failed download [Confirm

Post by Incr.Badeend »

Thanks shypike ;)
Post Reply