Page 1 of 1

Help with retrying failed jobs (using API)

Posted: October 9th, 2016, 4:15 am
by MikeC
I am having a few jobs fail due to articles not being propagated to the NNTP server I am using, they are there later when I try. I am currently manually pressing Retry but am trying to automate that process in a script I'm working on. I'm struggling to figure out what I'm doing wrong (if at all) with the API. I am using Sabnzbd 1.1.1RC1

I did this to see what failed jobs I had:

Code: Select all

http://server:8080/sabnzbd/api?mode=history&failed_only=1&apikey=<myAPIkey>&output=xml
I then tried:

Code: Select all

http://server:8080/sabnzbd/api?mode=retry_all&apikey=<myAPIkey>&output=xml
which retured this:

Code: Select all

<status><function retry_all_jobs at 0xb6376a30></status>
but then it did nothing.

I then located the nzo_id of the failed job which was something like SABnzbd_nzo_kxgwDV and also tried to retry the individual job using this:

Code: Select all

http://server:8080/sabnzbd/api?mode=retry&job=SABnzbd_nzo_kxgwDV&apikey=<myAPIkey>&output=xml
which never worked either, I also tried the job# as well but didn't think that was correct.

What am I doing wrong? Any help would be appreciated.

Re: Help with retrying failed jobs (using API)

Posted: October 9th, 2016, 5:42 am
by safihre
Hmmm, this is not good. Let me check if it's a problem on our side.
Regarding your Propagation problem, why don't you use the Propagation Delay feature in 1.1.0? It's in the Switches page, which will only start downloading a job when the job reaches at least the specified age in minutes. Age is not the time you added the job to the queue, but the time since it was posted by the uploader :)

Re: Help with retrying failed jobs (using API)

Posted: October 9th, 2016, 5:57 am
by safihre
I see the wiki is wrong, I fixed it now.
For a single job it should be:
api?mode=retry&value=NZO_ID

The retry_all API-function was broken.. And has been broken for a longggg time! Fixed it now.
Will be in 1.1.1.

Re: Help with retrying failed jobs (using API)

Posted: October 9th, 2016, 7:17 am
by MikeC
Many thanks for the info. I didn't know about the Propagation Delay feature. That could do the job for me.
Thank for fixing the wiki re: the single job change. Glad the retry_all will be fixed in future too.
Seems like I have various options to sort my problem out now moving forward. I'll experiment and see which I use.
I appreciate the great help in this regard.