synesthesiam / homeassistant-satellite

Streaming audio satellite for Home Assistant
MIT License
188 stars 23 forks source link

Error when deploying from Docker #40

Closed jkms closed 1 year ago

jkms commented 1 year ago

I am trying to deploy this on a Pi 3 using the Google AIY voice hat. I installed a fresh image, updated, installed docker and tried to start the container I used this config:

version: "3.8"
services:
  satellite:
    image: "ghcr.io/synesthesiam/homeassistant-satellite:latest"
    devices:
      - /dev/snd:/dev/snd
    group_add:
      - audio
    command:
      - --host
      - <redacted>
      - --token
      - <redacted>
      - --debug

and see this error in the logs:

Traceback (most recent call last):
  File "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
  File "/usr/src/app/homeassistant_satellite/__main__.py", line 499, in <module>
    run()
  File "/usr/src/app/homeassistant_satellite/__main__.py", line 494, in run
    asyncio.run(main())
  File "/usr/local/lib/python3.11/asyncio/runners.py", line 189, in run
    with Runner(debug=debug) as runner:
  File "/usr/local/lib/python3.11/asyncio/runners.py", line 59, in __enter__
    self._lazy_init()
  File "/usr/local/lib/python3.11/asyncio/runners.py", line 137, in _lazy_init
    self._loop = events.new_event_loop()
                 ^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/asyncio/events.py", line 806, in new_event_loop
    return get_event_loop_policy().new_event_loop()
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/asyncio/events.py", line 695, in new_event_loop
    return self._loop_factory()
           ^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/asyncio/unix_events.py", line 64, in __init__
    super().__init__(selector)
  File "/usr/local/lib/python3.11/asyncio/selector_events.py", line 50, in __init__
    super().__init__()
  File "/usr/local/lib/python3.11/asyncio/base_events.py", line 400, in __init__
    self._clock_resolution = time.get_clock_info('monotonic').resolution
                             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
PermissionError: [Errno 1] Operation not permitted
Exception ignored in: <function BaseEventLoop.__del__ at 0x762cfde8>
Traceback (most recent call last):
  File "/usr/local/lib/python3.11/asyncio/base_events.py", line 692, in __del__
    _warn(f"unclosed event loop {self!r}", ResourceWarning, source=self)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/asyncio/base_events.py", line 422, in __repr__
    f'closed={self.is_closed()} debug={self.get_debug()}>'
                                       ^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/asyncio/base_events.py", line 1941, in get_debug
    return self._debug
           ^^^^^^^^^^^
AttributeError: '_UnixSelectorEventLoop' object has no attribute '_debug'
sys:1: RuntimeWarning: coroutine 'main' was never awaited

Unsure where to go from here.

fanaticDavid commented 1 year ago

I'm trying to deploy the docker container on a Raspberry Pi 3 with an Anker PowerConf S330 connected, but I'm getting the same error as above. My docker-compose is also the same, except for the --debug at the end.

EDIT: after some googling, this error may be due to an outdated version of libseccomp2. I am indeed running an older version of Raspbian. I'm going to try the solutions proposed here: FAQ - LinuxServer.io

EDIT2: I now have the container running after applying option 2 from the link above. I did have to add an extra command between the second and third line: sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 6ED0E7B82643E131

seppeel commented 1 year ago

The docker image contains an error: #33 . The issue was fixed but the fix did not make in into the latest docker image, yet. You have to wait until a new image was built and pushed or just build a new image from the Dockerfile.

jkms commented 1 year ago

Confirming that @seppeel's solution worked. I'm also on a old version (Raspbian GNU/Linux 10 (buster)) and the following fixed the error above:

sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 04EE7237B7D453EC 648ACFD622F3D138
echo "deb http://deb.debian.org/debian buster-backports main" | sudo tee -a /etc/apt/sources.list.d/buster-backports.list
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 6ED0E7B82643E131
sudo apt update
sudo apt install -t buster-backports libseccomp2