Completed Download Handling Issues

Sonarr version (exact version): 3.0.2.536
Mono version (if Sonarr is not running on Windows): 5.10.1.57
OS: FreeNAS
Debug logs:https://pastebin.com/RjAx7ZCZ
Description of issue:
Issue occurring with Transmission and SabNZBD over the past few updates.

When a file is downloaded that Sonarr feels is not an upgrade to the existing file, or not a qualified file (Why would it download in the first place?), the item remains active in the Queue even though seeding (transmission) has been completed, or the download is completed in SabNZBD. If I manually remove the file from the download client, they will then remove from Sonarr’s Queue.Capture1

Every item in the above shows either “Sample”, “Has same filesize as existing file” or “Not an upgrade for existing episode file(s)”.

So I guess this is a 2 part question.
A) Why is it downloading these in the first place if they’re the same filesize or not considered an upgrade?
B) How do I resolve the issue of Sonarr not detecting the download is finished when it does not consider the file an upgrade so it will clean up the download from the download from the download client and remove it from the queue.

  1. Check debug logs at the time it was grabbed, possibly it’s doing it because the file already in the library has the wrong quality.
  2. It does detect it’s finished, but it’s not going to automatically wipe them out, you either need to force it to import with Manual Import or remove it from the queue.

1: If the file in the library is the wrong quality, would Sonarr not see it as an upgrade? Because every file that does this gives one of the errors above. Either same file size or not an upgrade.

2: If I’m reading this right, you’re saying it’s functioning as designed? I would expect a completed download, even if not imported automatically, to be removed from the queue and download client. Instead it still shows a progress bar in the queue as if it is downloading. If I remove the files from the download client OR if I remove the files from queue, Sonarr instantly starts a search and begins a new download for that file. This to me says it is seeing it as a failed download at that point.

Here is the history of 1 of the files in question.

I have x265 weighted as +15 and DD5.1 weighted as +20.

So as you can see, the first x265 file download is a proper upgrade. But it doesn’t get handled after download. Then it downloads a 5.1 file which would be a proper upgrade over the x265. But why does it download twice? The x265 is being seen as a sample. The dd5.1 is being seen as not an upgrade in handling.

  1. Since you’re using preferred words, make sure SAB is configured properly. If SAB is configured incorrectly that can lead to issues: Sonarr downloading duplicate episodes that aren't upgrades, sometimes exact duplicate NZB

  2. Correct, Sonarr does not remove completed downloads that it does not import, an import failure is not a download failure

If I remove the files from the download client OR if I remove the files from queue, Sonarr instantly starts a search and begins a new download for that file. This to me says it is seeing it as a failed download at that point.

It’ll only search if you tell Sonarr to blacklist the release, which is the same as Sonarr detecting it as failed on it’s own.

PS Edit your posts instead of double posting.

1: That feature is disabled in SAB.
2: Is this a new feature? I’ve been using V3 since fairly close to the beginning and it just recently started happening a few releases back and it’s a pain having to log in and seeing 45 items in queue and having to go through each one. It’s gotten that I’m having to check Sonarr daily just to remove these “completed” downloads which removes the entire automation process of it.

In my experience it searches regardless if I blacklist or not. If I remove it from SAB, not even touching Sonarr, it drops it from the Sonarr queue and starts another search downloading it again.

3: Is there a spot to make a feature request to have this behavior be optional? A completed download is a completed download. I’d much rather have it show completed and remove from queue even if it doesn’t import. There should be an option to determine which behavior it does.

  1. There are several things discussed there, you can’t disable the folder truncation.
  2. Nope, not new at all.

Sonarr definitely doesn’t search for it on it’s own, that’s not a thing it does.

  1. No, we don’t have plans to make that optional it’s a safety net. When everything is setup properly it’s virtually a non-issue, in this case it’d be preventing Sonarr from continually re-grabbing releases because something is going awry.

1: My folder max length currently is set to 256. My replace dots in folder names are disabled. So all features mentioned in that thread are correct in SAB. Also, if you check the screenshots in the original post, I’m having this issue with both SAB and Transmission so it can’t be strictly related to SAB settings.
2: If this is not a new setting, it’s odd that I never had this issue from the beginning and suddenly it’s here. If Sonarr detects a failed download, would it not search on it’s own? As a user, I see the progress bar and it still in queue, to me that says Sonarr isn’t seeing it as a completed download. When I remove it, if Sonarr doesn’t see it as complete, I would want it to search again just as it would with zero imput from the user.

3: Since creating this post, it’s happened again.


This time it is not an upgrade, it is the first download of the file. It’s using no preferred words. And it’s downloading with Transmission so it’s definitely not related to any SAB settings

From the log:
`19-7-17 20:10:08.4|Info|DownloadService|Report sent to Transmission. iZombie.S05E11.WEB.h264-TBS
19-7-17 20:10:08.7|Info|RssSyncService|RSS Sync Completed. Reports found: 1101, Reports grabbed: 1
19-7-17 20:17:19.2|Error|DetectSample|[/media/Downloads/TV/iZombie.S05E11.WEB.h264-TBS/iZombie.S05E11.WEB.h264-TBS.mkv] has a runtime of 0, is it a valid video file?``

I can open and play the video file with no issues from my downloads directory so it’s a valid video file. When I go to manual import, Sonarr is seeing it as a sample.

There is no reason why this should not be processing.

I have removed from transmission only. Have not touched Sonarr. Will see if it re-downloads which I would expect it to because it did not process the original file therefore it will still be showing as a missing episode.

If it failed and failed download handling was enabled it will.

It has a different icon and the progress bar is at 100%, and it’s tried to import it.

It’ll check the RSS feed as it does, but Sonarr won’t search for it, that’s no different than it finding it the first time.

That’s a problem with media info, specifically libmediainfo, updating it should resolve that.

The reason is because it can’t determine if it’s a valid video file with a reasonable run time.

This is a different issue, but for the original issue trace logs from when a dupe is grabbed (not the failing import) would be useful to see why Sonarr thought it should grab it, debug/trace logs from the failing import will help compare why it didn’t import it, though that’s mostly bubbled up in the UI.

Here’s what I’m looking at today when I log in. This is why it’s become a nuissance because this is what I’ve been logging into daily for a while now.

The first episode on that list, Queen of the South has continually not been processing after download. Here’s the episode history.

It’s properly downloading upgrades over the Jun 7th version. X265 is a +15 and DD5.1 is a +20. However none of these upgrades have been processed. Skimming through the debug log it’s rejecting saying the existing file is a +20 score as well as the current file. However the existing file should have a 0 weight. And if the existing file was really a +20, it wouldn’t have downloaded the upgrade in the first place.

Here’s a couple pastebin’s of the various entries in the debug log that I could find relating to this file being downloaded. I believe the first one will be more helpful as it shows the file download being completed in SAB.
https://pastebin.com/imuZsWQg
https://pastebin.com/ubZq0g2y

And for good measure here are my preferred word settings which I’m not seeing anything that would cause the existing file to be weighted as +20
Capture3

Going to need trace logs from when Sonarr grabbed a release and from when Sonarr tried to import it. That way it will show exactly what Sonarr used to determine why it was an upgrade when it was grabbed and not an upgrade when it attempted to import it. Since there are multiple checks of preferred words being upgrade (history, queue, existing file, etc) it’s logged several times, but some are detecting incorrectly.

OK, I’ve enabled trace logging, deleted everything from my downloads directory and cleared the history in both SAB and transmission. I hope to catch this in the trace log, but it may be tough because it’s only keeping about 30 minutes worth of log files now.

In the meantime I have a theory that could be causing a big part of this issue.


This is the only episode that’s stuck here this afternoon.


When I go into manual import it shows no errors or reasons not to import it.
However the log is showing it calculates it at a score of 20 (Correct) and it’s showing the existing file also has a score of 20 (incorrect)

19-7-22 19:13:10.7|Trace|PreferredWordService|Calculating preferred word score for 'Big.Little.Lies.S02E07.I.Want.to.Know.720p.AMZN.WEB-DL.DDP5.1.H.264-NTb[eztv]'
19-7-22 19:13:10.7|Trace|PreferredWordService|Calculated preferred word score for 'Big.Little.Lies.S02E07.I.Want.to.Know.720p.AMZN.WEB-DL.DDP5.1.H.264-NTb[eztv]': 20
19-7-22 19:13:10.7|Debug|UpgradableSpecification|Comparing preferred word score. Current: 20 New: 0
19-7-22 19:13:10.7|Debug|UpgradableSpecification|Existing item meets cut-off. skipping.
19-7-22 19:13:10.7|Debug|UpgradableSpecification|Existing item has better quality, skipping


Looking through the file history, the last processed file was a regular 720p x264 video file which has no preferred word scoring. However after that I had a failed download (or unprocessed download) on a DD5.1 file which would have a preferred score of 20. Since that didn’t process it grabbed another version of the file and downloaded it which is now hanging because it’s saying the existing file has a score of 20.

Is it possible that when searching to grab new files, it’s using the last processed file to compare to, but when trying to process files after download it’s using the last grabbed file? This is the only explanation I can think of that would cause it to think the existing file has a score of 20.

There are several checks it’s going to do when comparing releases, one is for the existing file, one for history, another for things in the queue, so not only that.

For import it’ll compare to the existing file, but it’ll do those same checks for manual import. Impossible to say where the issue lies based solely on that snippet, there are too many places that check will run.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.