ualex73 / monitor_docker

Monitor Docker containers from Home Assistant
Apache License 2.0
301 stars 37 forks source link

Problems with monitoring docker containers because of an error 'RuntimeError: no running event loop' #162

Closed Jandokus closed 2 months ago

Jandokus commented 2 months ago

I use Monitor Docker to get info from external docker containers. I have been using it for a long time with pleasure. However, now it doesn't work anymore. I don't know exactly since when it stopped working, but I expect with an update of Monitor Docker and/or Home Assistant. In the system log of Home Assistant I get the following error:

`Logger: custom_components.monitor_docker.helpers Bron: custom_components/monitor_docker/helpers.py:162 integratie: Monitor Docker (documentatie, problemen) Eerst voorgekomen: 11:10:13 (2 gebeurtenissen) Laatst gelogd: 11:10:14

[RemoteDocker NUC LXC]: Can not connect to Docker API (no running event loop) [RemoteDocker NUC LXC PiHole]: Can not connect to Docker API (no running event loop) Traceback (most recent call last): File "/config/custom_components/monitor_docker/helpers.py", line 162, in init self._api = aiodocker.Docker(url=url) ^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/aiodocker/docker.py", line 117, in init connector = aiohttp.TCPConnector(ssl=ssl_context) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/aiohttp/connector.py", line 805, in init super().init( File "/usr/local/lib/python3.12/site-packages/aiohttp/connector.py", line 252, in init loop = loop or asyncio.get_running_loop() ^^^^^^^^^^^^^^^^^^^^^^^^^^ RuntimeError: no running event loop`

I look forward to your help in figuring out where to look for the problem.

Jandokus commented 2 months ago

This issue can be closed. It turns out I was still working with an old version of Monitor Docker.