ualex73 / monitor_docker

Monitor Docker containers from Home Assistant
Apache License 2.0
267 stars 34 forks source link

Error on boot using HA 2021.12.4 #86

Closed mario-tux closed 2 years ago

mario-tux commented 2 years ago

I can't use monitor_docker with latest release of HA. From my log:

Logger: custom_components.monitor_docker.helpers
Source: custom_components/monitor_docker/helpers.py:162
Integration: Monitor Docker (documentation, issues)
First occurred: 12:10:57 (2 occurrences)
Last logged: 12:10:57

[Sauron Docker]: Can not connect to Docker API (module 'aiodocker' has no attribute 'Docker')
[Saruman Docker]: Can not connect to Docker API (module 'aiodocker' has no attribute 'Docker')
Traceback (most recent call last):
  File "/config/custom_components/monitor_docker/helpers.py", line 162, in __init__
    self._api = aiodocker.Docker(url=url)
AttributeError: module 'aiodocker' has no attribute 'Docker'

I'm actually using the release 1.14beta3 of your component.

ualex73 commented 2 years ago

I just upgraded to 2021.12.4 myself too (running docker version on amd64 with 1.14-beta3), but I do not see this error. There seems to be an issue with your installation somewhere. Can you give some more background what you are running? Also, if it is a docker instance, can you delete & re-create it? Do you have a directory like "/usr/local/lib/python3.9/site-packages/aiodocker"? Can you show the content of that one (If you run python 3.8 of 3.10, the directory name can be different). Same for "ls -l /usr/local/lib/python3.9/site-packages/ | grep aio", then it shows which aiodocker version is installed.

mario-tux commented 2 years ago

Hi, I'm using HassOS. Entering in the homeassistant docker image with Portainer add-on I can spot the following files:

bash-5.1# ls -l /usr/local/lib/python3.9/site-packages/ | grep aio
drwxr-xr-x    4 root     root          4096 Dec 21 05:08 aio_geojson_client
drwxr-xr-x    2 root     root          4096 Dec 21 05:08 aio_geojson_client-0.15.dist-info
drwxr-xr-x    3 root     root          4096 Dec 21 05:08 aio_geojson_geonetnz_quakes
drwxr-xr-x    2 root     root          4096 Dec 21 05:08 aio_geojson_geonetnz_quakes-0.13.dist-info
drwxr-xr-x    3 root     root          4096 Dec 21 05:08 aio_geojson_geonetnz_volcano
drwxr-xr-x    2 root     root          4096 Dec 21 05:08 aio_geojson_geonetnz_volcano-0.6.dist-info
drwxr-xr-x    3 root     root          4096 Dec 21 05:08 aio_geojson_nsw_rfs_incidents
drwxr-xr-x    2 root     root          4096 Dec 21 05:08 aio_geojson_nsw_rfs_incidents-0.4.dist-info
drwxr-xr-x    4 root     root          4096 Dec 21 05:08 aio_georss_client
drwxr-xr-x    2 root     root          4096 Dec 21 05:08 aio_georss_client-0.8.dist-info
drwxr-xr-x    3 root     root          4096 Dec 21 05:08 aio_georss_gdacs
drwxr-xr-x    2 root     root          4096 Dec 21 05:08 aio_georss_gdacs-0.5.dist-info
drwxr-xr-x    4 root     root          4096 Dec 21 05:08 aioambient
drwxr-xr-x    2 root     root          4096 Dec 21 05:08 aioambient-2021.11.0.dist-info
drwxr-xr-x    4 root     root          4096 Dec 21 05:08 aioasuswrt
drwxr-xr-x    2 root     root          4096 Dec 21 05:08 aioasuswrt-1.4.0.dist-info
drwxr-xr-x    3 root     root          4096 Dec 21 05:08 aioazuredevops
drwxr-xr-x    2 root     root          4096 Dec 21 05:08 aioazuredevops-1.3.5.dist-info
drwxr-xr-x    3 root     root          4096 Dec 21 05:08 aiobotocore
drwxr-xr-x    2 root     root          4096 Dec 21 05:08 aiobotocore-1.2.2.dist-info
drwxr-xr-x    5 root     root          4096 Dec 21 05:08 aiocache
drwxr-xr-x    2 root     root          4096 Dec 21 05:08 aiocache-0.11.1.dist-info
drwxr-xr-x    9 root     root          4096 Dec 21 05:08 aiocoap
drwxr-xr-x    2 root     root          4096 Dec 21 05:08 aiocoap-0.4.3.dist-info
drwxr-xr-x    3 root     root          4096 Dec 21 05:09 aioconsole
drwxr-xr-x    2 root     root          4096 Dec 21 05:09 aioconsole-0.3.3.dist-info
drwxr-xr-x    3 root     root          4096 Dec 21 05:07 aiodiscover
drwxr-xr-x    2 root     root          4096 Dec 21 05:07 aiodiscover-1.4.5.dist-info
drwxr-xr-x    3 root     root          4096 Dec 21 05:08 aiodns
drwxr-xr-x    2 root     root          4096 Dec 21 05:08 aiodns-3.0.0.dist-info
drwxr-xr-x    3 root     root          4096 Dec 21 19:59 aiodocker
drwxr-xr-x    2 root     root          4096 Dec 21 19:59 aiodocker-0.21.0.dist-info
drwxr-xr-x    3 root     root          4096 Dec 21 05:08 aioeafm
drwxr-xr-x    2 root     root          4096 Dec 21 05:08 aioeafm-0.1.2.dist-info
drwxr-xr-x    3 root     root          4096 Dec 21 05:08 aioeagle
drwxr-xr-x    2 root     root          4096 Dec 21 05:08 aioeagle-1.1.0.dist-info
drwxr-xr-x    3 root     root          4096 Dec 21 05:08 aioemonitor
drwxr-xr-x    2 root     root          4096 Dec 21 05:08 aioemonitor-1.0.5.dist-info
drwxr-xr-x    3 root     root          4096 Dec 21 05:08 aioesphomeapi
drwxr-xr-x    2 root     root          4096 Dec 21 05:08 aioesphomeapi-10.6.0.dist-info
drwxr-xr-x    5 root     root          4096 Dec 21 05:08 aiofiles
drwxr-xr-x    2 root     root          4096 Dec 21 05:08 aiofiles-0.8.0.dist-info
drwxr-xr-x    4 root     root          4096 Dec 21 05:08 aioflo
drwxr-xr-x    2 root     root          4096 Dec 21 05:08 aioflo-2021.11.0.dist-info
drwxr-xr-x    3 root     root          4096 Dec 21 05:08 aioftp
drwxr-xr-x    2 root     root          4096 Dec 21 05:08 aioftp-0.12.0.dist-info
drwxr-xr-x    8 root     root          4096 Dec 21 05:08 aiogithubapi
drwxr-xr-x    2 root     root          4096 Dec 21 05:08 aiogithubapi-21.11.0.dist-info
drwxr-xr-x    5 root     root          4096 Dec 21 05:08 aioguardian
drwxr-xr-x    2 root     root          4096 Dec 21 05:08 aioguardian-2021.11.0.dist-info
drwxr-xr-x    3 root     root          4096 Dec 21 05:08 aioharmony
drwxr-xr-x    2 root     root          4096 Dec 21 05:08 aioharmony-0.2.8.dist-info
drwxr-xr-x    9 root     root          4096 Dec 21 05:08 aiohomekit
drwxr-xr-x    2 root     root          4096 Dec 21 05:08 aiohomekit-0.6.4.dist-info
drwxr-xr-x    4 root     root          4096 Dec 21 05:01 aiohttp
drwxr-xr-x    2 root     root          4096 Dec 21 05:01 aiohttp-3.8.1.dist-info
drwxr-xr-x    3 root     root          4096 Dec 21 05:07 aiohttp_cors
drwxr-xr-x    2 root     root          4096 Dec 21 05:07 aiohttp_cors-0.7.0.dist-info
drwxr-xr-x    5 root     root          4096 Dec 21 05:08 aiohue
drwxr-xr-x    2 root     root          4096 Dec 21 05:08 aiohue-3.0.7.dist-info
drwxr-xr-x    3 root     root          4096 Dec 21 05:08 aioimaplib
drwxr-xr-x    2 root     root          4096 Dec 21 05:08 aioimaplib-0.9.0.dist-info
drwxr-xr-x    4 root     root          4096 Dec 21 05:08 aioitertools
drwxr-xr-x    2 root     root          4096 Dec 21 05:08 aioitertools-0.8.0.dist-info
drwxr-xr-x    7 root     root          4096 Dec 21 05:08 aiokafka
drwxr-xr-x    2 root     root          4096 Dec 21 05:08 aiokafka-0.6.0.dist-info
drwxr-xr-x    3 root     root          4096 Dec 21 05:08 aiokef
drwxr-xr-x    2 root     root          4096 Dec 21 05:08 aiokef-0.2.16.dist-info
drwxr-xr-x    3 root     root          4096 Dec 21 05:08 aiolifx
drwxr-xr-x    2 root     root          4096 Dec 21 05:08 aiolifx-0.7.0.dist-info
drwxr-xr-x    3 root     root          4096 Dec 21 05:08 aiolifx_effects
drwxr-xr-x    2 root     root          4096 Dec 21 05:08 aiolifx_effects-0.2.2.dist-info
drwxr-xr-x    3 root     root          4096 Dec 21 05:08 aiolip
drwxr-xr-x    2 root     root          4096 Dec 21 05:08 aiolip-1.1.6.dist-info
drwxr-xr-x    3 root     root          4096 Dec 21 05:08 aiolookin
drwxr-xr-x    2 root     root          4096 Dec 21 05:08 aiolookin-0.0.4.dist-info
drwxr-xr-x    5 root     root          4096 Dec 21 05:08 aiolyric
drwxr-xr-x    2 root     root          4096 Dec 21 05:08 aiolyric-1.0.8.dist-info
drwxr-xr-x    3 root     root          4096 Dec 21 05:08 aiomodernforms
drwxr-xr-x    2 root     root          4096 Dec 21 05:08 aiomodernforms-0.1.8.dist-info
drwxr-xr-x    3 root     root          4096 Dec 21 05:08 aiomusiccast
drwxr-xr-x    2 root     root          4096 Dec 21 05:08 aiomusiccast-0.14.2.dist-info
drwxr-xr-x    3 root     root          4096 Dec 21 05:08 aionanoleaf
drwxr-xr-x    2 root     root          4096 Dec 21 05:08 aionanoleaf-0.1.1.dist-info
drwxr-xr-x    3 root     root          4096 Dec 21 05:08 aionotify
drwxr-xr-x    2 root     root          4096 Dec 21 05:08 aionotify-0.2.0.dist-info
drwxr-xr-x    3 root     root          4096 Dec 21 05:08 aionotion
drwxr-xr-x    2 root     root          4096 Dec 21 05:08 aionotion-3.0.2.dist-info
drwxr-xr-x    3 root     root          4096 Dec 21 05:08 aiopulse
drwxr-xr-x    2 root     root          4096 Dec 21 05:08 aiopulse-0.4.3.dist-info
drwxr-xr-x    6 root     root          4096 Dec 21 05:08 aiopvapi
drwxr-xr-x    2 root     root          4096 Dec 21 05:08 aiopvapi-1.6.19.dist-info
drwxr-xr-x    3 root     root          4096 Dec 21 05:08 aiopvpc
drwxr-xr-x    2 root     root          4096 Dec 21 05:08 aiopvpc-2.2.4.dist-info
drwxr-xr-x    3 root     root          4096 Dec 21 05:08 aiopylgtv
drwxr-xr-x    2 root     root          4096 Dec 21 05:08 aiopylgtv-0.4.0.dist-info
drwxr-xr-x    3 root     root          4096 Dec 21 05:08 aiorecollect
drwxr-xr-x    2 root     root          4096 Dec 21 05:08 aiorecollect-1.0.8.dist-info
drwxr-xr-x    3 root     root          4096 Dec 21 05:08 aioridwell
drwxr-xr-x    2 root     root          4096 Dec 21 05:08 aioridwell-0.2.0.dist-info
drwxr-xr-x    3 root     root          4096 Dec 21 05:08 aioserial
drwxr-xr-x    2 root     root          4096 Dec 21 05:08 aioserial-1.3.0.dist-info
drwxr-xr-x    3 root     root          4096 Dec 21 05:08 aioshelly
drwxr-xr-x    2 root     root          4096 Dec 21 05:08 aioshelly-1.0.5.dist-info
drwxr-xr-x    3 root     root          4096 Dec 21 05:01 aiosignal
drwxr-xr-x    2 root     root          4096 Dec 21 05:01 aiosignal-1.2.0.dist-info
drwxr-xr-x    4 root     root          4096 Dec 21 05:08 aiosqlite
drwxr-xr-x    2 root     root          4096 Dec 21 05:08 aiosqlite-0.17.0.dist-info
drwxr-xr-x    6 root     root          4096 Dec 21 05:08 aioswitcher
drwxr-xr-x    2 root     root          4096 Dec 21 05:08 aioswitcher-2.0.6.dist-info
drwxr-xr-x    3 root     root          4096 Dec 21 05:08 aiosyncthing
drwxr-xr-x    2 root     root          4096 Dec 21 05:08 aiosyncthing-0.5.1.dist-info
drwxr-xr-x    3 root     root          4096 Dec 21 05:08 aiotractive
drwxr-xr-x    2 root     root          4096 Dec 21 05:08 aiotractive-0.5.2.dist-info
drwxr-xr-x    3 root     root          4096 Dec 21 05:08 aiounifi
drwxr-xr-x    2 root     root          4096 Dec 21 05:08 aiounifi-28.dist-info
drwxr-xr-x    5 root     root          4096 Dec 21 05:08 aiovlc
drwxr-xr-x    2 root     root          4096 Dec 21 05:08 aiovlc-0.1.0.dist-info
drwxr-xr-x    3 root     root          4096 Dec 21 05:08 aiowatttime
drwxr-xr-x    2 root     root          4096 Dec 21 05:08 aiowatttime-0.1.1.dist-info
drwxr-xr-x    2 root     root          4096 Dec 21 05:08 aioymaps-1.2.2.dist-info
-rw-r--r--    1 root     root          5411 Dec 21 05:08 aioymaps.py
drwxr-xr-x    2 root     root          4096 Dec 21 05:09 velbus_aio-2021.11.7.dist-info
drwxr-xr-x    5 root     root          4096 Dec 21 05:09 velbusaio

Does it help?

ualex73 commented 2 years ago

Hmmm ... the right aiodocker version is there, so it is not clear where the "issue" comes from. I will try to install hassOS in the next few days and see if I can reproduce it.

mario-tux commented 2 years ago

It started to work again: I updated to 2021.12.5. I don't know if it is related.

ualex73 commented 2 years ago

I don't think so, I think re-creating your docker container solved it (then it re-pulls the docker dependancies). But thanks for letting us know it is resolved (then it is not a persistent issue luckily)