evilhero / mylar

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

BUG: Completed Download Handling gets confused #2041

Closed barbequesauce closed 6 years ago

barbequesauce commented 6 years ago

Current on development branch, running on Raspbian Jessie from git.

Had three files snatched from dog this morning and sent to nzbget. All three went to success. CDH picked up one of the three and post processed correctly; the other two didnt.

 02-Aug-2018 02:08:12 - DEBUG   :: mylar.processor.96 : AUTO-COMPLETE-NZB : Now checking the active queue of nzbget for the download
   2122 02-Aug-2018 02:08:12 - DEBUG   :: mylar.processor.102 : AUTO-COMPLETE-NZB : valid queue result returned. Analyzing...
   2123 02-Aug-2018 02:08:12 - WARNING :: mylar.processor.105 : AUTO-COMPLETE-NZB : Unable to locate NZBID 3874 in active queue. Could it be finished already ?
   2124 02-Aug-2018 02:08:13 - DEBUG   :: mylar.historycheck.157 : AUTO-COMPLETE-NZB : found matching completed item in history. Job has a status of SUCCESS/HEALTH
   2125 02-Aug-2018 02:08:13 - WARNING :: mylar.historycheck.198 : AUTO-COMPLETE-NZB : no file found where it should be @ /mnt/skytopcliff/completed/comics/X-Men.Gold.Annual.002.2018.Digital.Zone-Empire - is there another script that moves things after completion ?
   2126 02-Aug-2018 02:08:13 - INFO    :: mylar.nzb_monitor.3051 : AUTO-COMPLETE-NZB : Could not find NZBID 3874 in the downloader's queue. I will requeue this item for post-processing...
   2127 02-Aug-2018 02:08:18 - INFO    :: mylar.nzb_monitor.3036 : AUTO-COMPLETE-NZB : Now loading from queue: {'status': True, 'apicall': True, 'NZBID': 3874, 'issueid': u'678546', 'comicid': u'100603'}

Looking at the code, I'm fairly confident that the issue is in line 175 of nzbget.py:

if all(['SUCCESS' in hq[0]['Status'], hq[0]['DownloadedSizeMB'] == hq[0]['FileSizeMB']]):

My theory: We have success, but I'm thinking NZBGet's reported dowloaded size is differing from the actual size due to disk geometry/block size or something tricky...

barbequesauce commented 6 years ago

Just had it happen again. NZBGet reporting 34.9MB

$ ls -al
total 34680
drwxrwxrwx+ 2 nzbget nzbget     4096 Aug  2 12:55 .
drwxrwxrwx+ 5 nzbget nzbget    12288 Aug  2 12:55 ..
-rw-rw-rw-  1 nzbget nzbget 35493483 Aug  2 12:55 Mister Miracle 010 (2018) (digital) (Oroboros-DCP).cbr
barbequesauce commented 6 years ago

Possible fix in #2064