buildarr / buildarr-radarr

Radarr movie PVR plugin for Buildarr
https://buildarr.github.io/plugins/radarr
GNU General Public License v3.0
0 stars 2 forks source link

Buildarr reports issue with PlexServer key when parsing notification settings #42

Closed Serneum closed 9 months ago

Serneum commented 9 months ago

Splitting this off of #33 since that particular issue was resolved. When trying to parse my Radarr instance, Buildarr fails because of a KeyError on PlexServer:

2023-12-03 15:56:48,979 buildarr:1 urllib3.connectionpool [DEBUG] http://radarr:7878 "GET /api/v3/notification HTTP/1.1" 200 None
2023-12-03 15:56:48,979 buildarr:1 radarr.rest [DEBUG] response body: b'[\n  {\n    "onGrab": false,\n    "onDownload": true,\n    "onUpgrade": true,\n    "onRename": true,\n    "onMovieAdded": false,\n    "onMovieDelete": false,\n    "onMovieFileDelete": false,\n    "onMovieFileDeleteForUpgrade": false,\n    "onHealthIssue": false,\n    "onHealthRestored": false,\n    "onApplicationUpdate": false,\n    "onManualInteractionRequired": false,\n    "supportsOnGrab": false,\n    "supportsOnDownload": true,\n    "supportsOnUpgrade": true,\n    "supportsOnRename": true,\n    "supportsOnMovieAdded": false,\n    "supportsOnMovieDelete": true,\n    "supportsOnMovieFileDelete": true,\n    "supportsOnMovieFileDeleteForUpgrade": true,\n    "supportsOnHealthIssue": false,\n    "supportsOnHealthRestored": false,\n    "supportsOnApplicationUpdate": false,\n    "supportsOnManualInteractionRequired": false,\n    "includeHealthWarnings": false,\n    "name": "Plex",\n    "fields": [\n      {\n        "order": 0,\n        "name": "host",\n        "label": "Host",\n        "value": "192.168.1.100",\n        "type": "textbox",\n        "advanced": false,\n        "privacy": "normal",\n        "isFloat": false\n      },\n      {\n        "order": 1,\n        "name": "port",\n        "label": "Port",\n        "value": 32400,\n        "type": "textbox",\n        "advanced": false,\n        "privacy": "normal",\n        "isFloat": false\n      },\n      {\n        "order": 2,\n        "name": "useSsl",\n        "label": "Use SSL",\n        "helpText": "Connect to Plex over HTTPS instead of HTTP",\n        "value": false,\n        "type": "checkbox",\n        "advanced": false,\n        "privacy": "normal",\n        "isFloat": false\n      },\n      {\n        "order": 3,\n        "name": "authToken",\n        "label": "Auth Token",\n        "value": "********",\n        "type": "textbox",\n        "advanced": true,\n        "privacy": "apiKey",\n        "isFloat": false\n      },\n      {\n        "order": 4,\n        "name": "signIn",\n        "label": "Authenticate with Plex.tv",\n        "value": "startOAuth",\n        "type": "oAuth",\n        "advanced": false,\n        "privacy": "normal",\n        "isFloat": false\n      },\n      {\n        "order": 5,\n        "name": "updateLibrary",\n        "label": "Update Library",\n        "value": true,\n        "type": "checkbox",\n        "advanced": false,\n        "privacy": "normal",\n        "isFloat": false\n      },\n      {\n        "order": 6,\n        "name": "mapFrom",\n        "label": "Map Paths From",\n        "helpText": "Radarr path, used to modify movie paths when Plex sees library path location differently from Radarr",\n        "type": "textbox",\n        "advanced": true,\n        "privacy": "normal",\n        "isFloat": false\n      },\n      {\n        "order": 7,\n        "name": "mapTo",\n        "label": "Map Paths To",\n        "helpText": "Plex path, used to modify movie paths when Plex sees library path location differently from Radarr",\n        "type": "textbox",\n        "advanced": true,\n        "privacy": "normal",\n        "isFloat": false\n      }\n    ],\n    "implementationName": "Plex Media Server",\n    "implementation": "PlexServer",\n    "configContract": "PlexServerSettings",\n    "infoLink": "https://wiki.servarr.com/radarr/supported#plexserver",\n    "tags": [],\n    "id": 1\n  }\n]'
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 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_radarr/cli.py", line 92, in dump_config
    .from_remote(
     ^^^^^^^^^^^^
  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_radarr/config/__init__.py", line 181, in from_remote
    settings=RadarrSettings.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_radarr/config/settings/notifications/__init__.py", line 144, in from_remote
    definitions={
                ^
  File "/usr/local/lib/python3.11/site-packages/buildarr_radarr/config/settings/notifications/__init__.py", line 145, in <dictcomp>
    api_notification.name: NOTIFICATION_TYPE_MAP[  # type: ignore[attr-defined]
                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
KeyError: 'PlexServer'

My Radarr server is version 5.1.3.8246 and Buildarr is version 0.7.2

Callum027 commented 9 months ago

Thanks for the continued bug reports.

Buildarr does not support managing Plex Server notification connections, but it looks like it does not ignore it when one exists, and raises an error instead.

I'll create a new release fixing the issue today.

Callum027 commented 9 months ago

Sorry for this taking longer than it should have.

The fix for your issue has been released. Buildarr will now ignore unsupported resource types in Radarr, and continue running. This allows you to keep your Plex Server notification connection intact, while managing everything else using Buildarr.

Here are the new versions:

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

Serneum commented 9 months ago

Looks like that did the trick 👍🏻

Callum027 commented 9 months ago

That's great! I'll close this issue, then.