evilhero / mylar

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

Uncaught exception errors on manual search #1578

Closed mcaron1234 closed 7 years ago

mcaron1234 commented 7 years ago

I'm seeing an uncaught exception error in the log often when I do a manual search and no results are found. Here ismy version info:

Mylar Version: development
-- git build 651535581f69c29a5b8aa153754e1a133ffe4098.
Python Version : 2.7.12

I suspect this may be normal when no results arte found, but thought I would post it here in case it is due to a bug. As always, thanks for the great work on Mylar.

2017-02-24 11:53:21 INFO    delaying thread for 60 seconds to avoid locks.
2017-02-24 11:53:20 INFO    [FOLDER-CHECK] Finished checking for newly snatched downloads
2017-02-24 11:53:20 WARNING There were no files located - check the debugging logs if you think this is in error.
2017-02-24 11:53:20 INFO    there are 0 files.
2017-02-24 11:53:20 INFO    [FOLDER-CHECK] Checking folder /home/matt/mounts/downloads/torrent/complete/comics/mylar for newly snatched downloads
2017-02-24 11:53:04 INFO    Could not find Issue 5 of Serenity: No Power In The 'Verse (2016) using experimental [api]
2017-02-24 11:53:01 ERROR   Uncaught exception: Traceback (most recent call last):
File "/opt/Mylar/mylar/logger.py", line 158, in new_run
old_run(*args, **kwargs)
File "/usr/lib/python2.7/threading.py", line 754, in run
self.__target(*self.__args, **self.__kwargs)
File "/opt/Mylar/mylar/webserve.py", line 1417, in queueissue
foundcom, prov = search.search_init(ComicName, ComicIssue, ComicYear, SeriesYear, Publisher, issues['IssueDate'], storedate, IssueID, AlternateSearch, UseAFuzzy, ComicVersion, mode=mode, ComicID=ComicID, manualsearch=manualsearch, filesafe=ComicName_Filesafe, allow_packs=AllowPacks)
File "/opt/Mylar/mylar/search.py", line 238, in search_init
findit = NZB_SEARCH(ComicName, IssueNumber, ComicYear, SeriesYear, Publisher, IssueDate, StoreDate, searchprov, send_prov_count, IssDateFix, IssueID, UseFuzzy, newznab_host, ComicVersion=ComicVersion, SARC=SARC, IssueArcID=IssueArcID, RSS="yes", ComicID=ComicID, issuetitle=issuetitle, unaltered_ComicName=unaltered_ComicName)
File "/opt/Mylar/mylar/search.py", line 1573, in NZB_SEARCH
nzbname = nzbname_create(nzbprov, info=comicinfo, title=ComicTitle) #entry['title'])
File "/opt/Mylar/mylar/search.py", line 1936, in nzbname_create
logger.fdebug("nzbname used for post-processing:" + nzbname)
UnboundLocalError: local variable 'nzbname' referenced before assignment
2017-02-24 11:53:01 INFO    allow_packs:False
2017-02-24 11:53:01 INFO    rss:yes
2017-02-24 11:53:01 INFO    WWT
2017-02-24 11:53:01 INFO    Shhh be very quiet...I'm looking for Lucifer issue: 15 (2017) using TPSE [RSS]
2017-02-24 11:53:01 INFO    allow_packs set to :False
2017-02-24 11:53:01 INFO    Could not find Issue 15 of Lucifer (2015) using 32P [rss]
2017-02-24 11:53:01 INFO    Shhh be very quiet...I'm looking for Lucifer issue: 15 (2017) using 32P [RSS]
2017-02-24 11:53:01 INFO    allow_packs set to :False
2017-02-24 11:53:01 INFO    search provider order is ['32p', 'tpse', 'Experimental']
2017-02-24 11:53:01 INFO    Issue Title given as : blood in the streets part two: little girls lost
2017-02-24 11:53:01 INFO    Initiating manual search for Lucifer issue: 15
2017-02-24 11:52:57 INFO    Shhh be very quiet...I'm looking for Serenity No Power In The Verse issue: 5 (2017) using experimental
2017-02-24 11:52:57 INFO    allow_packs set to :False
2017-02-24 11:52:57 INFO    Alternate Search pattern detected...re-adjusting to : Serenity No Power In The Verse
2017-02-24 11:52:51 ERROR   Uncaught exception: Traceback (most recent call last):
File "/opt/Mylar/mylar/logger.py", line 158, in new_run
old_run(*args, **kwargs)
File "/usr/lib/python2.7/threading.py", line 754, in run
self.__target(*self.__args, **self.__kwargs)
File "/opt/Mylar/mylar/webserve.py", line 1417, in queueissue
foundcom, prov = search.search_init(ComicName, ComicIssue, ComicYear, SeriesYear, Publisher, issues['IssueDate'], storedate, IssueID, AlternateSearch, UseAFuzzy, ComicVersion, mode=mode, ComicID=ComicID, manualsearch=manualsearch, filesafe=ComicName_Filesafe, allow_packs=AllowPacks)
File "/opt/Mylar/mylar/search.py", line 238, in search_init
findit = NZB_SEARCH(ComicName, IssueNumber, ComicYear, SeriesYear, Publisher, IssueDate, StoreDate, searchprov, send_prov_count, IssDateFix, IssueID, UseFuzzy, newznab_host, ComicVersion=ComicVersion, SARC=SARC, IssueArcID=IssueArcID, RSS="yes", ComicID=ComicID, issuetitle=issuetitle, unaltered_ComicName=unaltered_ComicName)
File "/opt/Mylar/mylar/search.py", line 1573, in NZB_SEARCH
nzbname = nzbname_create(nzbprov, info=comicinfo, title=ComicTitle) #entry['title'])
File "/opt/Mylar/mylar/search.py", line 1936, in nzbname_create
logger.fdebug("nzbname used for post-processing:" + nzbname)
UnboundLocalError: local variable 'nzbname' referenced before assignment
2017-02-24 11:52:51 INFO    allow_packs:False
2017-02-24 11:52:51 INFO    rss:yes
2017-02-24 11:52:51 INFO    WWT
2017-02-24 11:52:51 INFO    Shhh be very quiet...I'm looking for Clean Room issue: 16 (2017) using TPSE [RSS]
2017-02-24 11:52:51 INFO    allow_packs set to :False
2017-02-24 11:52:51 INFO    Could not find Issue 16 of Clean Room (2015) using 32P [rss]
2017-02-24 11:52:51 INFO    Shhh be very quiet...I'm looking for Clean Room issue: 16 (2017) using 32P [RSS]
2017-02-24 11:52:51 INFO    allow_packs set to :False
2017-02-24 11:52:51 INFO    search provider order is ['32p', 'tpse', 'Experimental']
2017-02-24 11:52:51 INFO    Issue Title given as : assisted living
2017-02-24 11:52:51 INFO    Initiating manual search for Clean Room issue: 16
2017-02-24 11:52:49 INFO    Shhh be very quiet...I'm looking for Serenity: No Power In The 'Verse issue: 5 (2017) using experimental
2017-02-24 11:52:49 INFO    allow_packs set to :False
2017-02-24 11:52:49 INFO    Could not find Issue 5 of Serenity: No Power In The 'Verse (2016) using TPSE [api]
2017-02-24 11:52:49 INFO    [TPSE] there were 7 results..
2017-02-24 11:52:44 ERROR   Uncaught exception: Traceback (most recent call last):
File "/opt/Mylar/mylar/logger.py", line 158, in new_run
old_run(*args, **kwargs)
File "/usr/lib/python2.7/threading.py", line 754, in run
self.__target(*self.__args, **self.__kwargs)
File "/opt/Mylar/mylar/webserve.py", line 1417, in queueissue
foundcom, prov = search.search_init(ComicName, ComicIssue, ComicYear, SeriesYear, Publisher, issues['IssueDate'], storedate, IssueID, AlternateSearch, UseAFuzzy, ComicVersion, mode=mode, ComicID=ComicID, manualsearch=manualsearch, filesafe=ComicName_Filesafe, allow_packs=AllowPacks)
File "/opt/Mylar/mylar/search.py", line 238, in search_init
findit = NZB_SEARCH(ComicName, IssueNumber, ComicYear, SeriesYear, Publisher, IssueDate, StoreDate, searchprov, send_prov_count, IssDateFix, IssueID, UseFuzzy, newznab_host, ComicVersion=ComicVersion, SARC=SARC, IssueArcID=IssueArcID, RSS="yes", ComicID=ComicID, issuetitle=issuetitle, unaltered_ComicName=unaltered_ComicName)
File "/opt/Mylar/mylar/search.py", line 1573, in NZB_SEARCH
nzbname = nzbname_create(nzbprov, info=comicinfo, title=ComicTitle) #entry['title'])
File "/opt/Mylar/mylar/search.py", line 1936, in nzbname_create
logger.fdebug("nzbname used for post-processing:" + nzbname)
UnboundLocalError: local variable 'nzbname' referenced before assignment
2017-02-24 11:52:44 INFO    allow_packs:False
2017-02-24 11:52:44 INFO    rss:yes
2017-02-24 11:52:44 INFO    WWT
2017-02-24 11:52:44 INFO    Shhh be very quiet...I'm looking for Black Panther issue: 11 (2017) using TPSE [RSS]
2017-02-24 11:52:44 INFO    allow_packs set to :False
2017-02-24 11:52:44 INFO    Could not find Issue 11 of Black Panther (2016) using 32P [rss]
2017-02-24 11:52:44 INFO    Shhh be very quiet...I'm looking for Black Panther issue: 11 (2017) using 32P [RSS]
2017-02-24 11:52:44 INFO    allow_packs set to :False
2017-02-24 11:52:44 INFO    search provider order is ['32p', 'tpse', 'Experimental']
2017-02-24 11:52:44 INFO    Issue Title given as : a nation under our feet conclusion
2017-02-24 11:52:44 INFO    Initiating manual search for Black Panther issue: 11
2017-02-24 11:52:43 INFO    [TPSE] there were 0 results..
2017-02-24 11:52:37 INFO    [TPSE] there were 1 results..
2017-02-24 11:52:34 ERROR   Uncaught exception: Traceback (most recent call last):
File "/opt/Mylar/mylar/logger.py", line 158, in new_run
old_run(*args, **kwargs)
File "/usr/lib/python2.7/threading.py", line 754, in run
self.__target(*self.__args, **self.__kwargs)
File "/opt/Mylar/mylar/webserve.py", line 1417, in queueissue
foundcom, prov = search.search_init(ComicName, ComicIssue, ComicYear, SeriesYear, Publisher, issues['IssueDate'], storedate, IssueID, AlternateSearch, UseAFuzzy, ComicVersion, mode=mode, ComicID=ComicID, manualsearch=manualsearch, filesafe=ComicName_Filesafe, allow_packs=AllowPacks)
File "/opt/Mylar/mylar/search.py", line 238, in search_init
findit = NZB_SEARCH(ComicName, IssueNumber, ComicYear, SeriesYear, Publisher, IssueDate, StoreDate, searchprov, send_prov_count, IssDateFix, IssueID, UseFuzzy, newznab_host, ComicVersion=ComicVersion, SARC=SARC, IssueArcID=IssueArcID, RSS="yes", ComicID=ComicID, issuetitle=issuetitle, unaltered_ComicName=unaltered_ComicName)
File "/opt/Mylar/mylar/search.py", line 1573, in NZB_SEARCH
nzbname = nzbname_create(nzbprov, info=comicinfo, title=ComicTitle) #entry['title'])
File "/opt/Mylar/mylar/search.py", line 1936, in nzbname_create
logger.fdebug("nzbname used for post-processing:" + nzbname)
UnboundLocalError: local variable 'nzbname' referenced before assignment
2017-02-24 11:52:34 INFO    allow_packs:False
2017-02-24 11:52:34 INFO    rss:yes
2017-02-24 11:52:34 INFO    WWT
2017-02-24 11:52:34 INFO    Shhh be very quiet...I'm looking for Astro City issue: 41 (2017) using TPSE [RSS]
2017-02-24 11:52:34 INFO    allow_packs set to :False
2017-02-24 11:52:34 INFO    Could not find Issue 41 of Astro City (2013) using 32P [rss]
2017-02-24 11:52:34 INFO    Shhh be very quiet...I'm looking for Astro City issue: 41 (2017) using 32P [RSS]
2017-02-24 11:52:34 INFO    allow_packs set to :False
2017-02-24 11:52:34 INFO    search provider order is ['32p', 'tpse', 'Experimental']
2017-02-24 11:52:34 INFO    Issue Title given as : the sky's the limit
2017-02-24 11:52:34 INFO    Initiating manual search for Astro City issue: 41
2017-02-24 11:52:31 INFO    Shhh be very quiet...I'm looking for Serenity No Power In The Verse issue: 5 (2017) using TPSE
2017-02-24 11:52:31 INFO    allow_packs set to :False
2017-02-24 11:52:31 INFO    Alternate Search pattern detected...re-adjusting to : Serenity No Power In The Verse
2017-02-24 11:52:31 INFO    [TPSE] there were 3 results..
2017-02-24 11:52:25 INFO    [TPSE] there were 0 results..
2017-02-24 11:52:24 ERROR   Uncaught exception: Traceback (most recent call last):
File "/opt/Mylar/mylar/logger.py", line 158, in new_run
old_run(*args, **kwargs)
File "/usr/lib/python2.7/threading.py", line 754, in run
self.__target(*self.__args, **self.__kwargs)
File "/opt/Mylar/mylar/webserve.py", line 1417, in queueissue
foundcom, prov = search.search_init(ComicName, ComicIssue, ComicYear, SeriesYear, Publisher, issues['IssueDate'], storedate, IssueID, AlternateSearch, UseAFuzzy, ComicVersion, mode=mode, ComicID=ComicID, manualsearch=manualsearch, filesafe=ComicName_Filesafe, allow_packs=AllowPacks)
File "/opt/Mylar/mylar/search.py", line 238, in search_init
findit = NZB_SEARCH(ComicName, IssueNumber, ComicYear, SeriesYear, Publisher, IssueDate, StoreDate, searchprov, send_prov_count, IssDateFix, IssueID, UseFuzzy, newznab_host, ComicVersion=ComicVersion, SARC=SARC, IssueArcID=IssueArcID, RSS="yes", ComicID=ComicID, issuetitle=issuetitle, unaltered_ComicName=unaltered_ComicName)
File "/opt/Mylar/mylar/search.py", line 1573, in NZB_SEARCH
nzbname = nzbname_create(nzbprov, info=comicinfo, title=ComicTitle) #entry['title'])
File "/opt/Mylar/mylar/search.py", line 1936, in nzbname_create
logger.fdebug("nzbname used for post-processing:" + nzbname)
UnboundLocalError: local variable 'nzbname' referenced before assignment
2017-02-24 11:52:24 INFO    allow_packs:False
2017-02-24 11:52:24 INFO    rss:yes
2017-02-24 11:52:24 INFO    WWT
2017-02-24 11:52:24 INFO    Shhh be very quiet...I'm looking for Descender issue: 19 (2017) using TPSE [RSS]
2017-02-24 11:52:24 INFO    allow_packs set to :False
2017-02-24 11:52:24 INFO    Could not find Issue 19 of Descender (2015) using 32P [rss]
2017-02-24 11:52:24 INFO    Shhh be very quiet...I'm looking for Descender issue: 19 (2017) using 32P [RSS]
2017-02-24 11:52:24 INFO    allow_packs set to :False
2017-02-24 11:52:24 INFO    search provider order is ['32p', 'tpse', 'Experimental']
2017-02-24 11:52:24 INFO    Issue Title given as : orbital mechanics part three
2017-02-24 11:52:24 INFO    Initiating manual search for Descender issue: 19
evilhero commented 7 years ago

Do you have a usenet client enabled for mylar?

It might be erroring out on wwt/dem/TPSE - can you put mylar into verbose mode and try the search again. I can't tell if it's trying to use an empty search result or its assuming there isn't one for some reason.

mcaron1234 commented 7 years ago

Sorry for my delay in getting back to you.

No I don't have any usenet clients (I only use torrents). Sorry that log snippet I posted above wasn't in verbose mode. Here is a new log in verbose: http://pastebin.com/RdGfJLZU

That log is with -- git build 44a92cacec2f864d4029030727e48e8fb00b3722

evilhero commented 7 years ago

Well the problem is that the experimental search option is for nzbs (usenet) - so it's erroring out due to not being able to find the necessary usenet client information. I'll have to address this in an upcoming commit, but in the meantime the simple solution is to just disable the experimental search, save the config, and restart mylar do the new settings take effect properly.

mcaron1234 commented 7 years ago

I didn't realize experimental search was just for usenet.

I have unchecked that option, saved the config and restarted mylar. The option shows as unchecked in the UI but when I do a manual search I am still getting the uncaught exception error. Here is a new log: http://pastebin.com/zmfb8U1J

mcaron1234 commented 7 years ago

I just realized that a number of those manual searches in the above posted logs, actually have results on 32P which aren't being found. For sure Paper Girls 12 and The Woods 30 are on 32P but aren't being found by Mylar. Can I give you any more info to help you track this down?

evilhero commented 7 years ago

It probably is dependent on what mode you're using with 32p and mylar. For backlog searches and to use proper backend searching, you need to use auth mode for 32p.

If you're just using legacy mode, it will only search against the Rss feeds that you have when mylar is running (if you don't have individual feeds setup at 32p, then it just monitors the main rss feed so it's possible that it's been missed)

mcaron1234 commented 7 years ago

I have always used auth mode with 32P, so in this case that's not the issue.

mcaron1234 commented 7 years ago

Here is another log with the uncaught exception error and not finding a result from 32P which is present on the site: http://pastebin.com/8CUBc3hp

Thanks for your help with this!

evilhero commented 7 years ago

Well it's finding the issue(s) according to the log (and based on my quick tests, I was able to pull from those issues with no problems), it's just erroring out for some reason. There's a few things to note:

evilhero commented 7 years ago

Not sure if that will fix your exact problems, but the commit that just went up will fix the problem with the blackhole method being enabled (which is only for usenet), and search results being returned from torrent sites. Based on what I could gather, it would appear that you would need this fix based on your settings - but again, until you actually test it, we won't know for sure ...

mcaron1234 commented 7 years ago

Weird. Yeah, for some reason I can't connect to github (this is a new error). Can I just shutdown Mylar and go to the install directory and due a "git pull origin development"?

evilhero commented 7 years ago

As long as your git is on dev (git status will show your active branch), you should be able to do just a 'git pull', but to your question yes, you can manually pull from the installation directory.

mcaron1234 commented 7 years ago

OK so I did a manual git pull and was able to update to the latest commit.

To answer your questions I am using the watchdir method for torrents, but have the blackhole method checked for usenet. I don't see a way to not select anything for usenet. Here is my config.ini (suitably redacted, of course): http://pastebin.com/diYT65g4

Here is the log: http://pastebin.com/b0MrASRU

evilhero commented 7 years ago

Ok, latest dev commit should fix the error you're gettng now (different than the initial one and due to my first patch)...

And it wasn't that you had an option toggled with usenet, it was actually due to using the black hole method for usenet and using torrents as well (using both are normal so that's not unheard of). Simply selecting any other usenet option than the black hole would stop that error.

I should really add in a toggle box to enable/disable usenet/torrents in a simpler manner than what it currently is.

mcaron1234 commented 7 years ago

Yes! Now things are downloading correctly, and the uncaught exception error is gone. Thanks so much!

Any idea why I Mylar can't connect to github? I just checked and headphones running on the same machine is able to connect to github.

evilhero commented 7 years ago

Sometimes if you restart mylar alot it checks github on every startup - you might have just triggered some anti-hammering thing they have and it will start to work again within the hr.

Otherwise, if you were doing git commands from the repo it's possible you switched the git branch to a localized repo and it's messing up finding the correct one against github now.

The only fix that I can think of if it's that is to do a clean install tho (backup your config.ini, mylar.db and entire cache folder first so that you can move it back after a reinstall and resume normal operation).