Page 1 of 1

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

Posted: April 8th, 2010, 11:34 am
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

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

Posted: April 12th, 2010, 8:17 am
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.

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

Posted: April 12th, 2010, 8:23 am
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

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

Posted: April 12th, 2010, 9:06 am
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
-------------------------

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

Posted: April 12th, 2010, 10:14 am
by Incr.Badeend
Thanks young-einstein!

Can anyone else confirm this or is there a developer that has seen this issue? :)

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

Posted: April 12th, 2010, 12:23 pm
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

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

Posted: April 12th, 2010, 1:32 pm
by Incr.Badeend
Thanks shypike ;)