evilhero / mylar

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

Error 500 on NZBtoMedia call #2051

Closed 11001010111111101011101010111110 closed 6 years ago

11001010111111101011101010111110 commented 6 years ago

NZBtoMedia outputs the following log when called, due to an HTTP 500 from Mylar on Re-Processing trigger from NZBGet. I am reprocessing because processing often fails (presumably for the same reasons).

2018-08-10 18:34:04 INFO    ::MAIN: #########################################################
2018-08-10 18:34:04 INFO    ::MAIN: ## ..::[nzbToMedia.pyc]::.. ##
2018-08-10 18:34:04 INFO    ::MAIN: #########################################################
2018-08-10 18:34:04 INFO    ::MAIN: Script triggered from NZBGet Version 20.0.
2018-08-10 18:34:04 INFO    ::MAIN: Auto-detected SECTION:Mylar
2018-08-10 18:34:04 INFO    ::MAIN: Calling Mylar:Comics to post-process:HIDDEN_TITLE
2018-08-10 18:34:04 POSTPROCESS::MYLAR: <!DOCTYPE html PUBLIC
2018-08-10 18:34:04 POSTPROCESS::MYLAR: "-//W3C//DTD XHTML 1.0 Transitional//EN"
2018-08-10 18:34:05 POSTPROCESS::MYLAR: "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
2018-08-10 18:34:05 POSTPROCESS::MYLAR: <html>
2018-08-10 18:34:05 POSTPROCESS::MYLAR: <head>
2018-08-10 18:34:05 POSTPROCESS::MYLAR:     <meta http-equiv="Content-Type" content="text/html; charset=utf-8"></meta>
2018-08-10 18:34:05 POSTPROCESS::MYLAR:     <title>500 Internal Server Error</title>
2018-08-10 18:34:05 POSTPROCESS::MYLAR:     <style type="text/css">
2018-08-10 18:34:05 POSTPROCESS::MYLAR:     #powered_by {
2018-08-10 18:34:05 POSTPROCESS::MYLAR:         margin-top: 20px;
2018-08-10 18:34:05 POSTPROCESS::MYLAR:         border-top: 2px solid black;
2018-08-10 18:34:05 POSTPROCESS::MYLAR:         font-style: italic;
2018-08-10 18:34:05 POSTPROCESS::MYLAR:     }
2018-08-10 18:34:05 POSTPROCESS::MYLAR:     #traceback {
2018-08-10 18:34:05 POSTPROCESS::MYLAR:         color: red;
2018-08-10 18:34:05 POSTPROCESS::MYLAR:     }
2018-08-10 18:34:05 POSTPROCESS::MYLAR:     </style>
2018-08-10 18:34:05 POSTPROCESS::MYLAR: </head>
2018-08-10 18:34:05 POSTPROCESS::MYLAR:     <body>
2018-08-10 18:34:05 POSTPROCESS::MYLAR:         <h2>500 Internal Server Error</h2>
2018-08-10 18:34:05 POSTPROCESS::MYLAR:         <p>The server encountered an unexpected condition which prevented it from fulfilling the request.</p>
2018-08-10 18:34:05 POSTPROCESS::MYLAR:         <pre id="traceback">Traceback (most recent call last):
2018-08-10 18:34:05 POSTPROCESS::MYLAR:   File "/app/mylar/lib/cherrypy/_cprequest.py", line 670, in respond
2018-08-10 18:34:05 POSTPROCESS::MYLAR:     response.body = self.handler()
2018-08-10 18:34:05 POSTPROCESS::MYLAR:   File "/app/mylar/lib/cherrypy/lib/encoding.py", line 260, in __call__
2018-08-10 18:34:05 POSTPROCESS::MYLAR:     ct.params['charset'] = self.find_acceptable_charset()
2018-08-10 18:34:05 POSTPROCESS::MYLAR:   File "/app/mylar/lib/cherrypy/lib/encoding.py", line 161, in find_acceptable_charset
2018-08-10 18:34:05 POSTPROCESS::MYLAR:     if encoder(encoding):
2018-08-10 18:34:05 POSTPROCESS::MYLAR:   File "/app/mylar/lib/cherrypy/lib/encoding.py", line 110, in encode_string
2018-08-10 18:34:05 POSTPROCESS::MYLAR:     for chunk in self.body:
2018-08-10 18:34:05 POSTPROCESS::MYLAR:   File "/app/mylar/mylar/webserve.py", line 801, in post_process
2018-08-10 18:34:05 POSTPROCESS::MYLAR:     PostProcess = PostProcessor.PostProcessor(nzb_name, nzb_folder, queue=queue)
2018-08-10 18:34:05 POSTPROCESS::MYLAR: TypeError: __init__() should return None, not 'dict'
2018-08-10 18:34:05 POSTPROCESS::MYLAR: </pre>
2018-08-10 18:34:05 POSTPROCESS::MYLAR:     <div id="powered_by">
2018-08-10 18:34:05 POSTPROCESS::MYLAR:       <span>
2018-08-10 18:34:05 POSTPROCESS::MYLAR:         Powered by <a href="http://www.cherrypy.org">CherryPy 3.6.0</a>
2018-08-10 18:34:05 POSTPROCESS::MYLAR:       </span>
2018-08-10 18:34:05 POSTPROCESS::MYLAR:     </div>
2018-08-10 18:34:05 POSTPROCESS::MYLAR:     </body>
2018-08-10 18:34:05 POSTPROCESS::MYLAR: </html>
2018-08-10 18:34:05 ERROR   ::MYLAR: Server returned status 500
2018-08-10 18:34:05 ERROR   ::MAIN: A problem was reported in the /volume1/downloads/scripts/nzbToMedia/nzbToMylar.py script.

In Mylar, I get this (for this comic and others):


2018-08-10 18:36:40 | INFO | Could not find NZBID 20313 in the downloader's queue. I will requeue this item for post-processing...
-- | -- | --
2018-08-10 18:36:40 | WARNING | Could not find completed NZBID 20313 in history
2018-08-10 18:36:39 | WARNING | Unable to locate NZBID 20313 in active queue. Could it be finished already ?
2018-08-10 18:36:39 | DEBUG | valid queue result returned. Analyzing...
2018-08-10 18:36:39 | DEBUG | Now checking the active queue of nzbget for the download
2018-08-10 18:36:39 | INFO | Now loading from queue: {'status': True, 'apicall': True, 'NZBID': 20313, 'issueid': u'679274', 'comicid': u'109114'}

Any idea on what could be going on? Or how I can help diagnose?

barbequesauce commented 6 years ago

Do you have "Enable completed download handling" enabled in Mylar? Usually these kinds of "could not find" messages in pp are related to arguing post-processing scripts - usually CDH and ComicRN, but I could see NZBtoMedia causing a similar issue...

If that's not the case and you don't have both CDH and NZBtoMedia configured to act on the files at the same time, post the debug log file (not from the web interface, as there is additional detail in the file)...

11001010111111101011101010111110 commented 6 years ago

That fixed it, @barbequesauce , thank you. I am not sure what I am losing by unchecking "Enable completed download handling" but that did it.

barbequesauce commented 6 years ago

You're not losing anything by unchecking it - NZBtoMedia and Completed Download Handling do the same thing, it's just two ways to do it. If you enable both, they bang heads when processing... gotta pick one and stick with it.

11001010111111101011101010111110 commented 6 years ago

Gotcha, thank you.