evilhero / mylar

An automated Comic Book downloader (cbr/cbz) for use with SABnzbd, NZBGet and torrents
GNU General Public License v3.0
976 stars 172 forks source link

Post-Processing in Sabnzbd - Multiple NZB of same file freezes Sabnzbd #2182

Closed razambon closed 3 years ago

razambon commented 5 years ago

If multiple versions of the same comic are sent to SABNzbd, the post processing action will freeze when processing the second item. I'm not certain where to look for logs, but after having this happen a number of times I'm fairly positive this is what's happening.

The way I fix it is removing the partial downloads from the temp sabnzbd (pre-processing) folder and restart sabnzbd and all is good with the world.

Seems just like a need for a fail gracefully option in the post processing script.

evilhero commented 5 years ago

The logs for mylar are in the GUI and in the mylar.log files themselves. SAB has it's own logging within the GUI.

If it's being marked as failed by SAB due to being incomplete, do you have failed download handling enabled within mylar?

Without any sort of logs to show what's happening, we have to try to duplicate the error based on your description alone. It's similar to finding a needle in a haystack, and unfortunately due to that won't get much resources devoted to solving it.

razambon commented 5 years ago

See that is the thing - it's not SAB failing and when I checked logs I had trouble finding where it would be. Basically what's happening is that if the same nzb goes to SAB - same comic issue - the first one processes fine. Everything after that just sits with the 'spinning' icon in SAB.

It's the script itself that's just stopping and then SAB not recovering or timing out.

I've put SAB and Mylar on debug logging - will try to get what I can if/when it happens again.

Also, I wasn't using completed download handling - was just using ComicRN. If that's deprecated and I should switch, that could resolve this. I just did that and turned off the script from running so...maybe this is just a super edge case.

evilhero commented 5 years ago

If that nzb fails to complete the process via ComicRN - then there's an error occurring probably in the post-processing call that locks up the ComicRN call (thus asking for the logs). You should be able to expand the SABnzbd History for a failed download, and under the script section you might see Exit(1) Powered by CherryPy 3.6.0 (More) or something similar which contains the traceback error that's causing ComicRN to fail.

Even if it processes fine, there's an end portion that's run after each run that might lock up if some things don't line up. Locking up would mean the ComicRN script ends up in a non-ending loop in which the only way to fix it is to either kill Mylar/SAB (or sometimes both depending I suppose). Usually in these cases, it's due to Mylar not being able to remove the download from the download location due to improper permissions. Otherwise, it would be on a case-by-case basis, as alot also depends on what specific series/issue you're trying to download.

ComicRN isn't being depreciated, but Completed Download Handling (CDH) is just another option for those that want a set it and forget it kinda deal. Usually, with new installs, the general consensus is to try and use CDH first, and if that fails then drop down to ComicRN since that requires more configuration and can be troublesome doing that for some users. CDH is relatively new still (a few months old), but it is fairly reliable and has some added benefits that ComicRN cannot employ which makes processing more accurate as it doesn't have to rely on parsing the filename (which ComicRN has to do usually).

razambon commented 5 years ago

Let me see what I can find - haven't had any luck so far. I've turned on debugging level loggin in Sab so that may capture something.

And the issue with the failed item in history is that it goes into the loop, like you said. Sab and Mylar keep working but no further processing of downloads occurs - it just sits on the file causing the issue. Downloads keep going, new nzbs keep getting added, etc.

The ONLY way to stop it is to delete the files from within the Sab temporary download folder and then force restart Sabnzbd. The restart UI element doesn't work in Sab either - I need to force the service I have it setup under to restart (systemctl restart or stop/start).

And normally this works fine - it seems to be an odd case where, for some reason, the exact same named file would get added to Sab multiple times. That may be related to mylar being restarted or me doing an update when the file is downloading already or something - I generally don't notice until I check sab and it's stalled.

And thanks again for your help/perseverance with what I know is a vague issue. I'll get more details next time it happens and just keep an eye on log file size in the mean time. :)