haijeploeg / excludarr

Excludarr manages your libraries in Radarr/Sonarr. It keeps track of your library and checks if your movies and series are also available on a configured streaming provider. It can exclude the movies and series that are available on a configured streaming provider. But it can also re-add movies and series if they are not streaming anymore.
MIT License
197 stars 12 forks source link

KeyError: 'title' when running Sonarr Exclude #30

Closed KaHooli closed 2 years ago

KaHooli commented 2 years ago

Excludarr appears to be working fine for Radarr, but I'm having an issue with Sonarr.

I've created an alias on my Ubuntu server for now to easily run excludarr when desired. I'll eventually turn it into a chron job.

I've uploaded a copy of my command line, env setting files, and the output to here (on GitHub Gist, I hope all this information helps).

As you can see in the output, lines 7188-7210 & 8265-8287 are both identical issues, when excludarr is processing season Season 2 of Pandora (2019), it gives this error...

[2021-12-23 23:07:27] - Processing season Season 2 of Pandora (2019)
Traceback (most recent call last):
  File "/usr/local/bin/excludarr", line 33, in <module>
    sys.exit(load_entry_point('excludarr==1.0.2', 'console_scripts', 'excludarr')())
  File "/usr/local/lib/python3.10/site-packages/excludarr-1.0.2-py3.10.egg/excludarr/m
  File "/usr/local/lib/python3.10/site-packages/typer/main.py", line 214, in __call__
    return get_command(self)(*args, **kwargs)
  File "/usr/local/lib/python3.10/site-packages/click/core.py", line 1128, in __call__
    return self.main(*args, **kwargs)
  File "/usr/local/lib/python3.10/site-packages/click/core.py", line 1053, in main
    rv = self.invoke(ctx)
  File "/usr/local/lib/python3.10/site-packages/click/core.py", line 1659, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/usr/local/lib/python3.10/site-packages/click/core.py", line 1659, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/usr/local/lib/python3.10/site-packages/click/core.py", line 1395, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/local/lib/python3.10/site-packages/click/core.py", line 754, in invoke
    return __callback(*args, **kwargs)
  File "/usr/local/lib/python3.10/site-packages/typer/main.py", line 500, in wrapper
    return callback(**use_params)  # type: ignore
  File "/usr/local/lib/python3.10/site-packages/excludarr-1.0.2-py3.10.egg/excludarr/c
  File "/usr/local/lib/python3.10/site-packages/excludarr-1.0.2-py3.10.egg/excludarr/c
KeyError: 'title'
haijeploeg commented 2 years ago

Hi Kahooli, thanks for all the information and debug logging. I have managed to reproduce this error, I am not sure what is wrong yet. I noticed that this only happens when it tries to fall back to a TMDB search. When you delete the TMDB_API_KEY value in your braavos.env file it will work properly. You can try that in the meantime as a workaround.

And maybe it is the best to run Excludarr in Docker without the --progress flag. It seems that Docker does not onderstand how to create an progress bar on a single line 😃

KaHooli commented 2 years ago

Thanks, I'll try that suggestion with the TMDB key.

As for the progress line, it displays fine, I had just used > output.txt on the end of the alias I ran, and that's how it captured it.

stayupthetree commented 2 years ago

I am having the same issue as well. Crashes about 9% in. Did the TMDB key thing, it makes it to about 17% before crashing.

haijeploeg commented 2 years ago

I am having the same issue as well. Crashes about 9% in. Did the TMDB key thing, it makes it to about 17% before crashing.

Can you also provide the debug logging? To get debug logging you will need to append --debug right after the basecommand excludarr and then you can add the rest of the command, e.g. excludarr --debug sonarr exclude -a delete -d. Can you do this with and without the TMDB key trick?

With that information I can try to reproduce the error and maybe release a fix next week :)

stayupthetree commented 2 years ago

Whoops. Posted on wrong issue. I think they are related?

With key: https://pastebin.com/dGF6eks2 Without key: https://pastebin.com/1SK3Sxrx

Had to remove about 2000 lines from the Without paste because it was too large for Pastebin

haijeploeg commented 2 years ago

I have found the issue. I am releasing a fix next week. Issue #31 is related, the issue is that JustWatch sometimes provides more seasons then there are released yet. Because those seasons are not yet release, the API does not return all the information, information the script is expecting.

haijeploeg commented 2 years ago

This is fixed in #35 . Going to release v1.0.3 today or tomorrow

haijeploeg commented 2 years ago

Version v1.0.3 is out!