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

EOF errors when running in docker-compose #16

Closed whizzzkid closed 2 years ago

whizzzkid commented 2 years ago

I was planning to run this on my synology-nas, but I am facing this issue:

┏━━━━┳━━━━━━━┳━━━━━━━━━━━┓
┃ ID ┃ Title ┃ Providers ┃
┡━━━━╇━━━━━━━╇━━━━━━━━━━━┩
Traceback (most recent call last):
  File "/usr/local/bin/excludarr", line 33, in <module>
    sys.exit(load_entry_point('excludarr==0.1.4', 'console_scripts', 'excludarr')())
  File "/usr/local/lib/python3.8/site-packages/excludarr-0.1.4-py3.8.egg/excludarr/main.py", line 50, in main
  File "/usr/local/lib/python3.8/site-packages/cement/core/foundation.py", line 916, in run
    return_val = self.controller._dispatch()
  File "/usr/local/lib/python3.8/site-packages/cement/ext/ext_argparse.py", line 808, in _dispatch
    return func()
  File "/usr/local/lib/python3.8/site-packages/excludarr-0.1.4-py3.8.egg/excludarr/controllers/base.py", line 261, in exclude
  File "/usr/local/lib/python3.8/site-packages/excludarr-0.1.4-py3.8.egg/excludarr/controllers/base.py", line 117, in _exclude_radarr
  File "/usr/local/lib/python3.8/site-packages/cement/utils/shell.py", line 401, in __init__
    self.prompt()
  File "/usr/local/lib/python3.8/site-packages/cement/utils/shell.py", line 445, in prompt
    self._prompt()
  File "/usr/local/lib/python3.8/site-packages/cement/utils/shell.py", line 424, in _prompt
    self.input = input("%s " % text)
EOFError: EOF when reading a line
└────┴───────┴───────────┘Are you sure you want to change the status of the movies to: delete? (y/N)

here is my docker-compose.yaml entry:

  excludarr:
    image: haijeploeg/excludarr:latest
    container_name: excludarr
    restart: on-failure
    command: exclude -a delete
    environment:
      - PUID=${PUID}
      - PGID=${PGID}
      - TZ=${TZ}
      - GENERAL_COUNTRY=CA
      - GENERAL_PROVIDERS="netflix, amazon prime video"
      - TMDB_API_KEY=${TMDB_API_KEY}
      - RADARR_URL=http://radarr:7878
      - RADARR_API_KEY=${RADARR_API_KEY}
      - RADARR_VERIFY_SSL=false

I am not sure what's causing the error. Also, is there a -y flag to accept this in the command?

haijeploeg commented 2 years ago

Hi,

That is because you are not using the -f flag. This flag basically accepts the question with a yes. Maybe I should rename the -f to -y. Because docker compose does not present a interactive prompt, you cannot accept the question, thus resulting in an EOF error.

Also, if you use radarr and excludarr in a docker-compose file, I suggest using a healthcheck on radarr and only start excludarr when radarr is fully ready. An example below (not fully working because the environment variables are not properly set and synced with radarr):

---
version: "2.1"
services:
  radarr:
    image: linuxserver/radarr
    container_name: radarr
    environment:
      - PUID=1000
      - PGID=1000
      - TZ=Europe/Amsterdam
    ports:
      - 7878:7878
    restart: unless-stopped
    healthcheck:
        test: ["CMD", "curl", "-f", "http://localhost:7878"]
        interval: 5s
        timeout: 5s
        retries: 5

  excludarr:
    image: haijeploeg/excludarr:latest
    container_name: excludarr
    restart: on-failure
    command: exclude -a delete -f
    links:
      - radarr
    depends_on:
      radarr:
        condition: service_healthy
    environment:
      - PUID=${PUID}
      - PGID=${PGID}
      - TZ=${TZ}
      - GENERAL_COUNTRY=CA
      - GENERAL_PROVIDERS="netflix, amazon prime video"
      - TMDB_API_KEY=${TMDB_API_KEY}
      - RADARR_URL=http://radarr:7878
      - RADARR_API_KEY=${RADARR_API_KEY}
      - RADARR_VERIFY_SSL=false

Hope this helps :)

whizzzkid commented 2 years ago

@haijeploeg that worked, however I'm not sure if this is actually working. will need to play more with it.