[Fixed] Adding NZB to NZBGet fails but not recognized by Sonarr

I was wondering why I was missing episodes sporadically and found out that Sonarr thought it already added a download to the NZBGet queue but the queueing actually failed.

Sonarr reports:

15-4-9 04:35:23.4|Info|Nzbget|Adding report [Workaholics.S05E13.720p.HDTV.x264-IMMERSE] to the queue.

but NZBGet reports:

INFO Adding collection Workaholics.S05E13.720p.HDTV.x264-IMMERSE.nzb to queue
Thu Apr 9 04:35:23 2015 ERROR Error parsing nzb-file: Premature end of data in tag segment line 1309
Thu Apr 9 04:35:23 2015 ERROR Error parsing nzb-file: Premature end of data in tag segments line 1263
Thu Apr 9 04:35:23 2015 ERROR Error parsing nzb-file: Premature end of data in tag file line 1259
Thu Apr 9 04:35:23 2015 ERROR Error parsing nzb-file: Premature end of data in tag nzb line 3
Thu Apr 9 04:35:23 2015 ERROR Error parsing nzb-file Workaholics.S05E13.720p.HDTV.x264-IMMERSE.nzb
Thu Apr 9 04:35:23 2015 ERROR Could not add collection Workaholics.S05E13.720p.HDTV.x264-IMMERSE.nzb to queue

Sonarr is unable to recognize this for some reason and will ignore further releases because it thinks NZBget will still download the episode at some point.

I’m more or less certain this happens because DOGNzb’s API servery is a but fucky at the moment. But this is only the root cause of this problem. I don’t know if Sonarr could/should check if the NZB was actually added to the queue. I guess you already check NZBGet’s return code for the append command, which means that it returns an OK value (NZBID) although the item wasn’t actually added? This would hint at a bug in NZBGet, but I don’t know enough about the interaction between the two.

I’m running NZBGet 15.0-testing-r1253M and Sonarr 2.0.0.3045.

Thanks so much.

At first look it appears we don’t handle a failed response on nzbget and following the response back we happily ignore it, unless I’m missing something that is. @Taloth can you confirm?

Yes, I looked at that code. The NZBGet API changed with version 13 and now returns a positive value if the download was successfull, otherwise it returns 0.

I too was having this problem,

I was wrong accusing DogNZB, this is a problem with NZBGeek, it only happens with their NZBs.

Still, the nzbget NZB download handling in sonar should probably be fixed.

Thanks for the hard work!

Taloth, thanks for the commit. Took me a while to understand why it still/already works with v13 but after taking a closer look at the NZBGet API doc for “append” I got it.