home-assistant / core

:house_with_garden: Open source home automation that puts local control and privacy first.
https://www.home-assistant.io
Apache License 2.0
74.08k stars 31.09k forks source link

Zwave errors on startup after upgrade to 0.39.3 #6406

Closed dap35 closed 7 years ago

dap35 commented 7 years ago

Make sure you are running the latest version of Home Assistant before reporting an issue.

You should only file an issue if you found a bug. Feature and enhancement requests should go in the Feature Requests section of our community forum:

Home Assistant release (hass --version): 0.39.3

Python release (python3 --version): 3.4.2

Component/platform: homeassistant.components.sensor

Description of problem: getting zwave errors in log after upgrade then restart/reboot. Errors did not occur before upgrade.

Expected:

Problem-relevant configuration.yaml entries and steps to reproduce:

Traceback (if applicable):

17-03-04 14:49:18 ERROR (MainThread) [homeassistant.components.sensor] Error while setting up platform zwave
Traceback (most recent call last):
  File "/srv/homeassistant/homeassistant_venv/lib/python3.4/site-packages/homeassistant/helpers/entity_component.py", line 151, in _async_setup_platform
    entity_platform.add_entities, discovery_info
  File "/usr/lib/python3.4/asyncio/futures.py", line 388, in __iter__
    yield self  # This tells Task to wait for completion.
  File "/usr/lib/python3.4/asyncio/tasks.py", line 286, in _wakeup
    value = future.result()
  File "/usr/lib/python3.4/asyncio/futures.py", line 277, in result
    raise self._exception
  File "/usr/lib/python3.4/concurrent/futures/thread.py", line 54, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/srv/homeassistant/homeassistant_venv/lib/python3.4/site-packages/homeassistant/components/sensor/zwave.py", line 43, in setup_platform
    add_devices([ZWaveMultilevelSensor(value)])
  File "/srv/homeassistant/homeassistant_venv/lib/python3.4/site-packages/homeassistant/components/sensor/zwave.py", line 55, in __init__
    zwave.ZWaveDeviceEntity.__init__(self, value, DOMAIN)
  File "/srv/homeassistant/homeassistant_venv/lib/python3.4/site-packages/homeassistant/components/zwave/__init__.py", line 681, in __init__
    self._update_attributes()
  File "/srv/homeassistant/homeassistant_venv/lib/python3.4/site-packages/homeassistant/components/zwave/__init__.py", line 705, in _update_attributes
    if self._value.node.can_wake_up():
  File "/srv/homeassistant/homeassistant_venv/lib/python3.4/site-packages/openzwave-0.3.1-py3.4.egg/openzwave/command.py", line 354, in can_wake_up
    res = self.get_values(class_id=0x84)
  File "/srv/homeassistant/homeassistant_venv/lib/python3.4/site-packages/openzwave-0.3.1-py3.4.egg/openzwave/node.py", line 440, in get_values
    for value in self.values:
RuntimeError: dictionary changed size during iteration
17-03-04 14:49:18 ERROR (MainThread) [homeassistant.components.sensor] Error while setting up platform zwave
Traceback (most recent call last):
  File "/srv/homeassistant/homeassistant_venv/lib/python3.4/site-packages/homeassistant/helpers/entity_component.py", line 151, in _async_setup_platform
    entity_platform.add_entities, discovery_info
  File "/usr/lib/python3.4/asyncio/futures.py", line 388, in __iter__
    yield self  # This tells Task to wait for completion.
  File "/usr/lib/python3.4/asyncio/tasks.py", line 286, in _wakeup
    value = future.result()
  File "/usr/lib/python3.4/asyncio/futures.py", line 277, in result
    raise self._exception
  File "/usr/lib/python3.4/concurrent/futures/thread.py", line 54, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/srv/homeassistant/homeassistant_venv/lib/python3.4/site-packages/homeassistant/components/sensor/zwave.py", line 43, in setup_platform
    add_devices([ZWaveMultilevelSensor(value)])
  File "/srv/homeassistant/homeassistant_venv/lib/python3.4/site-packages/homeassistant/components/sensor/zwave.py", line 55, in __init__
    zwave.ZWaveDeviceEntity.__init__(self, value, DOMAIN)
  File "/srv/homeassistant/homeassistant_venv/lib/python3.4/site-packages/homeassistant/components/zwave/__init__.py", line 681, in __init__
    self._update_attributes()
  File "/srv/homeassistant/homeassistant_venv/lib/python3.4/site-packages/homeassistant/components/zwave/__init__.py", line 705, in _update_attributes
    if self._value.node.can_wake_up():
  File "/srv/homeassistant/homeassistant_venv/lib/python3.4/site-packages/openzwave-0.3.1-py3.4.egg/openzwave/command.py", line 354, in can_wake_up
    res = self.get_values(class_id=0x84)
  File "/srv/homeassistant/homeassistant_venv/lib/python3.4/site-packages/openzwave-0.3.1-py3.4.egg/openzwave/node.py", line 440, in get_values
    for value in self.values:
RuntimeError: dictionary changed size during iteration
17-03-04 14:49:18 ERROR (MainThread) [homeassistant.components.sensor] Error while setting up platform zwave
Traceback (most recent call last):
  File "/srv/homeassistant/homeassistant_venv/lib/python3.4/site-packages/homeassistant/helpers/entity_component.py", line 151, in _async_setup_platform
    entity_platform.add_entities, discovery_info
  File "/usr/lib/python3.4/asyncio/futures.py", line 388, in __iter__
    yield self  # This tells Task to wait for completion.
  File "/usr/lib/python3.4/asyncio/tasks.py", line 286, in _wakeup
    value = future.result()
  File "/usr/lib/python3.4/asyncio/futures.py", line 277, in result
    raise self._exception
  File "/usr/lib/python3.4/concurrent/futures/thread.py", line 54, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/srv/homeassistant/homeassistant_venv/lib/python3.4/site-packages/homeassistant/components/sensor/zwave.py", line 43, in setup_platform
    add_devices([ZWaveMultilevelSensor(value)])
  File "/srv/homeassistant/homeassistant_venv/lib/python3.4/site-packages/homeassistant/components/sensor/zwave.py", line 55, in __init__
    zwave.ZWaveDeviceEntity.__init__(self, value, DOMAIN)
  File "/srv/homeassistant/homeassistant_venv/lib/python3.4/site-packages/homeassistant/components/zwave/__init__.py", line 681, in __init__
    self._update_attributes()
  File "/srv/homeassistant/homeassistant_venv/lib/python3.4/site-packages/homeassistant/components/zwave/__init__.py", line 705, in _update_attributes
    if self._value.node.can_wake_up():
  File "/srv/homeassistant/homeassistant_venv/lib/python3.4/site-packages/openzwave-0.3.1-py3.4.egg/openzwave/command.py", line 354, in can_wake_up
    res = self.get_values(class_id=0x84)
  File "/srv/homeassistant/homeassistant_venv/lib/python3.4/site-packages/openzwave-0.3.1-py3.4.egg/openzwave/node.py", line 440, in get_values
    for value in self.values:

Additional info:

Toonix commented 7 years ago

Logbook crashes Ha 0.39.3 even after just one day uptime. Deleted db when I did the update

Mar 04 21:27:51 HomeAssistant hass[9671]: File "/home/hass/.homeassistant/deps/cpuinfo/cpuinfo.py", line 170, in run_and_get_stdout Mar 04 21:27:51 HomeAssistant hass[9671]: p1 = subprocess.Popen(command, stdout=subprocess.PIPE, stderr=subprocess.PIPE) Mar 04 21:27:51 HomeAssistant hass[9671]: File "/usr/lib/python3.4/subprocess.py", line 859, in __init__ Mar 04 21:27:51 HomeAssistant hass[9671]: restore_signals, start_new_session) Mar 04 21:27:51 HomeAssistant hass[9671]: File "/usr/lib/python3.4/subprocess.py", line 1395, in _execute_child Mar 04 21:27:51 HomeAssistant hass[9671]: restore_signals, start_new_session, preexec_fn) Mar 04 21:27:51 HomeAssistant hass[9671]: OSError: [Errno 12] Cannot allocate memory Mar 04 21:30:30 HomeAssistant hass[9671]: 17-03-04 21:30:26 ERROR (MainThread) [homeassistant.core] Timer got out of sync. Resetting Mar 04 21:39:24 HomeAssistant systemd[1]: home-assistant.service: main process exited, code=killed, status=9/KILL Mar 04 21:39:25 HomeAssistant systemd[1]: Unit home-assistant.service entered failed state.

jbardi commented 7 years ago

This appears to be a problem with Openzwave and cannot be solved by the HA devs. This has been happening as far back as April 2016 with HA version 0.18.2.

It happens when Zwave is trying to get the battery levels from some devices, in my case it is one of my Kwikset locks. The HA dev turbokongen closed that issue back in July 2016 as he stated the battery level will eventually be discovered by Zwave, and thus HA later on in the boot process or shortly there after.

I am having the same error and my Front Door lock battery is not registering, so I will post an update back here whether it eventually loads or not.

Here is a link to the original issue: https://github.com/home-assistant/home-assistant/issues/1872

UPDATE

Ok, my Kwikset lock battery updated within a few minutes after bootup completed, and I have not seen any additional errors or any problems with any of my Zwave devices functioning correctly.

kirichkov commented 7 years ago

A "hack" I use to get around such issues is fire up Open Zwave Control Panel, let it discover all devices ("Ready" State) and then copy the zwcfg.xml file to home-assistant's configuration directory.

dap35 commented 7 years ago

I am no longer seeing this in either 0.40 or 0.40.1