Hass won't start after Ubuntu upgrade

I did a release upgrade from Ubuntu 17.04 to 18.04 and now my Hass doesn’t start.

When I do a ’ sudo systemctl status home-assistant.service’ I get this

● home-assistant.service - Home Assistant
Loaded: loaded (/lib/systemd/system/home-assistant.service; enabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Sat 2017-08-19 01:06:34 CEST; 7min ago
Process: 1382 ExecStart=/srv/homeassistant/bin/hass -c /home/homeassistant/.homeassistant (code=exited, status=1/FAILURE)
Main PID: 1382 (code=exited, status=1/FAILURE)
CPU: 32ms

Aug 19 01:06:34 hass hass[1382]: File “/srv/homeassistant/lib/python3.5/types.py”, line 166, in
Aug 19 01:06:34 hass hass[1382]: import functools as _functools
Aug 19 01:06:34 hass hass[1382]: File “/srv/homeassistant/lib/python3.5/functools.py”, line 23, in
Aug 19 01:06:34 hass hass[1382]: from weakref import WeakKeyDictionary
Aug 19 01:06:34 hass hass[1382]: File “/srv/homeassistant/lib/python3.5/weakref.py”, line 12, in
Aug 19 01:06:34 hass hass[1382]: from _weakref import (
Aug 19 01:06:34 hass hass[1382]: ImportError: cannot import name ‘_remove_dead_weakref’
Aug 19 01:06:34 hass systemd[1]: home-assistant.service: Main process exited, code=exited, status=1/FAILURE
Aug 19 01:06:34 hass systemd[1]: home-assistant.service: Unit entered failed state.
Aug 19 01:06:34 hass systemd[1]: home-assistant.service: Failed with result ‘exit-code’.

I have no clue what the problem is, anyone here who can help me?

I just did an upgrade from Jessie to Stretch on my Pi. It had a similar problem (although with different import errors). I created a new virtual environment.

First rename the existing venv

$ sudo mv /srv/homeassistant /srv/17-homeassistant

Then follow the instructions for creating a new virtual environment from the website. It is relatively quick as all the packages are already downloaded and just have to be installed.

Everything should start as normal when you have finished.

1 Like

yes! after I followed your instruction and created a new virtual environment it all works now.

Many thank for your help

1 Like