Zwave errors after python upgrade

I just updated using the guide in the blog for updating python: https://www.home-assistant.io/blog/2019/06/05/release-94/#deprecating-python-35-support
Now i’m am getting ALL kinds of errors in the startup logs. Home Assistant comes up but for some reason recorder, history, and logbook didn’t start up.

The main issue is all of my zwave is not working. This error is showing:

File "/srv/homeassistant/lib/python3.7/site-packages/openzwave/network.py", line 324, in __init__
    self.dbcon = lite.connect(os.path.join(self._options.user_path, 'pyozw.sqlite'), check_same_thread=False)
NameError: name 'lite' is not defined

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/srv/homeassistant/lib/python3.7/site-packages/homeassistant/config_entries.py", line 273, in async_setup
    hass, self)
  File "/srv/homeassistant/lib/python3.7/site-packages/homeassistant/components/zwave/__init__.py", line 290, in async_setup_entry
    network = hass.data[DATA_NETWORK] = ZWaveNetwork(options, autostart=False)
  File "/srv/homeassistant/lib/python3.7/site-packages/openzwave/network.py", line 329, in __init__
    except lite.Error as e:
NameError: name 'lite' is not defined

I think the root issue is something wrong with sqlite as this shows up:
2019-06-09 20:57:24 ERROR (Recorder) [homeassistant.components.recorder] Error during connection setup: No module named '_sqlite3' (retrying in 3 seconds)

What do now?

Same issue here. History and recorder components does not work neither the zwave.

Same issue here, any suggestions appreciated.

  • Python 3.7.3
  • homeassistant 0.94.3
  • Linux homeassistant 4.9.0-7-amd64 #1 SMP Debian 4.9.110-3+deb9u2 (2018-08-13) x86_64 GNU/Linux

and the log error text.

Jun 16 17:28:15 homeassistant hass[963]: 2019-06-16 17:28:15 INFO (MainThread) [homeassistant.setup] Setting up recorder
Jun 16 17:28:15 homeassistant hass[963]: 2019-06-16 17:28:15 ERROR (Recorder) [homeassistant.components.recorder] Error during connection setup: No module named '_sqlite3' (retrying in 3 seconds)
Jun 16 17:28:18 homeassistant hass[963]: 2019-06-16 17:28:18 ERROR (Recorder) [homeassistant.components.recorder] Error during connection setup: No module named '_sqlite3' (retrying in 3 seconds)
Jun 16 17:28:21 homeassistant hass[963]: 2019-06-16 17:28:21 ERROR (Recorder) [homeassistant.components.recorder] Error during connection setup: No module named '_sqlite3' (retrying in 3 seconds)
Jun 16 17:28:24 homeassistant hass[963]: 2019-06-16 17:28:24 ERROR (Recorder) [homeassistant.components.recorder] Error during connection setup: No module named '_sqlite3' (retrying in 3 seconds)
Jun 16 17:28:25 homeassistant hass[963]: 2019-06-16 17:28:25 WARNING (MainThread) [homeassistant.setup] Setup of recorder is taking over 10 seconds.
Jun 16 17:28:27 homeassistant hass[963]: 2019-06-16 17:28:27 ERROR (Recorder) [homeassistant.components.recorder] Error during connection setup: No module named '_sqlite3' (retrying in 3 seconds)
Jun 16 17:28:30 homeassistant hass[963]: 2019-06-16 17:28:30 ERROR (Recorder) [homeassistant.components.recorder] Error during connection setup: No module named '_sqlite3' (retrying in 3 seconds)
Jun 16 17:28:33 homeassistant hass[963]: 2019-06-16 17:28:33 ERROR (Recorder) [homeassistant.components.recorder] Error during connection setup: No module named '_sqlite3' (retrying in 3 seconds)
Jun 16 17:28:36 homeassistant hass[963]: 2019-06-16 17:28:36 ERROR (Recorder) [homeassistant.components.recorder] Error during connection setup: No module named '_sqlite3' (retrying in 3 seconds)
Jun 16 17:28:39 homeassistant hass[963]: 2019-06-16 17:28:39 ERROR (Recorder) [homeassistant.components.recorder] Error during connection setup: No module named '_sqlite3' (retrying in 3 seconds)
Jun 16 17:28:42 homeassistant hass[963]: 2019-06-16 17:28:42 ERROR (Recorder) [homeassistant.components.recorder] Error during connection setup: No module named '_sqlite3' (retrying in 3 seconds)
Jun 16 17:28:42 homeassistant hass[963]: 2019-06-16 17:28:42 INFO (MainThread) [homeassistant.setup] Setup of domain recorder took 27.2 seconds.
Jun 16 17:28:42 homeassistant hass[963]: 2019-06-16 17:28:42 ERROR (MainThread) [homeassistant.setup] Setup failed for recorder: Component failed to initialize.
Jun 16 17:28:42 homeassistant hass[963]: 2019-06-16 17:28:42 INFO (MainThread) [homeassistant.setup] Setting up zwave
Jun 16 17:28:42 homeassistant hass[963]: 2019-06-16 17:28:42 INFO (MainThread) [homeassistant.setup] Setup of domain zwave took 0.0 seconds.
Jun 16 17:28:42 homeassistant hass[963]: 2019-06-16 17:28:42 WARNING (MainThread) [openzwave] pysqlite is not installed
    19-06-16 17:28:42 ERROR (MainThread) [homeassistant.config_entries] Error setting up entry Z-Wave (import from configuration.yaml) for zwave
Traceback (most recent call last):
  File "/srv/homeassistant/lib/python3.7/site-packages/openzwave/network.py", line 324, in __init__
    self.dbcon = lite.connect(os.path.join(self._options.user_path, 'pyozw.sqlite'), check_same_thread=False)
NameError: name 'lite' is not defined

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/srv/homeassistant/lib/python3.7/site-packages/homeassistant/config_entries.py", line 273, in async_setup
    hass, self)
  File "/srv/homeassistant/lib/python3.7/site-packages/homeassistant/components/zwave/__init__.py", line 290, in async_setup_entry
    network = hass.data[DATA_NETWORK] = ZWaveNetwork(options, autostart=False)
  File "/srv/homeassistant/lib/python3.7/site-packages/openzwave/network.py", line 329, in __init__
    except lite.Error as e:
NameError: name 'lite' is not defined

for others who struggled with upgrading, the answer was to install libsqlite3-dev and compile Python3.7 with --enable-loadable-sqlite-extensions flag.
Everything back working again.

4 Likes

could you please tell me how to compile python3.7 with the flag mentioned? I have hassbian installed

This was on Debian stretch base. 3.7.4 is available now too.

wget https://www.python.org/ftp/python/3.7.3/Python-3.7.3.tgz
tar -xzvf Python-3.7.3.tgz
cd Python-3.7.3
./configure --enable-optimizations --enable-loadable-sqlite-extensions
make
make altinstall
python3.7 -V