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

Error when adding/updating story arcs #1509

Closed mattswest closed 3 years ago

mattswest commented 7 years ago

500 Internal Server Error

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

Traceback (most recent call last):
  File "/opt/mylar/lib/cherrypy/_cprequest.py", line 645, in respond
    response.body = self.handler()
  File "/opt/mylar/lib/cherrypy/lib/encoding.py", line 188, in __call__
    self.body = self.oldhandler(*args, **kwargs)
  File "/opt/mylar/lib/cherrypy/_cpdispatch.py", line 29, in __call__
    return self.callable(*self.args, **self.kwargs)
  File "/opt/mylar/mylar/webserve.py", line 2840, in ArcWatchlist
    logger.fdebug('ARC-seriesyear: ' + str(int(arc['SeriesYear'])))
ValueError: invalid literal for int() with base 10: 'None'

This error happens when adding some story arcs and when searching for watchlist matches for those story arcs.

When adding the story arc it ends up on a page with this error. When searching for watchlist matches it just says error in a red box in the bottom right, and in the browser console it says,

GET http://192.168.1.190:8090/ArcWatchlist?StoryArcID=55707 500 (Internal Server Error)

Nothing shows up in the Mylar logs.

evilhero commented 7 years ago

Are you running the master or dev branch of mylar and is it up to date?

mattswest commented 7 years ago

I tried both and it didn't change anything.

I also set up a new install and dropped in the mylar.db and config.ini and it still did it.

However, when I set up a new install and only dropped in the config.ini, the story arc was able to add without issue.

evilhero commented 7 years ago

You probably have an abandoned story arc that is named the same as what you're trying to add. If the .db file is causing the problem, it would point to that as being the issue.

I'll have to push out a fix for deleting the stale entries, but it will probably be a few days before I can get it out.

You can try manually removing it from the dB if you're inclined to try. I can give you the commands that would remove the entries, I'd just need to know the arc that you're having problems with.

mattswest commented 7 years ago

I was thinking it was probably some bad entries in the database, but I'm not sure it's the story arc.

When adding the story arc, while it does go to an error page, the story arc is nonetheless added successfully.

It seems to me like after it adds the arc, it goes to check for watchlist matches, and that's when the error occurs.

DJNoan commented 7 years ago

I don't know if my issue with story arcs is related. If there's a way to edit the DB without the interface i'd give it a shot. first one refuses to add the directory. adding second error is updating. updating

mattswest commented 7 years ago

I checked again and some of the story arcs are creating different errors.

One of the story arcs had an error identical to the second one you posted. I went to check the directory and Mylar had the directory format set to '$arc ($spanyears)' when my actual directories did not have the spanyears in the directory name.

After changing the format set in Mylar to just $arc, the error for that story arc changed to this:

Traceback (most recent call last):
  File "/opt/mylar/lib/cherrypy/_cprequest.py", line 645, in respond
    response.body = self.handler()
  File "/opt/mylar/lib/cherrypy/lib/encoding.py", line 188, in __call__
    self.body = self.oldhandler(*args, **kwargs)
  File "/opt/mylar/lib/cherrypy/_cpdispatch.py", line 29, in __call__
    return self.callable(*self.args, **self.kwargs)
  File "/opt/mylar/mylar/webserve.py", line 2893, in ArcWatchlist
    loc_path = os.path.join(tmpfc['ComicLocation'], dfilename)
KeyError: 'ComicLocation'
evilhero commented 7 years ago

There was a bunch of PR's that went into development over the last week or so, and I never fully tested against them so it's quite possible that one introduced something unintended, or even that the error was there prior to the PR's.

I do know that in order for the span years to work with the folder format, that you need to refresh the arc.

The module error looks like a simple copy + paste error that never got corrected.

evilhero commented 7 years ago

The fix that just went up above into development fixes the 2 errors:

I'm looking into having a delete all option for the arcs put in place again, the last time it was causing some problems because of rebooted arcs (ie. civil war, secret wars, etc) - where it would delete all traces of the arc based on name and obviously it would delete the wrong arc(s).

As far as the comiclocation error, whenever you change the arc format - you need to refresh the arc in order for it to pick up the proper location. It 'should' be creating the arc directory when you go to the detail arc page, as it currently tries to copy files from your watchlist that weren't previously (if the option is enabled) and if it can't locate the directory in the new location, it would fail ;)