Drapersniper / Qbitrr

A simple Python script to talk to Qbit and Arr's
MIT License
26 stars 4 forks source link

Deletes file during Radarr import #6

Closed Treverr closed 2 years ago

Treverr commented 2 years ago

I have noticed an issue but I cant seem to figure out why its happening..

The use case is that the file has completed downloading and then while Radarr is importing Qbitrr comes in and doesnt see the file for some reason and deletes it. And then Radarr fails to import it because the file has gone missing. Maybe there is a setting difference or something I am missing here or misunderstanding.

Qbitrr Logs:

bfd2ca7007e7 [2021-12-11 00:55:13.666233] [140067453097792] NOTICE: Radarr: Re-Searching movie: How the Grinch Stole Christmas (2000) | [tmdbId=8871|id=1114]
bfd2ca7007e7 [2021-12-11 00:55:13.565505] [140067453097792] NOTICE: Radarr: Re-Searching movie: How the Grinch Stole Christmas (2000) | [tmdbId=8871|id=1114]
bfd2ca7007e7 [2021-12-11 00:55:13.511305] [140067453097792] INFO: Radarr: Deleting Missing Torrent: How.the.Grinch.Stole.Christmas.2000.2160p.UHD.BluRay.x265.10bit.HDR.DTS-X.7.1-IAMABLE (2d1acdb19f113923da596cd4682e872062afec54)
bfd2ca7007e7 [2021-12-11 00:55:13.411029] [140067453097792] TRACE: Utilities: Attempt 11/10: File does not yet exists! (Possibly being moved?) | /downloads/radarr/How.the.Grinch.Stole.Christmas.2000.2160p.UHD.BluRay.X265-IAMABLE | Sleeping for 0.1s
bfd2ca7007e7 [2021-12-11 00:55:13.310789] [140067453097792] TRACE: Utilities: Attempt 10/10: File does not yet exists! (Possibly being moved?) | /downloads/radarr/How.the.Grinch.Stole.Christmas.2000.2160p.UHD.BluRay.X265-IAMABLE | Sleeping for 0.1s
bfd2ca7007e7 [2021-12-11 00:55:13.210548] [140067453097792] TRACE: Utilities: Attempt 9/10: File does not yet exists! (Possibly being moved?) | /downloads/radarr/How.the.Grinch.Stole.Christmas.2000.2160p.UHD.BluRay.X265-IAMABLE | Sleeping for 0.1s
bfd2ca7007e7 [2021-12-11 00:55:13.110278] [140067453097792] TRACE: Utilities: Attempt 8/10: File does not yet exists! (Possibly being moved?) | /downloads/radarr/How.the.Grinch.Stole.Christmas.2000.2160p.UHD.BluRay.X265-IAMABLE | Sleeping for 0.1s
bfd2ca7007e7 [2021-12-11 00:55:13.010032] [140067453097792] TRACE: Utilities: Attempt 7/10: File does not yet exists! (Possibly being moved?) | /downloads/radarr/How.the.Grinch.Stole.Christmas.2000.2160p.UHD.BluRay.X265-IAMABLE | Sleeping for 0.1s
bfd2ca7007e7 [2021-12-11 00:55:12.909723] [140067453097792] TRACE: Utilities: Attempt 6/10: File does not yet exists! (Possibly being moved?) | /downloads/radarr/How.the.Grinch.Stole.Christmas.2000.2160p.UHD.BluRay.X265-IAMABLE | Sleeping for 0.1s
bfd2ca7007e7 [2021-12-11 00:55:12.809356] [140067453097792] TRACE: Utilities: Attempt 5/10: File does not yet exists! (Possibly being moved?) | /downloads/radarr/How.the.Grinch.Stole.Christmas.2000.2160p.UHD.BluRay.X265-IAMABLE | Sleeping for 0.1s
bfd2ca7007e7 [2021-12-11 00:55:12.708995] [140067453097792] TRACE: Utilities: Attempt 4/10: File does not yet exists! (Possibly being moved?) | /downloads/radarr/How.the.Grinch.Stole.Christmas.2000.2160p.UHD.BluRay.X265-IAMABLE | Sleeping for 0.1s
bfd2ca7007e7 [2021-12-11 00:55:12.608687] [140067453097792] TRACE: Utilities: Attempt 3/10: File does not yet exists! (Possibly being moved?) | /downloads/radarr/How.the.Grinch.Stole.Christmas.2000.2160p.UHD.BluRay.X265-IAMABLE | Sleeping for 0.1s
bfd2ca7007e7 [2021-12-11 00:55:12.508440] [140067453097792] TRACE: Utilities: Attempt 2/10: File does not yet exists! (Possibly being moved?) | /downloads/radarr/How.the.Grinch.Stole.Christmas.2000.2160p.UHD.BluRay.X265-IAMABLE | Sleeping for 0.1s
bfd2ca7007e7 [2021-12-11 00:55:12.408197] [140067453097792] TRACE: Utilities: Attempt 1/10: File does not yet exists! (Possibly being moved?) | /downloads/radarr/How.the.Grinch.Stole.Christmas.2000.2160p.UHD.BluRay.X265-IAMABLE | Sleeping for 0.1s
bfd2ca7007e7 [2021-12-11 00:55:12.405668] [140067453097792] DEBUG: Radarr: Pausing How.the.Grinch.Stole.Christmas.2000.2160p.UHD.BluRay.x265.10bit.HDR.DTS-X.7.1-IAMABLE (2d1acdb19f113923da596cd4682e872062afec54)
bfd2ca7007e7 [2021-12-11 00:55:12.405402] [140067453097792] INFO: Radarr: Pausing Completed torrent: How.the.Grinch.Stole.Christmas.2000.2160p.UHD.BluRay.x265.10bit.HDR.DTS-X.7.1-IAMABLE (2d1acdb19f113923da596cd4682e872062afec54) | TorrentStates.UPLOADING
bfd2ca7007e7 [2021-12-11 00:54:12.152418] [140067453097792] TRACE: Radarr: Skipping torrent: Unresolved state | How.the.Grinch.Stole.Christmas.2000.2160p.UHD.BluRay.x265.10bit.HDR.DTS-X.7.1-IAMABLE (2d1acdb19f113923da596cd4682e872062afec54)
bfd2ca7007e7 [2021-12-11 00:53:11.905700] [140067453097792] TRACE: Radarr: Skipping torrent: Reached Maximum completed percentage and is active | How.the.Grinch.Stole.Christmas.2000.2160p.UHD.BluRay.x265.10bit.HDR.DTS-X.7.1-IAMABLE (2d1acdb19f113923da596cd4682e872062afec54)
bfd2ca7007e7 [2021-12-11 00:52:11.756892] [140067453097792] TRACE: Radarr: Skipping file check: Already been cleaned up | How.the.Grinch.Stole.Christmas.2000.2160p.UHD.BluRay.x265.10bit.HDR.DTS-X.7.1-IAMABLE (2d1acdb19f113923da596cd4682e872062afec54) 
bfd2ca7007e7 [2021-12-11 00:51:11.521998] [140067453097792] TRACE: Radarr: Skipping file check: Already been cleaned up | How.the.Grinch.Stole.Christmas.2000.2160p.UHD.BluRay.x265.10bit.HDR.DTS-X.7.1-IAMABLE (2d1acdb19f113923da596cd4682e872062afec54) 
bfd2ca7007e7 [2021-12-11 00:50:11.292780] [140067453097792] TRACE: Radarr: Skipping file check: Already been cleaned up | How.the.Grinch.Stole.Christmas.2000.2160p.UHD.BluRay.x265.10bit.HDR.DTS-X.7.1-IAMABLE (2d1acdb19f113923da596cd4682e872062afec54) 
bfd2ca7007e7 [2021-12-11 00:49:11.100105] [140067453097792] TRACE: Radarr: Skipping file check: Already been cleaned up | How.the.Grinch.Stole.Christmas.2000.2160p.UHD.BluRay.x265.10bit.HDR.DTS-X.7.1-IAMABLE (2d1acdb19f113923da596cd4682e872062afec54) 
bfd2ca7007e7 [2021-12-11 00:48:10.642233] [140067453097792] TRACE: Radarr: Skipping file check: Already been cleaned up | How.the.Grinch.Stole.Christmas.2000.2160p.UHD.BluRay.x265.10bit.HDR.DTS-X.7.1-IAMABLE (2d1acdb19f113923da596cd4682e872062afec54) 
bfd2ca7007e7 [2021-12-11 00:47:10.402987] [140067453097792] TRACE: Radarr: Skipping file check: Already been cleaned up | How.the.Grinch.Stole.Christmas.2000.2160p.UHD.BluRay.x265.10bit.HDR.DTS-X.7.1-IAMABLE (2d1acdb19f113923da596cd4682e872062afec54) 
bfd2ca7007e7 [2021-12-11 00:46:10.169941] [140067453097792] TRACE: Radarr: Skipping file check: Already been cleaned up | How.the.Grinch.Stole.Christmas.2000.2160p.UHD.BluRay.x265.10bit.HDR.DTS-X.7.1-IAMABLE (2d1acdb19f113923da596cd4682e872062afec54) 
bfd2ca7007e7 [2021-12-11 00:45:09.949022] [140067453097792] TRACE: Radarr: Skipping file check: Already been cleaned up | How.the.Grinch.Stole.Christmas.2000.2160p.UHD.BluRay.x265.10bit.HDR.DTS-X.7.1-IAMABLE (2d1acdb19f113923da596cd4682e872062afec54) 
bfd2ca7007e7 [2021-12-11 00:44:09.649032] [140067453097792] TRACE: Radarr: Skipping file check: Already been cleaned up | How.the.Grinch.Stole.Christmas.2000.2160p.UHD.BluRay.x265.10bit.HDR.DTS-X.7.1-IAMABLE (2d1acdb19f113923da596cd4682e872062afec54) 
bfd2ca7007e7 [2021-12-11 00:43:09.437054] [140067453097792] TRACE: Radarr: Skipping file check: Already been cleaned up | How.the.Grinch.Stole.Christmas.2000.2160p.UHD.BluRay.x265.10bit.HDR.DTS-X.7.1-IAMABLE (2d1acdb19f113923da596cd4682e872062afec54) 
bfd2ca7007e7 [2021-12-11 00:42:09.152052] [140067453097792] TRACE: Radarr: Skipping file check: Already been cleaned up | How.the.Grinch.Stole.Christmas.2000.2160p.UHD.BluRay.x265.10bit.HDR.DTS-X.7.1-IAMABLE (2d1acdb19f113923da596cd4682e872062afec54) 
bfd2ca7007e7 [2021-12-11 00:41:08.949790] [140067453097792] TRACE: Radarr: Skipping file check: Already been cleaned up | How.the.Grinch.Stole.Christmas.2000.2160p.UHD.BluRay.x265.10bit.HDR.DTS-X.7.1-IAMABLE (2d1acdb19f113923da596cd4682e872062afec54) 
bfd2ca7007e7 [2021-12-11 00:40:08.704981] [140067453097792] TRACE: Radarr: Skipping file check: Already been cleaned up | How.the.Grinch.Stole.Christmas.2000.2160p.UHD.BluRay.x265.10bit.HDR.DTS-X.7.1-IAMABLE (2d1acdb19f113923da596cd4682e872062afec54) 
bfd2ca7007e7 [2021-12-11 00:39:08.490089] [140067453097792] TRACE: Radarr: Skipping file check: Already been cleaned up | How.the.Grinch.Stole.Christmas.2000.2160p.UHD.BluRay.x265.10bit.HDR.DTS-X.7.1-IAMABLE (2d1acdb19f113923da596cd4682e872062afec54) 
bfd2ca7007e7 [2021-12-11 00:38:08.299037] [140067453097792] TRACE: Radarr: Skipping file check: Already been cleaned up | How.the.Grinch.Stole.Christmas.2000.2160p.UHD.BluRay.x265.10bit.HDR.DTS-X.7.1-IAMABLE (2d1acdb19f113923da596cd4682e872062afec54) 
bfd2ca7007e7 [2021-12-11 00:37:08.104572] [140067453097792] TRACE: Radarr: Skipping file check: Already been cleaned up | How.the.Grinch.Stole.Christmas.2000.2160p.UHD.BluRay.x265.10bit.HDR.DTS-X.7.1-IAMABLE (2d1acdb19f113923da596cd4682e872062afec54) 
bfd2ca7007e7 [2021-12-11 00:36:07.869141] [140067453097792] TRACE: Radarr: Skipping file check: Already been cleaned up | How.the.Grinch.Stole.Christmas.2000.2160p.UHD.BluRay.x265.10bit.HDR.DTS-X.7.1-IAMABLE (2d1acdb19f113923da596cd4682e872062afec54) 
bfd2ca7007e7 [2021-12-11 00:35:07.665253] [140067453097792] TRACE: Radarr: Skipping file check: Already been cleaned up | How.the.Grinch.Stole.Christmas.2000.2160p.UHD.BluRay.x265.10bit.HDR.DTS-X.7.1-IAMABLE (2d1acdb19f113923da596cd4682e872062afec54) 
bfd2ca7007e7 [2021-12-11 00:34:07.454885] [140067453097792] TRACE: Radarr: Skipping file check: Already been cleaned up | How.the.Grinch.Stole.Christmas.2000.2160p.UHD.BluRay.x265.10bit.HDR.DTS-X.7.1-IAMABLE (2d1acdb19f113923da596cd4682e872062afec54) 
bfd2ca7007e7 [2021-12-11 00:33:07.239094] [140067453097792] TRACE: Radarr: Skipping file check: Already been cleaned up | How.the.Grinch.Stole.Christmas.2000.2160p.UHD.BluRay.x265.10bit.HDR.DTS-X.7.1-IAMABLE (2d1acdb19f113923da596cd4682e872062afec54) 
bfd2ca7007e7 [2021-12-11 00:32:07.041103] [140067453097792] TRACE: Radarr: Skipping file check: Already been cleaned up | How.the.Grinch.Stole.Christmas.2000.2160p.UHD.BluRay.x265.10bit.HDR.DTS-X.7.1-IAMABLE (2d1acdb19f113923da596cd4682e872062afec54) 
bfd2ca7007e7 [2021-12-11 00:31:06.835640] [140067453097792] TRACE: Radarr: Skipping file check: Already been cleaned up | How.the.Grinch.Stole.Christmas.2000.2160p.UHD.BluRay.x265.10bit.HDR.DTS-X.7.1-IAMABLE (2d1acdb19f113923da596cd4682e872062afec54) 
bfd2ca7007e7 [2021-12-11 00:30:06.629576] [140067453097792] TRACE: Radarr: Skipping file check: Already been cleaned up | How.the.Grinch.Stole.Christmas.2000.2160p.UHD.BluRay.x265.10bit.HDR.DTS-X.7.1-IAMABLE (2d1acdb19f113923da596cd4682e872062afec54) 
bfd2ca7007e7 [2021-12-11 00:29:06.385734] [140067453097792] TRACE: Radarr: Skipping file check: Already been cleaned up | How.the.Grinch.Stole.Christmas.2000.2160p.UHD.BluRay.x265.10bit.HDR.DTS-X.7.1-IAMABLE (2d1acdb19f113923da596cd4682e872062afec54) 
bfd2ca7007e7 [2021-12-11 00:28:06.008701] [140067453097792] TRACE: Radarr: Skipping file check: Already been cleaned up | How.the.Grinch.Stole.Christmas.2000.2160p.UHD.BluRay.x265.10bit.HDR.DTS-X.7.1-IAMABLE (2d1acdb19f113923da596cd4682e872062afec54) 
bfd2ca7007e7 [2021-12-11 00:27:05.796609] [140067453097792] TRACE: Radarr: Skipping file check: Already been cleaned up | How.the.Grinch.Stole.Christmas.2000.2160p.UHD.BluRay.x265.10bit.HDR.DTS-X.7.1-IAMABLE (2d1acdb19f113923da596cd4682e872062afec54) 
bfd2ca7007e7 [2021-12-11 00:26:05.580428] [140067453097792] TRACE: Radarr: Skipping file check: Already been cleaned up | How.the.Grinch.Stole.Christmas.2000.2160p.UHD.BluRay.x265.10bit.HDR.DTS-X.7.1-IAMABLE (2d1acdb19f113923da596cd4682e872062afec54) 
bfd2ca7007e7 [2021-12-11 00:25:05.387040] [140067453097792] TRACE: Radarr: Skipping file check: Already been cleaned up | How.the.Grinch.Stole.Christmas.2000.2160p.UHD.BluRay.x265.10bit.HDR.DTS-X.7.1-IAMABLE (2d1acdb19f113923da596cd4682e872062afec54) 
bfd2ca7007e7 [2021-12-11 00:24:05.183957] [140067453097792] DEBUG: Radarr: Updating file priority on torrent: How.the.Grinch.Stole.Christmas.2000.2160p.UHD.BluRay.x265.10bit.HDR.DTS-X.7.1-IAMABLE (2d1acdb19f113923da596cd4682e872062afec54)
bfd2ca7007e7 [2021-12-11 00:24:05.183798] [140067453097792] DEBUG: Radarr: Removing File: Not allowed | Parent: Sample | How.the.Grinch.Stole.Christmas.2000.2160p.UHD.BluRay.x265.10bit.HDR.DTS-X.7.1-IAMABLE (2d1acdb19f113923da596cd4682e872062afec54) | How.the.Grinch.Stole.Christmas.2000.2160p.UHD.BluRay.X265-IAMABLE/Sample/how.the.grinch.stole.christmas.2000.2160p.uhd.bluray.x265-iamable-sample.mkv 
bfd2ca7007e7 [2021-12-11 00:24:05.183560] [140067453097792] DEBUG: Radarr: Removing File: Not allowed | Extension: .txt  | How.the.Grinch.Stole.Christmas.2000.2160p.UHD.BluRay.x265.10bit.HDR.DTS-X.7.1-IAMABLE (2d1acdb19f113923da596cd4682e872062afec54) | How.the.Grinch.Stole.Christmas.2000.2160p.UHD.BluRay.X265-IAMABLE/RARBG.txt 
Treverr commented 2 years ago

Here is my config (with some urls/tokens taken out)

config.txt

Drapersniper commented 2 years ago

Hmm thanks for the report, - your settings are fix, in fact the script never deletes anything itself due to AutoDelete being off in your setup it sends a command to Radarr letting it know the file can't be located and that it should remove it from qbit queue)

I just pushed an update, rather than taking action on this edge case the script should now log at warning level and ignore this file for a given iteration, for for clarity its not the script that's actually download the file here, its Radarr - because the script its sending a command to radarr to remove the file from qbit queue because its in a bad state (qbit reporting an invalid path?)

This is likely not a true fix - because something is causing Qbit Torrent to report a bad path or the file is being moved way too fast - (I usually deal with 70GB files on a 980 Pros in raid 0 so its unlikely to be much faster than that but alas)

Hopefully, this new behaviour will give it enough time - you may see the warning line more than once (I.e every time it tries to process it) but you should be fairly safe to ignore it as long as Arr's download handling picks up the file in question - (This script sends a command to the Arrs to speed up the download handling, all that's gonna happen now is this command will not be sent for files that hit this edge case)

Drapersniper commented 2 years ago

Your issue should be resolved by https://github.com/Drapersniper/Qbitrr/commit/b5d6febb76fcaafa3c301243b636e0fc3e190f0a.

if this has fixed your issue feel free to close this issue - if not let me know whats the new behaviour is so I can try to further investigate it.

Treverr commented 2 years ago

Awesome. Thank you!

Treverr commented 2 years ago

I am seeing this similar issue again. Qbitrr shows it paused the torrent and Sonarr said it couldn't find the file and then it was removed from Qbit

1640827253_3554.txt .

Drapersniper commented 2 years ago

I'll take a look in the morning, but just to be sure - on the history of radarr you see the file being blocklisted?

Drapersniper commented 2 years ago

This should be fully resolved now, if you encounter it on or after v2.1.10 feel free to reopen it