ManiMatter / decluttarr

Watches radarr, sonarr, lidarr, readarr and whisparr download queues and removes downloads if they become stalled or no longer needed.
GNU General Public License v3.0
100 stars 15 forks source link

dict error? #17

Closed itractus closed 6 months ago

itractus commented 6 months ago

/I seem to be getting a dict error on all connections. Any ideas on what this might be?

INFO: Application Started! INFO: INFO: Current Settings INFO: True | Removing failed downloads INFO: True | Removing stalled downloads INFO: True | Removing downloads missing metadata INFO: True | Removing orphan downloads INFO: True | Removing downloads belonging to unmonitored TV shows/movies INFO: INFO: Running every: 0 days 0 hours 10 minutes INFO: Permitted number of times before stalled/missing metadata downloads are removed: 3 INFO: Downloads with this tag will be skipped: "Don't Kill If Stalled" INFO: INFO: Configured Instances INFO: Radarr: http://radarr:7878/api/v3 INFO: Sonarr: http://sonarr:8989/api/v3 INFO: Lidarr: http://lidarr:8686/api/v1 INFO: qBittorrent: http://qbittorrent:8033/api/v2 INFO: INFO: Check Instances INFO: OK | Radarr INFO: OK | Sonarr INFO: OK | Lidarr INFO: OK | qBittorrent INFO:

INFO: LOG_LEVEL = INFO: Only logging changes (switch to VERBOSE for more info) [WARNING]: >>> Queue cleaning failed on Radarr. (File: queue_cleaner.py / Line: 224 / Error Message: 'bool' object has no attribute 'dict' / Error Type: <class 'AttributeError'>) [WARNING]: >>> Queue cleaning failed on Sonarr. (File: queue_cleaner.py / Line: 224 / Error Message: 'bool' object has no attribute 'dict' / Error Type: <class 'AttributeError'>) [WARNING]: >>> Queue cleaning failed on Lidarr. (File: queue_cleaner.py / Line: 224 / Error Message: 'bool' object has no attribute 'dict' / Error Type: <class 'AttributeError'>)

my compose:

decluttarr: image: ghcr.io/manimatter/decluttarr:latest container_name: decluttarr restart: always environment: TZ: Europe/Brussels PUID: ${PUID} PGID: ${PGID}

General

  LOG_LEVEL: INFO
  #TEST_RUN: True 
  # Features 
  REMOVE_TIMER: 10
  REMOVE_FAILED: True
  REMOVE_STALLED: True
  REMOVE_METADATA_MISSING: True
  REMOVE_ORPHANS: True
  REMOVE_UNMONITORED: True
  PERMITTED_ATTEMPTS: 3
  NO_STALLED_REMOVAL_QBIT_TAG: Don't Kill If Stalled
  # Radarr
  RADARR_URL: http://radarr:7878
  RADARR_KEY: REDACTED
  # Sonarr
  SONARR_URL: http://sonarr:8989
  SONARR_KEY: REDACTED
  # Lidarr
  LIDARR_URL: http://lidarr:8686
  LIDARR_KEY: REDACTED
  # qBitorrent
  QBITTORRENT_URL: http://qbittorrent:8033
  QBITTORRENT_USERNAME: admin
  QBITTORRENT_PASSWORD: REDACTED
ManiMatter commented 6 months ago

hi,

which sonarr/radarr version are you using? Have you tried v4 nightly?

Could you paste the logs when you switch to "debug" INFO_LEVEL (maybe use a pastebin)

itractus commented 6 months ago

i'm using: Radarr Version 5.1.3.8246 Sonarr Version 3.0.10.1567 Lidarr Version 1.4.5.3639 here is the verbose log output: https://pastebin.com/rKVvnSiy

ManiMatter commented 6 months ago

Just studied your pastebin, hard to tell what's going on. Could we try the following please?

Then run again on DEBUG mode and print kindly share again the output, thx

itractus commented 6 months ago

here is one with the dev versions of lidarr/sonarr/radarr and decluttarr https://pastebin.com/zyuXvNtP

jordan-huitema commented 6 months ago

Posting here due to having a very similar error, running on a fresh Ubuntu 20.04 container with current versions of all arr apps and a fully updated python3 package I get this error.

2023-12-12 05:29:27,506 [VERBOSE]: Cleaning queue on Radarr: 2023-12-12 05:29:27,513 [VERBOSE]: >>> Queue is empty. 2023-12-12 05:29:27,513 [VERBOSE]: Cleaning queue on Sonarr: 2023-12-12 05:29:27,526 [WARNING]: >>> Queue cleaning failed on Sonarr. (File: queue_cleaner.py / Line: 213 / Error Message: unsupported operand type(s) for |: 'dict' and 'dict' / Error Type: <class 'TypeError'>) 2023-12-12 05:29:27,526 [VERBOSE]: Cleaning queue on Lidarr: 2023-12-12 05:29:27,533 [WARNING]: >>> Queue cleaning failed on Lidarr. (File: queue_cleaner.py / Line: 213 / Error Message: unsupported operand type(s) for |: 'dict' and 'dict' / Error Type: <class 'TypeError'>) 2023-12-12 05:29:27,533 [VERBOSE]: 2023-12-12 05:29:27,533 [VERBOSE]: Queue clean-up complete!

After a bit of digging I tracked the issue down to line 19 of the queue_cleaner.py

queue = await rest_get(f'{BASE_URL}/queue', API_KEY, {'page': '1', 'pageSize': totalRecords}|params) The | operand was causing issues, python is not my background and I cant see why there is a OR operand here instead of adding params into the previous object but after removing '|params' everything works great (or at least appears to), I know how to add this to an object in JS but I'm not sure how in python so its a quick fix

itractus commented 6 months ago

I don't know how or why, but it is solved. I wish I could be more specific. I am using the images with the latest tag from linuxserverio.

ManiMatter commented 6 months ago

mh. no clue :) glad it works for you now. Just bear in mind that with the "latest" tag for Sonarr/radarr, the stuck-in-meta-data stage detection will not work properly; nightly is required for that