Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing Download restarts Decluttarr, resets Permitted Times #222

Open
MrBogger opened this issue Jan 6, 2025 · 7 comments
Open

Missing Download restarts Decluttarr, resets Permitted Times #222

MrBogger opened this issue Jan 6, 2025 · 7 comments

Comments

@MrBogger
Copy link

MrBogger commented Jan 6, 2025

When Decluttarr encounters a missing download, it logs an error but restarts the script, losing all the stalled / missing metadata counts. I have found that these downloads have completed and removed from the queue by either qBittorrent or *arr as I can not locate the Hash ID in the list of current Downloads.

I am aware there is work being done on persistent counts across restarts of Decluttarr but I believe it is worthwhile to log a fault when these errors are encountered and prevent the script from restarting completely, if that is possible.
I am running:
Decluttarr 1.50.2 on Docker 27.4.1, Ubuntu 24.04.1.
qBittorrent 5.0.3 is running on Win11 24H2 (as VM).
Sonarr 4.0.11.2680 and Radarr 5.17.2.9580 on Win10 22H2.

2025-01-05T20:22:05.712790310Z AttributeError: 'NoneType' object has no attribute 'get'
2025-01-05T20:22:05.712875580Z HTTP Error: 404 Client Error: Not Found for url: http://10.1.1.142:8088/api/v2/torrents/properties?hash=572771f15ef712113197f282c294feb7e605bcb3

@ManiMatter
Copy link
Owner

Can you please post debug logs

@MrBogger
Copy link
Author

MrBogger commented Jan 7, 2025

Hey matey,

I've shared some logs below. They are an extensive size due to a lot of torrents in the queue. The smaller one has been truncated to only include the lines for one of the failed torrents, b4edb43c27290bc046f28c8b567ab8b8f191ed62. The large one is complete and includes the failed torrent 7681e66753ffd0de6f062a0fa370f826a64da6d2. Please let me know if there's anything else I can do to assist.

https://drive.google.com/file/d/1bn85ekckdwAkYFKlmoZ8fEGSTmD0L6J2/view?usp=sharing
https://drive.google.com/file/d/1yprzF4d40qziH4KL8D6IDzfwiOZOKDc5/view?usp=sharing

@ManiMatter
Copy link
Owner

Thank you for the logs, these are helpful.

Here is what I think is happening:
Your qbit version: 5.0.3

2025-01-06T07:07:27.925694125Z [DEBUG]: Current version of qBittorrent: 5.0.3

Before qbit 5.10.0 each torrent had to be checked individually if it was a private one or not. Since you are still using 5.0.3, that is still happening.

if settingsDict['IGNORE_PRIVATE_TRACKERS']:
if version.parse(settingsDict['QBIT_VERSION']) >= version.parse('5.1.0'):
if qbitItem['private']:
privateDowloadIDs.append(str.upper(qbitItem['hash']))
else:
qbitItemProperties = await rest_get(settingsDict['QBITTORRENT_URL']+'/torrents/properties',params={'hash': qbitItem['hash']}, cookies=settingsDict['QBIT_COOKIE'])
if qbitItemProperties.get('is_private', False):
privateDowloadIDs.append(str.upper(qbitItem['hash']))
qbitItem['private'] = qbitItemProperties.get('is_private', None) # Adds the is_private flag to qbitItem info for simplified logging

In your logs, the run that fails starts at 10:08
2025-01-06T10:08:02.137471654Z [VERBOSE]: --------------------------------------------------

The fail happens at 10:21

2025-01-06T10:21:27.990136106Z [DEBUG]: http://10.1.1.142:8088 "GET /api/v2/torrents/properties?hash=b4edb43c27290bc046f28c8b567ab8b8f191ed62 HTTP/11" 404 9
2025-01-06T10:21:27.994765256Z HTTP Error: 404 Client Error: Not Found for url: http://10.1.1.142:8088/api/v2/torrents/properties?hash=b4edb43c27290bc046f28c8b567ab8b8f191ed62
2025-01-06T10:21:27.994975522Z AttributeError: 'NoneType' object has no attribute 'get'

Between these two points the system is busy just checking whether the torrents are private or not. Normally, that's a matter of seconds, in your case it's forever because you have so many torrents, and because you are using the old way.

Because normally it's instant, there is no period where the torrent can disappear; in your case, it does, which leads to the crash.

Can you please upgrade your qbit to >5.10.0 and see if the problem disappears?

@MrBogger
Copy link
Author

MrBogger commented Jan 8, 2025

Thank you so much for the detailed response about what is happening. I had presumed it was from having so many queued torrents and I tried looking through the scripts myself to see if I could work it out but had no luck. I have updated to 5.1.0 and see how it goes overnight. Will keep you posted.

@ManiMatter
Copy link
Owner

Also added a check that will warn users going forward

@MrBogger
Copy link
Author

Good morning,
I'm still getting the errors while using QB 5.1.0, I have only got INFO logs at this time. I tried to pull the latest Docker image but it is still 1.50.2. This could also be due to running Decluttarr on a different PC to my *Arr apps and different again to my QB instance making it a lot slower than it should be. I can also get some more DEBUG logs if you would like them.

Thanks again for your efforts with this project as well as this issue.

decluttarr-2025-01-09T23-59-28.log

@ManiMatter
Copy link
Owner

ManiMatter commented Jan 10, 2025

Can you please

  • set your declutarr container to not restart automatically; this will reduce the logs for now
  • run again but on debug level, post the logs once failed
  • Once done, grab the „dev“ image rather than latest and post logs again

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants