ManiMatter / decluttarr

Watches radarr, sonarr, lidarr, readarr and whisparr download queues and removes downloads if they become stalled or no longer needed.
GNU General Public License v3.0
97 stars 15 forks source link

Not removing all failed imports #120

Open cliny opened 2 weeks ago

cliny commented 2 weeks ago

Hi there,

I have found that failed imports with this message aren't being removed:

"Found matching series via grab history, but release was matched to series by ID. Automatic import is not possible"

Or the radarr equivalent of the message.

I even tried explicitly placing the message in FAILED_IMPORT_MESSAGE_PATTERNS=, to no avail. But otherwise I leave it blank to catch all warnings.

Here is a log:

[INFO   ]: ##################################################
[INFO   ]: Decluttarr - Application Started!
[INFO   ]: 
[INFO   ]: Like this app? Thanks for giving it a ⭐ on GitHub!
[INFO   ]: https://github.com/ManiMatter/decluttarr/
[INFO   ]: 
[INFO   ]: *** Current Settings ***
[INFO   ]: Version: v1.45.0
[INFO   ]: Commit: abf6cc7
[INFO   ]: 
[INFO   ]: True | Removing failed downloads (REMOVE_FAILED)
[INFO   ]: True | Removing failed imports (REMOVE_FAILED_IMPORTS)
[VERBOSE]: > Any imports with a warning flag are considered failed, as no patterns specified (FAILED_IMPORT_MESSAGE_PATTERNS).
[INFO   ]: True | Removing downloads missing metadata (REMOVE_METADATA_MISSING)
[INFO   ]: True | Removing downloads missing files (REMOVE_MISSING_FILES)
[INFO   ]: True | Removing orphan downloads (REMOVE_ORPHANS)
[INFO   ]: False | Removing slow downloads (REMOVE_SLOW)
[INFO   ]: True | Removing stalled downloads (REMOVE_STALLED)
[INFO   ]: False | Removing downloads belonging to unmonitored items (REMOVE_UNMONITORED)
[INFO   ]: 
[INFO   ]: Running every: 0 days 0 hours 1.0 minutes
[INFO   ]: Permitted number of times before stalled/missing metadata/slow downloads are removed: 1
[INFO   ]: 
[INFO   ]: *** Configured Instances ***
[INFO   ]: Radarr: https://radarr.REDACTED/api/v3
[INFO   ]: Sonarr: https://sonarr.REDACTED/api/v3
[INFO   ]: Lidarr: https://lidarr.REDACTED/api/v1
[INFO   ]: 
[INFO   ]: *** Check Instances ***
[INFO   ]: OK | Radarr
[INFO   ]: OK | Sonarr
[INFO   ]: OK | Lidarr
[INFO   ]: 
[INFO   ]: ##################################################
[INFO   ]: 
[VERBOSE]: --------------------------------------------------
[VERBOSE]: Cleaning queue on Radarr:
[VERBOSE]: >>> Queue is clean.
[VERBOSE]: Cleaning queue on Sonarr:
[VERBOSE]: >>> Queue is clean.
[VERBOSE]: Cleaning queue on Lidarr:
[VERBOSE]: >>> Queue is empty.
[VERBOSE]: 
[VERBOSE]: Queue clean-up complete!

I'm not sure what I'm doing wrong? I'm using the latest stable "linuxserver" containers for everything (sabnzbd, sonarr, etc), updated daily.

Thanks

ManiMatter commented 2 weeks ago

Can you pls post debug logs

  1. Switch decluttarr to debug mode (setting LOG_LEVEL: DEBUG)
  2. Turn off all remove functions but one where you expect a removal (example: REMOVE_STALLED: True and the rest on False)
  3. Let it run until the supposed remove should be trigged
  4. Paste the full logs to a pastebin
  5. If helpful: Paste a screenshot of qbit and the affected *arr app to a pasteimg
cliny commented 2 weeks ago

Can you pls post debug logs

1. Switch decluttarr to debug mode (setting LOG_LEVEL: DEBUG)

2. Turn off all remove functions but one where you expect a removal (example: REMOVE_STALLED: True and the rest on False)

3. Let it run until the supposed remove should be trigged

4. Paste the full logs to a pastebin

5. If helpful: Paste a screenshot of qbit and the affected *arr app to a pasteimg

Debug logs here: https://pastebin.com/049mWFpi

Thank you

ManiMatter commented 2 weeks ago

Thank you.

Quite simple really. Your download has "trackedDownloadState":"downloading", and the condition decluttar looks for is https://github.com/ManiMatter/decluttarr/blob/2ee86d35914d24318b83c0672add7954571c9e0e/src/jobs/remove_failed_imports.py#L21-L23

So the question is.. why doesn't the status read "importPending" or "importFailed"? According to the current status, it seems it's not yet "entirely failed" but yet downloading.

Maybe something you want to raise with the Sonarr/Radarr team? Could be that it's a matter of a wrongly implemented mapping on their end (pure speculation)

cliny commented 2 weeks ago

I see. I could put this forward to the sonarr team?

Otherwise, I noticed the 'trackedDownloadStatus' has 'warning'. Is it possible to get an option in decluttarr where any failed imports that have a status as 'warning' will trigger a removal, instead of waiting for the 'importPending' or 'importFailed' state, even if stuck on 'downloading'?

ManiMatter commented 2 weeks ago

That‘d be too broad I‘m afraid. No idea what all the different warnings are (for example: insufficient disk space when importing from disk A to disk B). You Wouldn‘t want to delete from A just because B has insufficient space.

I see. I could put this forward to the sonarr team?

yes, raise it on their github, or discord, or directly contribute with a PR

cliny commented 3 days ago

It looks like the sonarr team have added an addition state:

https://github.com/Sonarr/Sonarr/pull/6889

ManiMatter commented 2 days ago

Once you have the new version installed, pls provide the queue-response from Sonarr.

cliny commented 2 days ago

Once you have the new version installed, pls provide the queue-response from Sonarr.

No worries, I'll do this when I have some time, and report back with the details.

Do you know if radarr will implement this, or if I should raise it with them too?

ManiMatter commented 1 day ago

To my knowledge they port it; but if you want confirmation, you need to ask them ;-)