Zwave failed to initalise after upgrading to 0.63 (and how I solved it)

I just upgraded from 0.62.1 to 0.63, and found that the zwave component could not initialise.

Here the relevant log entries:

Feb 11 22:07:50 hostname hass[5669]: #033[31m2018-02-11 22:07:50 ERROR (MainThread) [homeassistant.setup] Error during setup of component zwave#033[0m
Feb 11 22:07:50 hostname hass[5669]: Traceback (most recent call last):
Feb 11 22:07:50 hostname hass[5669]:   File "/opt/home-assistant/lib/python3.5/site-packages/homeassistant/setup.py", line 148, in _async_setup_component
Feb 11 22:07:50 hostname hass[5669]:     component.setup, hass, processed_config)
Feb 11 22:07:50 hostname hass[5669]:   File "/usr/lib/python3.5/asyncio/futures.py", line 361, in __iter__
Feb 11 22:07:50 hostname hass[5669]:     yield self  # This tells Task to wait for completion.
Feb 11 22:07:50 hostname hass[5669]:   File "/usr/lib/python3.5/asyncio/tasks.py", line 296, in _wakeup
Feb 11 22:07:50 hostname hass[5669]:     future.result()
Feb 11 22:07:50 hostname hass[5669]:   File "/usr/lib/python3.5/asyncio/futures.py", line 274, in result
Feb 11 22:07:50 hostname hass[5669]:     raise self._exception
Feb 11 22:07:50 hostname hass[5669]:   File "/usr/lib/python3.5/concurrent/futures/thread.py", line 55, in run
Feb 11 22:07:50 hostname hass[5669]:     result = self.fn(*self.args, **self.kwargs)
Feb 11 22:07:50 hostname hass[5669]:   File "/opt/home-assistant/lib/python3.5/site-packages/homeassistant/components/zwave/__init__.py", line 275, in setup
Feb 11 22:07:50 hostname hass[5669]:     config_path=config[DOMAIN].get(CONF_CONFIG_PATH))
Feb 11 22:07:50 hostname hass[5669]:   File "/opt/home-assistant/lib/python3.5/site-packages/openzwave-0.3.1-py3.5.egg/openzwave/option.py", line 77, in __init__
Feb 11 22:07:50 hostname hass[5669]:     self._user_path = user_path
Feb 11 22:07:50 hostname hass[5669]: AttributeError: attribute '_user_path' of 'libopenzwave.PyOptions' objects is not writable#033[0m
Feb 11 22:07:50 hostname hass[5669]: #033[32m2018-02-11 22:07:50 INFO (MainThread) [homeassistant.core] Bus:Handling <Event system_log_event[L]: exception=Traceback (most recent call last):
Feb 11 22:07:50 hostname hass[5669]:   File "/opt/home-assistant/lib/python3.5/site-packages/homeassistant/setup.py", line 148, in _async_setup_component
Feb 11 22:07:50 hostname hass[5669]:     component.setup, hass, processed_config)
Feb 11 22:07:50 hostname hass[5669]:   File "/usr/lib/python3.5/asyncio/futures.py", line 361, in __iter__
Feb 11 22:07:50 hostname hass[5669]:     yield self  # This tells Task to wait for completion.
Feb 11 22:07:50 hostname hass[5669]:   File "/usr/lib/python3.5/asyncio/tasks.py", line 296, in _wakeup
Feb 11 22:07:50 hostname hass[5669]:     future.result()
Feb 11 22:07:50 hostname hass[5669]:   File "/usr/lib/python3.5/asyncio/futures.py", line 274, in result
Feb 11 22:07:50 hostname hass[5669]:     raise self._exception
Feb 11 22:07:50 hostname hass[5669]:   File "/usr/lib/python3.5/concurrent/futures/thread.py", line 55, in run
Feb 11 22:07:50 hostname hass[5669]:     result = self.fn(*self.args, **self.kwargs)
Feb 11 22:07:50 hostname hass[5669]:   File "/opt/home-assistant/lib/python3.5/site-packages/homeassistant/components/zwave/__init__.py", line 275, in setup
Feb 11 22:07:50 hostname hass[5669]:     config_path=config[DOMAIN].get(CONF_CONFIG_PATH))
Feb 11 22:07:50 hostname hass[5669]:   File "/opt/home-assistant/lib/python3.5/site-packages/openzwave-0.3.1-py3.5.egg/openzwave/option.py", line 77, in __init__
Feb 11 22:07:50 hostname hass[5669]:     self._user_path = user_path
Feb 11 22:07:50 hostname hass[5669]: AttributeError: attribute '_user_path' of 'libopenzwave.PyOptions' objects is not writable
Feb 11 22:07:50 hostname hass[5669]: , timestamp=1518347270.086737, message=Error during setup of component zwave, source=components/zwave/__init__.py, level=ERROR>#033[0m
Feb 11 22:07:50 hostname hass[5669]: #033[32m2018-02-11 22:07:50 INFO (MainThread) [homeassistant.core] Bus:Handling <Event call_service[L]: service=create, service_call_id=140682261145640-4, service_data=message=The following components and platforms could not be set up:
Feb 11 22:07:50 hostname hass[5669]:  - [zwave](https://home-assistant.io/components/zwave/)
Feb 11 22:07:50 hostname hass[5669]: Please check your config., title=Invalid config, notification_id=invalid_config, domain=persistent_notification>#033[0m
Feb 11 22:07:50 hostname hass[5669]: #033[32m2018-02-11 22:07:50 INFO (MainThread) [homeassistant.core] Bus:Handling <Event state_changed[L]: old_state=None, new_state=<state persistent_notification.invalid_config=notifying; message=The following components and platforms could not be set up:
Feb 11 22:07:50 hostname hass[5669]:  - [zwave](https://home-assistant.io/components/zwave/)
Feb 11 22:07:50 hostname hass[5669]: Please check your config., title=Invalid config @ 2018-02-11T22:07:50.094243+11:00>, entity_id=persistent_notification.invalid_config>#033[0m

This is a manual installation of HA running in a Python 3.5 virtual environment on Ubuntu 16.04.3.

I subsequently uninstalled the following python packages (pip uninstall ...) and let HA reinstall them automatically at service restart.

  • python_openzwave
  • openzwave
  • pyozwman
  • pyozwweb

This solved the issue for me, maybe it works for you, too, should you face the same error.

2 Likes

I’m running hass on a Raspberry Pi (Raspbian Jessie) and ran into the same issue after upgrading to 0.63.1. Even after uninstalling the specified packages, it still wouldn’t start up. For now, I’ve reverted back to 0.62.1

Are you still seeing the same error message?

The key line for finding the relevant libraries was this one:

Feb 11 22:07:50 hostname hass[5669]:   File "/opt/home-assistant/lib/python3.5/site-packages/openzwave-0.3.1-py3.5.egg/openzwave/option.py", line 77, in __init__

After uninstalling the openzwave lib, a very similar error appeared mentioning the pyozwman lib, etc. until it worked.

I can confirm this bug. I was updating HA in venv from 0.61.1 to 0.63.1 and upon restart my z-wave component failed.

Running pip3 upgrade on python_openzwave (didn’t do anything else) fixed the issue.

When I attempted to run

pip3 install --upgrade python_openzwave

I got

Collecting python_openzwave
Using cached python_openzwave-0.4.4.zip
Complete output from command python setup.py egg_info:
Can’t find Cython
Traceback (most recent call last):
File “”, line 1, in
File “/tmp/pip-build-mf_m6gpn/python-openzwave/setup.py”, line 43, in
print(current_template.ctx)
File “/tmp/pip-build-mf_m6gpn/python-openzwave/pyozw_setup.py”, line 226, in ctx
self.finalize_context(self._ctx)
File “/tmp/pip-build-mf_m6gpn/python-openzwave/pyozw_setup.py”, line 247, in finalize_context
ctx[‘define_macros’] += [(‘PY_LIB_FLAVOR’, self.flavor.replace(’–flavor=’,’’))]
TypeError: ‘NoneType’ object is not subscriptable
sysargv [’-c’, ‘egg_info’, ‘–egg-base’, ‘pip-egg-info’]
<pyozw_setup.SharedTemplate object at 0x764221f0>

----------------------------------------

Command “python setup.py egg_info” failed with error code 1 in /tmp/pip-build-mf_m6gpn/python-openzwave/

(This is on a Raspberry Pi running Raspbian Jessie)

Almost always means you’re using, or have previously used, the wrong account. Check that you ran that command as the account you run Home Assistant as.

I don’t think it’s a permissions issue. I’m using the exact same process that I’ve used previously to upgrade HA. I think the clue is “Can’t find Cython”. I tried

apt-get -y install cython

and

apt-get -y install cython3

which did not help, but

pip3 install Cython

might be getting closer. Now I get:

arm-linux-gnueabihf-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -g -fstack-protector-strong -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 -fPIC -DPY_LIB_VERSION=0.4.4 -DPY_SSIZE_T_CLEAN=1 -DPY_LIB_FLAVOR=shared -DPY_LIB_BACKEND=cython -I/usr/include/python3.4m -I/srv/homeassistant/include/python3.4m -c src-lib/libopenzwave/libopenzwave.cpp -o build/temp.linux-armv7l-3.4/src-lib/libopenzwave/libopenzwave.o -I/usr/include/openzwave/ -I/usr/include/openzwave/ -I/usr/include/openzwave/
cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for C/ObjC but not for C++
src-lib/libopenzwave/libopenzwave.cpp:3:0: warning: “PY_SSIZE_T_CLEAN” redefined
#define PY_SSIZE_T_CLEAN
^
:0:0: note: this is the location of the previous definition
In file included from /usr/include/openzwave/aes/aescpp.h:26:0,
from /usr/include/openzwave/Driver.h:42,
from src-lib/libopenzwave/libopenzwave.cpp:550:
/usr/include/openzwave/aes/aes.h:75:0: warning: ignoring #pragma warning [-Wunknown-pragmas]
#pragma warning( disable : 4324 )
^
/usr/include/openzwave/aes/aes.h:93:0: warning: ignoring #pragma warning [-Wunknown-pragmas]
#pragma warning( default : 4324 )
^
src-lib/libopenzwave/libopenzwave.cpp:551:21: fatal error: ValueID.h: No such file or directory
#include “ValueID.h”

I’m using openzwave-1.4.164. Do I need a new version? As far as I can tell, this is the newest stable version available at openzwave.com, but there are newer development snapshots available.

I hope everyone waited for OZW to be updated after they upgraded HA. After every HA upgrade, make sure after the restart the HA isn’t still upgrading other components before panicking. With .63, OpenZwave was upgraded to 4.3 and it took some time to compile and install it along with a few other components.

1 Like

Well, it’s a hack, and isn’t really the right way to do it, but I got it to work by doing

cd /usr/include/openzwave/
ln -s value_classes/* .
ln -s platform/* .

then

pip3 install --upgrade python_openzwave==0.4.3

Which now completes successfully - for some reason the build is only looking for header files in /usr/include/openzwave, and not looking in the value_classes and platform subdirectories. Now

pip3 install --upgrade homeassistant

successfully updates to 0.63.1 with zwave

2 Likes

With regards to python_openzwave not installing because cython missing, there is an existing issue on GitHub:

Hey man, thanks a lot. I realize that’s it’s not the right way to do it, but this was the key to getting python-openzwave working on my new NUC home server.

I believe I found a pull request at their github that might fix this, but it was closed without any given reason - https://github.com/OpenZWave/open-zwave/pull/1448

I will link to this thread to see if there is a response.

Thanks again!!