Unable to add new comics to wanted library

Post any problems / bugs / issues that are Mylar-related in here.
Post Reply
xthursdsayx
Posts: 7
Joined: Mon Mar 07, 2016 8:32 pm

Unable to add new comics to wanted library

Post by xthursdsayx »

I've been using Mylar for years now, but I recently began having problems adding comics to my library. I can search for them as usual, but when I select "Add this comic" my browser redirects to the main page rather than the new page for that comics as it is supposed to, and the comic is not added to my database. This is the error I receive in my log. My comic directory is just /comics, as usual, so I can't figure out what the problem is. Any ideas? Thanks!

Code: Select all

	Uncaught exception: Traceback (most recent call last):
File "/app/mylar/mylar/logger.py", line 337, 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 "/app/mylar/mylar/importer.py", line 62, in addComictoDB
comlocation = os.path.dirname(imported['filelisting'][0]['comiclocation'])
TypeError: string indices must be integers
barbequesauce
Posts: 95
Joined: Fri Feb 03, 2017 3:59 pm

Re: Unable to add new comics to wanted library

Post by barbequesauce »

We need a bit more than that... branch & commit, install method, and a full debug log showing what happened leading up to the error at a minimum - otherwise we are fumbling in the dark...
xthursdsayx
Posts: 7
Joined: Mon Mar 07, 2016 8:32 pm

Re: Unable to add new comics to wanted library

Post by xthursdsayx »

Ah, okay. I was hoping that the "comlocation = os.path.dirname(imported['filelisting'][0]['comiclocation'])
TypeError: string indices must be integers" message might indicate something obvious.

I'm running mylar in a docker container on an unRAID server, development branch git build f837fea36114c5bdb7d0b1e2647ad335d270a1c5.

Here is the relevant port of the log leading up to the error:

Code: Select all

09-Mar-2019 19:26:06 - INFO    :: mylar.toggleVerbose.3764 : CP Server Thread-5 : Verbose (DEBUG) logging is enabled
09-Mar-2019 19:26:06 - DEBUG   :: mylar.toggleVerbose.3765 : CP Server Thread-5 : If you can read this message, debug logging is now working
09-Mar-2019 19:26:16 - DEBUG   :: mylar.findComic.142 : CP Server Thread-5 : there are 1 search results...
09-Mar-2019 19:26:16 - DEBUG   :: mylar.findComic.315 : CP Server Thread-5 : [RESULT][None] ComicName:Land of the Sons -- 2018 [Series years: [u'2018']]
09-Mar-2019 19:26:19 - ERROR   :: mylar.excepthook.315 : Thread-33 : Uncaught exception: Traceback (most recent call last):
  File "/app/mylar/mylar/logger.py", line 337, 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 "/app/mylar/mylar/importer.py", line 62, in addComictoDB
    comlocation = os.path.dirname(imported['filelisting'][0]['comiclocation'])
TypeError: string indices must be integers
User avatar
evilhero
Site Admin
Posts: 2883
Joined: Sat Apr 20, 2013 3:43 pm
Contact:

Re: Unable to add new comics to wanted library

Post by evilhero »

I just added that particular series in your logs without any errors / problems, so at this point it's probably safe to say that this is an isolated problem particular to your installation for some reason.

The error you're indicating can only be hit if you were performing an import (ie. Manage tab / Scan Comic Library option), so if you're just receiving the error by adding a series from the searchresults page it's curious as to how you're receiving that error.

What page is it that you're trying to add the series from ? (screenshot maybe if possible)

Were you performing an Import via the Import Results Management tab prior to doing the search / add ?
xthursdsayx
Posts: 7
Joined: Mon Mar 07, 2016 8:32 pm

Re: Unable to add new comics to wanted library

Post by xthursdsayx »

Thanks for the reply @evilhero. Yeah, I don't know what the deal is. I was just performing a normal search from the search bar and then trying to add the comic via the "Add comic to library" button on the right of the screen. I wasn't importing an existing comic.

For whatever reason, it seems like this problem is isolated to a docker installation using the Linuxserver docker container of Mylar. I ended up rolling my own docker container (specifically in order to keep up with your Mylar development branch) and it seems to be working fine so far. That being said, the previous container was a fresh install, so there is no reason that it shouldn't have been working, so I'm still interested in figuring out what the issues was/is.
User avatar
evilhero
Site Admin
Posts: 2883
Joined: Sat Apr 20, 2013 3:43 pm
Contact:

Re: Unable to add new comics to wanted library

Post by evilhero »

Yeah, I think part of the problem with the docker installs is that I don't run docker - so me trying to troubleshoot / help in those situations is pretty much a lost cause (we do have some fellas in the irc chann that tend to step up if there are docker-related problems, but again it's not a 100% support kinda thing obviously).

That being said, there was a huge merge to master the other day - and the LSIO guys only do their docker updates on Sundays (I think? I know it's just once / week usually), so it's quite possible that the problem was addressed in development which is why you're not experiencing problems currently in your own docker build. It might be worth trying the LSIO docker again once they update to the latest master commit to see if the problem persists.

We can always get you to add some logging lines to the importer.py file to see exactly what's being passed into it from the search dialog and figure things out that way - but again, not quite sure if changing those files will cause problems as I know some docker installs overwrite any local changes on a startup sequence ...
xthursdsayx
Posts: 7
Joined: Mon Mar 07, 2016 8:32 pm

Re: Unable to add new comics to wanted library

Post by xthursdsayx »

Let me try this again... for some reason, my post keeps not posting. Anyway, I updated the linuxserver container, but unfortunately, I'm still having the same problem. I'm able to add comics with the container I created, but still having the same problem with theirs. Not that I'm blaming them. I most likely messed something up in the config or something. Anyway, I'd still be interested to know what exactly the problem actually is.

You mentioned adding some logging lines to the importer.py file to see what's being passed into it from the search dialogue. I'm not sure if that will work/be persistent either, but it's worth a try. What exactly should I add?
User avatar
evilhero
Site Admin
Posts: 2883
Joined: Sat Apr 20, 2013 3:43 pm
Contact:

Re: Unable to add new comics to wanted library

Post by evilhero »

You can try to add this (and hopefully it'll be persistent across restarts) between lines 57 & 58 of importer.py:

Code: Select all

(line57)   dbcomic = myDB.selectone('SELECT * FROM comics WHERE ComicID=?', [comicid]).fetchone()
(addthis)  logger.info('imported value: %s' % imported)
(line58)   if dbcomic is None:
Note, don't paste in the (line..) (addthis) stuff - that's just for here. You want to add in that logger.info line btwn those 2 lines above, and make sure it's the same ident (otherwise it will throw an indent error when you try to start Mylar).

Then just paste back what it says imported is, and that's a big start to figuring things out.
xthursdsayx
Posts: 7
Joined: Mon Mar 07, 2016 8:32 pm

Re: Unable to add new comics to wanted library

Post by xthursdsayx »

Turns out that it is persistent, so there's that. I assume it will stay until you push a change to the importer.py file in your original repo.

Anyway, this is my output:

Code: Select all

14-Mar-2019 12:55:59 - DEBUG   :: mylar.findComic.142 : CP Server Thread-4 : there are 1 search results...
14-Mar-2019 12:55:59 - DEBUG   :: mylar.findComic.315 : CP Server Thread-4 : [RESULT][None] ComicName:Land of the Sons -- 2018 [Series years: [u'2018']]
14-Mar-2019 12:55:59 - INFO    :: mylar.ddl.456 : Thread-12 : [RSS][DDL] 12 entries have been indexed and are now going to be stored for caching.
14-Mar-2019 12:56:01 - INFO    :: mylar.addComictoDB.58 : Thread-13 : imported value: None
14-Mar-2019 12:56:01 - ERROR   :: mylar.excepthook.315 : Thread-13 : Uncaught exception: Traceback (most recent call last):
  File "/app/mylar/mylar/logger.py", line 337, 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 "/app/mylar/mylar/importer.py", line 63, in addComictoDB
    comlocation = os.path.dirname(imported['filelisting'][0]['comiclocation'])
TypeError: string indices must be integers
User avatar
evilhero
Site Admin
Posts: 2883
Joined: Sat Apr 20, 2013 3:43 pm
Contact:

Re: Unable to add new comics to wanted library

Post by evilhero »

Great, thanks for doing that!

And that's a messed up assumption it's making then. I wonder why it's taking that as a string value instead of as actual value of None....

Well either way, if you can modify the line @ roughly line 61 , and test it - that 'should' fix the problem:

Code: Select all

(exists)       newValueDict = {"ComicName":   "Comic ID: %s" % (comicid),
(exists)               "Status":   "Loading"}
(modify)       if all([imported is not None, mylar.CONFIG.IMP_PATHS is True]):
(exists)           comlocation = os.path.dirname(imported['filelisting'][0]['comiclocation'])
If you can let me know if that solves the problem, I can push that fix out into development.
Post Reply