buildarr / buildarr-prowlarr

Prowlarr indexer manager plugin for Buildarr
https://buildarr.github.io/plugins/prowlarr
GNU General Public License v3.0
1 stars 1 forks source link

Error While Trying To Access Existing Prowlarr Config #25

Closed ProfMoo closed 11 months ago

ProfMoo commented 1 year ago

Hi! Nifty tool 😄. Always seemed odd to me that all the Arr tools were so click-ops centric. I'm looking to integrate it into my stack.

While I was trying to onboard buildarr-prowlarr, I ran into this issue any time the plugin was trying to download the existing Prowlarr config:

2023-10-18 15:13:06,493 buildarr:1 buildarr.cli.run [INFO] <prowlarr> (prowlarr) Fetching remote configuration to check if updates are required
Traceback (most recent call last):
  File "/usr/local/bin/buildarr", line 8, in <module>
    sys.exit(main())
             ^^^^^^
  File "/usr/local/lib/python3.11/site-packages/click/core.py", line 1157, in __call__
    return self.main(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/click/core.py", line 1078, in main
    rv = self.invoke(ctx)
         ^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/click/core.py", line 1688, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/click/core.py", line 1434, in invoke
    return ctx.invoke(self.callback, **ctx.params)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/click/core.py", line 783, in invoke
    return __callback(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/buildarr/cli/daemon.py", line 568, in daemon
    ).start()
      ^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/buildarr/cli/daemon.py", line 113, in start
    self._initial_run()
  File "/usr/local/lib/python3.11/site-packages/buildarr/cli/daemon.py", line 226, in _initial_run
    run_apply(secrets_file_path=self._secrets_file_path)
  File "/usr/local/lib/python3.11/site-packages/buildarr/cli/run.py", line 287, in _run
    remote_instance_config = manager.from_remote(instance_config, instance_secrets)
                             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/buildarr/manager/__init__.py", line 171, in from_remote
    return instance_config.from_remote(secrets)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/buildarr_prowlarr/config/__init__.py", line 157, in from_remote
    settings=ProwlarrSettings.from_remote(secrets),
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/buildarr/config/base.py", line 85, in from_remote
    fields[field_name] = field.type_.from_remote(secrets)
                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/buildarr/config/base.py", line 85, in from_remote
    fields[field_name] = field.type_.from_remote(secrets)
                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/buildarr_prowlarr/config/settings/indexers/indexers.py", line 654, in from_remote
    definitions[indexer.name] = Indexer._from_remote(
                                ^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/buildarr_prowlarr/config/settings/indexers/indexers.py", line 280, in _from_remote
    value: Any = remote_attrs["indexerUrls"][field["value"]]
                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^
TypeError: list indices must be integers or slices, not str

A few items of note:

  1. This still happens even if I run the dump-config command
  2. The only configuration in my Prowlarr instance is a single indexer (OPS)
  3. I am pulling the latest version of both Prowlarr and Buildarr

Here is my builder.yml that I was trying to startup with, but I don't think the configuration affects anything since I don't think buildarr got past downloading the remote config from prowlarr. Figured I'd send it just in case:

buildarr:
  watch_config: true
  update_days:
    - "monday"
    - "tuesday"
    - "wednesday"
    - "thursday"
    - "friday"
    - "saturday"
    - "sunday"
  update_times:
    - "03:00"

prowlarr:
  # Configuration common to all prowlarr instances can be defined here.
  # settings:
  #   ...
  instances:
    # Name of the instance as referred to by prowlarr.
    # Assign instance-specific configuration to it.
    prowlarr:
      host: "host.docker.internal"
      port: 9696
      protocol: "http"
      api_key: "<redacted>"

Happy to provide any additional details or help debug. Thanks again for making this tool

Callum027 commented 1 year ago

Hi there, sorry for the late response. Thanks for trying out Buildarr.

Would you be able to share what type of indexer you have configured?

If possible, it'd be great if you can run Buildarr in debug mode (by either passing --log-level DEBUG on the command line, or setting the BUILDARR_LOG_LEVEL environment variable to DEBUG), and then share a transcript of the resulting API logs surrounding the error (with any API keys and passwords redacted.) If you'd like help doing this, please let me know.

ProfMoo commented 1 year ago

Hi 😄

Would you be able to share what type of indexer you have configured?

Yes no problem. When I first ran into this issue, I only had OPS and RED. Right now I have ANT, MTV, OPS, and RED. I just verified that I have the same issue with all 4.

If possible, it'd be great if you can run Buildarr in debug mode (by either passing --log-level DEBUG on the command line, or setting the BUILDARR_LOG_LEVEL environment variable to DEBUG)

No problem. I've attached a file or a full run in debug mode with the keys redacted:

------- LMK if you'd like any additional information. I haven't had the time to really dive into the debug logs yet, but hopefully they're helpful and we can get to the bottom of this 😄.
Callum027 commented 1 year ago

Thank you for the debug logs. I have found the issue and will create a PR to patch Buildarr shortly.

Callum027 commented 1 year ago

https://github.com/buildarr/buildarr-prowlarr/pull/31

Callum027 commented 1 year 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.