Kometa-Team / Kometa

Python script to update metadata information for items in plex as well as automatically build collections and playlists. The Wiki Documentation is linked below.
https://kometa.wiki
MIT License
2.52k stars 307 forks source link

add to sonarr crash #150

Closed jonathanfinley closed 3 years ago

jonathanfinley commented 3 years ago

I'm currently building my collections and have everything setup correctly. I have found that if it cannot "find the show" it is causing an exception and what I define as "crashing" the current collection and does not complete the tasks.

[sonarr.py:85]              [INFO]     | Added to Sonarr | 384787 | Paranormal Case Files                                                   |
[util.py:708]               [DEBUG]    | Traceback (most recent call last):                                                                 |
                                                                 |   File "/modules/config.py", line 462, in update_libraries
                                                                 |     builder.run_methods(collection_obj, collection_name, rating_key_map, movie_map, show_map)
                                                                 |   File "/modules/builder.py", line 821, in run_methods
                                                                 |     self.library.Sonarr.add_tvdb([missing_id for title, missing_id in missing_shows_with_names], tag=self.details["arr_tag"])
                                                                 |   File "/modules/sonarr.py", line 89, in add_tvdb
                                                                 |     logger.error(f"Sonarr Error: ({tvdb_id}) {show.title}: ({response.status_code}) {response.json()[0]['errorMessage']}")
                                                                 |   File "/usr/local/lib/python3.9/site-packages/requests/models.py", line 900, in json
                                                                 |     return complexjson.loads(self.text, **kwargs)
                                                                 |   File "/usr/local/lib/python3.9/json/__init__.py", line 346, in loads
                                                                 |     return _default_decoder.decode(s)
                                                                 |   File "/usr/local/lib/python3.9/json/decoder.py", line 337, in decode
                                                                 |     obj, end = self.raw_decode(s, idx=_w(s, 0).end())
                                                                 |   File "/usr/local/lib/python3.9/json/decoder.py", line 355, in raw_decode
                                                                 |     raise JSONDecodeError("Expecting value", s, err.value) from None
                                                                 | json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
                                                                 |
[config.py:477]             [ERROR]    | Unknown Error: Expecting value: line 1 column 1 (char 0)

One, how do I avoid this error? Two, Is it possible to add in some handling that if the response from sonarr is bad, just skip that single show, and continue down the list and finish out the collection.

From my testing it seems to go

  1. Check tmdb/trakt etc.
  2. Add shows available
  3. search for missing shows
  4. Fail the search Go to next Collection. Repeat.

Thanks

meisnate12 commented 3 years ago

do you mind sharing the collection config that running when tit fails to add so I can replicate the error. This should be continuing so I'll be looking into that as well

jonathanfinley commented 3 years ago

yeah I'll give you everything :)

config.txt Movies.txt TV Shows.txt

meisnate12 commented 3 years ago

thanks that will help but itll still be alot easier if i know which collection caused the error so i can just test it on my end

jonathanfinley commented 3 years ago

Relooking at the logs, it was any of the "networks"

its mostly seemed to have subsided and now crashing on 500 error with plex.