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

Can't Search For Series #1144

Closed wraith1385 closed 3 years ago

wraith1385 commented 8 years ago

Hello, I'm getting the error below whenever I try to search for a series.

500 Internal Server Error

The server encountered an unexpected condition which prevented it from fulfilling the request.

Traceback (most recent call last): File "C:\Mylar\cherrypy_cprequest.py", line 645, in respond response.body = self.handler() File "C:\Mylar\cherrypy\lib\encoding.py", line 188, in call self.body = self.oldhandler(_args, _kwargs) File "C:\Mylar\cherrypy_cpdispatch.py", line 29, in call return self.callable(_self.args, _self.kwargs) File "C:\Mylar\mylar\webserve.py", line 199, in searchit searchresults, explicit = mb.findComic(name, mode, issue=issue) File "C:\Mylar\mylar\mb.py", line 132, in findComic searched = pullsearch(comicapi, comicquery, 0, explicit, type) File "C:\Mylar\mylar\mb.py", line 83, in pullsearch dom = parseString(data) File "C:\Python27\lib\xml\dom\minidom.py", line 1928, in parseString return expatbuilder.parseString(string) File "C:\Python27\lib\xml\dom\expatbuilder.py", line 940, in parseString return builder.parseString(string) File "C:\Python27\lib\xml\dom\expatbuilder.py", line 223, in parseString parser.Parse(string, True) ExpatError: no element found: line 2, column 5373

evilhero commented 8 years ago

What series are you searching for?

Are you using your own comicvine api key? Is it being used in another application other than mylar ?

What does the mylar.log file show prior to the error getting logged? Anything about http related errors or the like?

wraith1385 commented 8 years ago

I got the error when searching for Chewbacca, New Avengers, and Guardians of the Galaxy.

I'm using my own Comicvine API key, ComicRack uses this key too, but it's not even running right now.

There are no errors in the mylar.log file.

evilhero commented 8 years ago

Can you paste in what is happening prior to the error from the mylar.log file?

They've limited api usage abit lately and sharing api key amongst apps while normally shouldn't be a problem seems to be causing some issues with particular apps.

It might be that they're doing something with the api atm and it's causing problems ( they patched something or 'fixed' something or its just offline )

wraith1385 commented 8 years ago

I'm not sure how helpful it is, but here's what I see.

18-Oct-2015 21:04:59 - DEBUG :: CP Server Thread-9 : Default search mode - this will match on ALL search words 18-Oct-2015 21:05:03 - DEBUG :: CP Server Thread-9 : Default search mode - this will match on ALL search words 18-Oct-2015 21:05:08 - DEBUG :: CP Server Thread-9 : Default search mode - this will match on ALL search words 18-Oct-2015 21:25:27 - DEBUG :: CP Server Thread-5 : Default search mode - this will match on ALL search words 18-Oct-2015 21:25:37 - DEBUG :: CP Server Thread-5 : Default search mode - this will match on ALL search words 18-Oct-2015 21:25:44 - DEBUG :: CP Server Thread-5 : Default search mode - this will match on ALL search words 18-Oct-2015 21:25:45 - DEBUG :: CP Server Thread-10 : Default search mode - this will match on ALL search words

evilhero commented 8 years ago

That doesn't look right...there should be text between each of those lines.

What version of python are you running?

Are you on the latest commit of either the master or development branch of mylar?

wraith1385 commented 8 years ago

I'm on python 2.7.10 and according to mylar there are no updates for the development branch. I'm on build 60140e8c900ae6c2acc3c9bf319506b6514fbed4

evilhero commented 8 years ago

Can you browse to comicvine's website without any issues?

wraith1385 commented 8 years ago

Yes, it also appears that I can successfully scrape series info using the api in comicrack.

evilhero commented 8 years ago

Do you have more than one instance of mylar running simultaneously? Have you restarted mylar since receiving the error?

Sorry this type of error is really hard to troubleshoot without so many questions being asked...

I'm still able to search fine so it might appear to be some localized to your installation. Just need to figure out what's causing the problem.

wraith1385 commented 8 years ago

As far as I know I only have on instance running. I restarted mylar earlier and I just now restarted my entire computer, but I'm still receiving the error.

evilhero commented 8 years ago

Ok this is gonna seem any drastic but it will tell you possibly what's happening.

First shutdown mylar. Then go into the mylar/mylar directory and copy the mb.py file to a different location (or copy/rename it).

Then to the original mb.py file, open it up in an editor and on line 64 (roughly) you should see the following:

logger.info('PULLURL:' + PULLURL)

Delete the # from the line and make sure the logger.. part lines up column wise with the other lines (spacing matters in python).

Save the file, start up mylar and then try the search again.

You'll be able to see the actual url that mylar is sending to comicvine in the logs. Copy that url directly into a browser and see what it spits back ;)

wraith1385 commented 8 years ago

I'll try that as soon as I get home from work tomorrow.

wraith1385 commented 8 years ago

Ok so here's the URL I got - http://api.comicvine.com/search?api_key=blankedout&resources=volume&query=DARTH%20AND%20VADER&field_list=id,name,start_year,first_issue,site_detail_url,count_of_issues,image,publisher,deck,description&format=xml&page=0

When I plug that into a browser I get a page that says "This XML file does not appear to have any style information associated with it. The document tree is shown below." at the top and then has a fairly large XML tree. I can post that if you want but it's long.

evilhero commented 8 years ago

Yeah the doc is normal xml so it should be translated by mylar just fine (it works for me).

How exactly are you running mylar (or starting it)? It appears it's something definitely local to your install - as you can retrieve the api xml request just fine.

wraith1385 commented 8 years ago

I'm just starting it through the .vbs file.

evilhero commented 8 years ago

Umm mylar doesn't come with a .vbs ;)

wraith1385 commented 8 years ago

Sorry the vbs file contains this:

Set WshShell = CreateObject("WScript.Shell") WshShell.Run chr(34) & "C:\Mylar\Mylar.py" & Chr(34), 0 Set WshShell = Nothing

evilhero commented 8 years ago

Ok so you're running it as a daemon.

Can you try directly running it from a command prompt (or thru the git shell) - just cd into the mylar root directory and then type in 'python Mylar.py'

Don't close the cmd window as all the console logging will be displayed in the window as well - when you do a search it might pop up a console error.

wraith1385 commented 8 years ago

I don't see any errors in the command prompt, I still get the error when searching most series, but some reason the one below works fine.

19-Oct-2015 21:15:18 - INFO :: CP Server Thread-6 : PULLURL:http://api.comicvine .com/search?api_key=280182eaca6d6b35395c63388709938a1a40f9e3&resources=volume&qu ery=UNCANNY%20AND%20INHUMANS&field_list=id,name,start_year,first_issue,site_deta il_url,count_of_issues,image,publisher,deck,description&format=xml&page=0

evilhero commented 8 years ago

Very weird if it's sporadic. You said you're running python2.7.10 can you verify on the configuring screen /1st tab that it's correct?

Are you running a particular type of python (Iron Python, etc)?

Also how did you install mylar - via git or from source?

wraith1385 commented 8 years ago

Python Version : 2.7.10

And no, no particular type. This worked fine last week.

evilhero commented 8 years ago

Weird thing is there hasn't been an update to the dev branch in almost 2 weeks - and the last commit, which you're on, has no reference to using the mb.py file.

Did you do any updates for python or similar as of late?

You could always try reinstalling via git/source to ensure you have a clean copy.

Just make sure to backup your existing config.ini, mylar.db and your cache folder (for comic images).

wraith1385 commented 8 years ago

I haven't updated anything. I'll try to reinstall tomorrow.

wraith1385 commented 8 years ago

I backed up the files you said to, completely deleted my Mylar folder, reinstalled using git, restored the files that I backed up and still get the same problem.

tycho5 commented 8 years ago

I'm getting the same issue as well. I'm running this in CentOS 7, simply running ./Mylar.py &

It's super weird as I was using Mylar extensively last night (had to rebuild my collection after I accidentally deleted it). It was working fine then I go to add some comics tonight and I start getting 500 errors when hitting enter or search.

500 Internal Server Error

The server encountered an unexpected condition which prevented it from fulfilling the request.

Traceback (most recent call last): File "/root/mylar/cherrypy/_cprequest.py", line 645, in respond response.body = self.handler() File "/root/mylar/cherrypy/lib/encoding.py", line 188, in call self.body = self.oldhandler(_args, _kwargs) File "/root/mylar/cherrypy/_cpdispatch.py", line 29, in call return self.callable(_self.args, _self.kwargs) File "/root/mylar/mylar/webserve.py", line 205, in searchit searchresults, explicit = mb.findComic(name, mode, issue=None, explicit=explicit) File "/root/mylar/mylar/mb.py", line 129, in findComic searched = pullsearch(comicapi, comicquery, 0, explicit, type) File "/root/mylar/mylar/mb.py", line 68, in pullsearch file = urllib2.urlopen(PULLURL) File "/usr/lib64/python2.7/urllib2.py", line 127, in urlopen return _opener.open(url, data, timeout) File "/usr/lib64/python2.7/urllib2.py", line 404, in open response = self._open(req, data) File "/usr/lib64/python2.7/urllib2.py", line 422, in _open '_open', req) File "/usr/lib64/python2.7/urllib2.py", line 382, in _call_chain result = func(*args) File "/usr/lib64/python2.7/urllib2.py", line 1216, in http_open return self.do_open(httplib.HTTPConnection, req) File "/usr/lib64/python2.7/urllib2.py", line 1186, in do_open raise URLError(err) URLError: <urlopen error [Errno -2] Name or service not known>

tcn33 commented 8 years ago

Same thing here as the previous poster. Ran fine last week, doesn't work today. No updates to anything at all (until i updated Mylar from two commits behind in an effort to fix the issue - it didn't). Seems to point to an external cause.

evilhero commented 8 years ago

@tcn33 : the URLError message was in relation to an incorrect api url that was being used throughout Mylar. The commit that went up late yesterday changed it to the correct url.

What commit / branch of Mylar are you currently running ?

tcn33 commented 8 years ago

I'm on the development branch, caa8654b4a5256d8e1fc8de5f9695d5d148575e5.

evilhero commented 8 years ago

Yep, you're a few commits behind still (2 commits).

Current development commit that has the fix is : 72065be

tcn33 commented 8 years ago

Yep, looks like I updated but it didn't take until I restarted from the Mylar gui rather than restarting the service from the command line. Thanks :+1:

wraith1385 commented 8 years ago

I didn't realize there was an update, but when I try to update from Mylar it doesn't work and I see this error in the logs.

28-Oct-2015 20:47:22 - DEBUG :: MAIN : Trying to execute: "git pull origin development" with shell in C:\Mylar 28-Oct-2015 20:47:23 - DEBUG :: MAIN : Git output: m.AllocationBase 0x0, m.BaseAddress 0xE10000, m.RegionSize 0x70000, m.State 0x10000 C:\Program Files (x86)\Git\bin\sh.exe: * Couldn't reserve space for cygwin's heap (0xE10000 <0xE90000>) in child, Win32 error 0 0 [main] sh.exe" 26712 sync_with_child: child 27160(0x148) died before initialization with status code 0x1 90 [main] sh.exe" 26712 sync_with_child: * child state waiting for longjmp /libexec/git-core/git-sh-setup: fork: Resource temporarily unavailable

wraith1385 commented 8 years ago

Never mind, I decided to actually read the error and realized it was a git problem. Updated now and it looks like that fixed my issue as well.

wraith1385 commented 8 years ago

Hello, I updated today to the most recent dev update and I am once again getting these errors when searching for series.

500 Internal Server Error

The server encountered an unexpected condition which prevented it from fulfilling the request.

Traceback (most recent call last): File "C:\Mylar\cherrypy_cprequest.py", line 645, in respond response.body = self.handler() File "C:\Mylar\cherrypy\lib\encoding.py", line 188, in call self.body = self.oldhandler(_args, _kwargs) File "C:\Mylar\cherrypy_cpdispatch.py", line 29, in call return self.callable(_self.args, _self.kwargs) File "C:\Mylar\mylar\webserve.py", line 199, in searchit searchresults, explicit = mb.findComic(name, mode, issue=issue) File "C:\Mylar\mylar\mb.py", line 132, in findComic searched = pullsearch(comicapi, comicquery, 0, explicit, type) File "C:\Mylar\mylar\mb.py", line 83, in pullsearch dom = parseString(data) File "C:\Python27\lib\xml\dom\minidom.py", line 1928, in parseString return expatbuilder.parseString(string) File "C:\Python27\lib\xml\dom\expatbuilder.py", line 940, in parseString return builder.parseString(string) File "C:\Python27\lib\xml\dom\expatbuilder.py", line 223, in parseString parser.Parse(string, True) ExpatError: unclosed CDATA section: line 2, column 105848

evilhero commented 8 years ago

I'm not really sure what's going on - the ExpatError would indicate a malformed xml response from CV, which might be related to their api in some way - but I've never seen it before until you posted previously about it.

That was resolved on its own if I'm correct? Aside from that it might have something to do with the parser but seeing as how it fixed itself, and nothing has changed on the parser side since forever it would seem to point back to something at CV happening...