Sanderhuisman / home-assistant-custom-components

🏡 Custom components for Home-Assistant
https://www.home-assistant.io/
Apache License 2.0
33 stars 12 forks source link

Error getting network details of container #17

Closed Shaun-Harrison closed 4 years ago

Shaun-Harrison commented 4 years ago

Im getting the following error during the home assistant initial load

2019-12-05 23:03:40 INFO (Thread-2) [custom_components.docker_monitor] Cannot grab NET usage for container acf9a03096a088edab1b19690160e149a5afd8569a622534cc5214411acd23fc ('networks') Exception in thread Thread-2: Traceback (most recent call last): File "/usr/local/lib/python3.7/threading.py", line 926, in _bootstrap_inner self.run() File "/usr/local/lib/python3.7/threading.py", line 870, in run self._target(*self._args, **self._kwargs) File "/config/custom_components/docker_monitor/init.py", line 408, in _runnable self._notify(stats) File "/config/custom_components/docker_monitor/init.py", line 303, in _notify callback(message) File "/config/custom_components/docker_monitor/switch.py", line 72, in update_callback self.schedule_update_ha_state() File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 407, in schedule_update_ha_state self.hass.add_job(self.async_update_ha_state(force_refresh)) AttributeError: 'NoneType' object has no attribute 'add_job'

I am running home-assistant on rpi3 as a docker container

firestrife23 commented 4 years ago

Having same issue on NUC, you're not alone.

LordShadowen commented 4 years ago

Same here. I think it only happens when the container network is running in host mode. There's a note that this has already been fixed (https://github.com/Sanderhuisman/home-assistant-custom-components/projects/2#card-18678760) but seems not...

dmatik commented 4 years ago

So, any chance to fix that please? At least when I have configured not to create a network sensors at all...

vakilando commented 4 years ago

Same problem here. Running Home Assistant 0.107.7 in a docker container in host mode on Unraid....

ee02217 commented 4 years ago

Same here....

ualex73 commented 4 years ago

I don't want to hijack this repo, but I made a new Monitor Docker inspired on Sanders repo: https://github.com/ualex73/monitor_docker/

It is also available via HACS