buildarr / buildarr-jellyseerr

Jellyseerr media library request manager plugin for Sonarr
GNU General Public License v3.0
1 stars 2 forks source link

initial setup fails with KeyError: 'activeAnimeDirectory' #23

Closed scratchmex closed 6 months ago

scratchmex commented 9 months ago

jellyseer is already configured and when I add the following entry and start buildarr it fails. I feel because I don't have any anime related config set

# buildarr.yaml
jellyseerr:
  api_key: AbCdEfGhIjKlMnOpQrStUvWxYzaBcDeFgHiJkLmNoPqRsTuVwXyZ123456789012345=
buildarr  | 2024-02-05 21:26:46,568 buildarr:1 buildarr.cli.daemon [ERROR] <jellyseerr> (default) An error occurred while applying initial configuration: 'activeAnimeDirectory'
buildarr  | Traceback (most recent call last):
buildarr  |   File "/usr/local/lib/python3.11/site-packages/buildarr/cli/daemon.py", line 215, in _initial_run
buildarr  |     run_apply()
buildarr  |   File "/usr/local/lib/python3.11/site-packages/buildarr/cli/run.py", line 235, in _run
buildarr  |     remote_instance_config = manager.from_remote(instance_config, instance_secrets)
buildarr  |                              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
buildarr  |   File "/usr/local/lib/python3.11/site-packages/buildarr/manager/__init__.py", line 171, in from_remote
buildarr  |     return instance_config.from_remote(secrets)
buildarr  |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
buildarr  |   File "/usr/local/lib/python3.11/site-packages/buildarr_jellyseerr/config/__init__.py", line 177, in from_remote
buildarr  |     settings=JellyseerrSettings.from_remote(secrets),
buildarr  |              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
buildarr  |   File "/usr/local/lib/python3.11/site-packages/buildarr/config/base.py", line 85, in from_remote
buildarr  |     fields[field_name] = field.type_.from_remote(secrets)
buildarr  |                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
buildarr  |   File "/usr/local/lib/python3.11/site-packages/buildarr/config/base.py", line 85, in from_remote
buildarr  |     fields[field_name] = field.type_.from_remote(secrets)
buildarr  |                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
buildarr  |   File "/usr/local/lib/python3.11/site-packages/buildarr_jellyseerr/config/settings/services/sonarr.py", line 514, in from_remote
buildarr  |     definitions={
buildarr  |                 ^
buildarr  |   File "/usr/local/lib/python3.11/site-packages/buildarr_jellyseerr/config/settings/services/sonarr.py", line 515, in <dictcomp>
buildarr  |     api_service["name"]: Sonarr._from_remote(api_service)
buildarr  |                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
buildarr  |   File "/usr/local/lib/python3.11/site-packages/buildarr_jellyseerr/config/settings/services/sonarr.py", line 203, in _from_remote
buildarr  |     **cls.get_local_attrs(remote_map=cls._get_remote_map(), remote_attrs=remote_attrs),
buildarr  |       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
buildarr  |   File "/usr/local/lib/python3.11/site-packages/buildarr/config/base.py", line 234, in get_local_attrs
buildarr  |     remote_attr = remote_attrs[remote_attr_name]
buildarr  |                   ~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^
buildarr  | KeyError: 'activeAnimeDirectory'
Callum027 commented 8 months ago

Hi @scratchmex, thank you for the bug report.

This is not necessarily because you don't have any anime-related configuration set (the plugin was designed to handle that case.) In this case Jellyseerr is not including activeAnimeDirectory in its API response, but Buildarr always expects it to be there, even if it is not used (just set to null).

I will create a patch to resolve this issue, which should be released later today.

Callum027 commented 8 months ago

Thanks for waiting. The fix for this issue has been released as:

Please give the new version a try to check that it resolves your issue.

Callum027 commented 6 months ago

The fix for this issue has been released for some time, so I am closing this issue.

Please let me know if you run into any additional problems, either relating to this issue or using Buildarr in general.